This documentation is archived and is not being maintained.

ConnectionOptions.Username Property

Gets or sets the user name to be used for the connection operation.

[Visual Basic]
Public Property Username As String
public string Username {get; set;}
public: __property String* get_Username();
public: __property void set_Username(String*);
public function get Username() : String;
public function set Username(String);

Property Value

Null if the connection will use the currently logged-on user; otherwise, a string representing the user name. The default value is null.


If the user name is from a domain other than the current domain, the string may contain the domain name and user name, separated by a backslash: string username = "EnterDomainHere\\EnterUsernameHere";

The strUser parameter cannot be an empty string.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

ConnectionOptions Class | ConnectionOptions Members | System.Management Namespace