Export (0) Print
Expand All

ConnectionOptions.Username Property

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

[Visual Basic]
Public Property Username As String
[C#]
public string Username {get; set;}
[C++]
public: __property String* get_Username();
public: __property void set_Username(String*);
[JScript]
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.

Remarks

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.

Requirements

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

Show:
© 2015 Microsoft