Click or drag to resize

WindowsUtilitiesGetUserName Method

Gets the name of the user or other security principal associated with the calling thread. You can specify the format of the returned name. If the thread is impersonating a client, GetUserName returns the name of the client.

Namespace:  ShellBoost.Core.Utilities
Assembly:  ShellBoost.Core (in ShellBoost.Core.dll) Version: 1.8.3.0
Syntax
C#
public static string GetUserName(
	NameFormat format,
	bool throwOnError = true
)

Parameters

format
Type: ShellBoost.Core.UtilitiesNameFormat
The format of the name. If the user account is not in a domain, only SamCompatible is supported.
throwOnError (Optional)
Type: SystemBoolean
true to throw error; otherwise false.

Return Value

Type: String
The name in the specified format.
See Also