CreateProcessWithLogonW

C# Signature:

[DllImport("advapi32.dll", SetLastError=true, CharSet=CharSet.Unicode)]
  public static extern bool CreateProcessWithLogonW(
     String             userName,
     String             domain,
     String             password,
     LogonFlags         logonFlags,
     String             applicationName,
     String             commandLine,
     CreationFlags          creationFlags,
     UInt32             environment,
     String             currentDirectory,
     ref  StartupInfo       startupInfo,
     out ProcessInformation     processInformation);

VB Signature:

<DllImport("advapi32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
    Public Function CreateProcessWithLogonW(ByVal userName As String, ByVal domain As String, ByVal password As String, ByVal logonFlags As UInt32, ByVal applicationName As String, ByVal commandLine As String, ByVal creationFlags As UInt32, ByVal environment As UInt32, ByVal currentDirectory As String, ByRef startupInfo As StartupInfo, ByRef processInformation As ProcessInformation) As Boolean
    End Function

Sample code for VB

User-Defined Types:

Sample Code:

Última actualización