admin管理员组

文章数量:1534212

2024年4月23日发(作者:)

If LogonUserA(userName, domain, password, LOGON32_LOGON_INTERACTIVE,

LOGON32_PROVIDER_DEFAULT, token) <> 0 Then

If DuplicateToken(token, 2, tokenDuplicate) <> 0 Then

tempWindowsIdentity = New WindowsIdentity(tokenDuplicate)

impersonationContext = onate()

If Not impersonationContext Is Nothing Then

impersonateValidUser = True

End If

End If

End If

End If

If Not () Then

CloseHandle(tokenDuplicate)

End If

If Not () Then

CloseHandle(token)

End If

End Function

Private Sub undoImpersonation()

()

End Sub

Visual C# .NET

<%@ Page Language="C#"%>

<%@ Import Namespace = "" %>

<%@ Import Namespace = "ty" %>

<%@ Import Namespace = "pal" %>

<%@ Import Namespace = "pServices" %>