zoukankan      html  css  js  c++  java
  • C#域验证的代码

    using System.Runtime.InteropServices;
    
    protected bool fun_AuthDomainUser(string username, string domain, string passwd)
        {
            const int LOGON32_LOGON_INTERACTIVE = 2; //通过网络验证账户合法性
            const int LOGON32_PROVIDER_DEFAULT = 0; //使用默认的Windows 2000/NT NTLM验证方
            IntPtr tokenHandle = new IntPtr(0);
            tokenHandle = IntPtr.Zero;
    
            bool checkok = LogonUser(username, domain, passwd, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, ref tokenHandle);
            return checkok;
        }
    
        [DllImport("advapi32.dll")]
        private static extern bool LogonUser(string lpszUsername, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken);
    
  • 相关阅读:
    leetcode
    leetcode
    leetcode
    leetcode
    Postman
    Fiddler抓百度和bing搜索包
    Jmeter脚本录制
    Android Studio使用Maven国内镜像
    Open Live Writer
    PureXXX使用手记
  • 原文地址:https://www.cnblogs.com/wonder315/p/2168821.html
Copyright © 2011-2022 走看看