ConnectionOptions::Username Property

 

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

Namespace:   System.Management
Assembly:  System.Management (in System.Management.dll)

public:
property String^ Username {
	String^ get();
	void set(String^ value);
}

Property Value

Type: System::String^

Returns a String value used as the user name in a connection to WMI.

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.

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

Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.

The following example connects to a remote computer and displays information about the operating system on the remote computer. A ConnectionOptions is created to connect to the remote computer with the desired connection options.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: