Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "GetUserName" in [All]

Interfaces

1: IUri
.

        UInt32 GetUserName([MarshalAs(UnmanagedType.BStr)][Out] out string sUserName);

advapi32

.
Summary
The GetUserName function retrieves the name of the user associated with the current thread.
.

static extern bool GetUserName(System.Text.StringBuilder sb, ref Int32 length);

.

<DllImport("advapi32.dll", EntryPoint:="GetUserNameW", SetLastError:=True)> _

.

Public Function GetUserName(<MarshalAs(UnmanagedType.LPTSTR)>sb As System.Text.StringBuilder, _

.

Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, ByRef nMax As Integer) As Boolean

.

namespace GetUserNameExample

.

        static extern bool GetUserName(StringBuilder lpBuffer, ref int nSize);    

.

            GetUserName(Buffer, ref nSize);

.

Namespace GetUserNameExample

.

        <DllImport("advapi32.dll", EntryPoint:="GetUserNameA", SetLastError:=True)> _

.

        Public Function GetUserName(<MarshalAs(UnamagedType.LPTSTR)>System.Text.StringBuilder sb, _

.

            GetUserName(Buffer, nSize)

.

rc = GetUserName(xstr,max)

.

public static extern bool GetUserName(System.Text.StringBuilder sb, ref Int32 length);

.

[Advapi32.util]::GetUserName($str,[ref]$size) |Out-Null

.
Documentation
[GetUserName] on MSDN

Enums

.

  // Pseudo-name format so GetUserNameEx can return the DNS domain name to

wtsapi32

.

    public static String GetUsernameBySessionId(int sessionId)

ntdsapi

.

      // Pseudo-name format so GetUserNameEx can return the DNS domain name to

secur32

.

public static extern byte GetUserNameEx (ExtendedNameFormat nameFormat,

.

Declare Function GetUserNameEx Lib "secur32.dll" (nameFormat As Integer, _

.

      public static extern byte GetUserNameEx (int nameFormat, StringBuilder userName, ref int userNameSize);

.

     if(0 != GetUserNameEx((int)EXTENDED_NAME_FORMAT.NameSamCompatible, userName, ref userNameSize))

.

  Declare Function GetUserNameExA Lib "secur32.dll" (ByVal nameFormat As Integer, _

.

' GetUserNameExA for ANSI

.

' GetUserNameExW for UNICODE

.

    Public Function GetUserName() As String

.

    If GetUserNameExA(EXTENDED_NAME_FORMAT.NameSamCompatible, UserName, userNameSize) <> 0 Then

.
Documentation
[GetUserNameEx] on MSDNNALYSIS
.
DynamicLoader
Secur32/GetUserNameExA

 
Access PInvoke.net directly from VS: