不支持 URI 格式。 using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.xml.Linq;
public partial class _Default : System.Web.UI.Page { protected System.Web.UI.WebControls.Label lbExist; protected System.Web.UI.WebControls.Label Label2; public const int LOGON32_LOGON_INTERACTIVE = 2; public const int LOGON32_PROVIDER_DEFAULT = 0; WindowsImpersonationContext impersonationContext; [DllImport("advapi32.dll", CharSet=CharSet.Auto)] public static extern int LogonUser(String lpszUserName,String lpszDomain, String lpszPassWord,int dwLogonType,int dwLogonProvider, ref IntPtr phToken); [DllImport("advapi32.dll", CharSet=System.Runtime.InteropServices.CharSet.Auto, SetLastError=true)] public extern static int DuplicateToken(IntPtr hToken,int impersonationLevel, ref IntPtr hNewToken);