ManagementUserInfo.ToString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the name of the IIS Manager user.
public:
override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Returns
The name of the IIS Manager user.
Examples
The following example displays a collection of ManagementUserInfo objects and displays the ToString method values for each element of the collection. This code example is part of a larger example provided for the ManagementUserInfo class.
// Create a new ManagementUser.
string managementusername = "SuperManager";
string managementuserpassword = "password";
string message = null;
string display = null;
ManagementUserInfoCollection managementUserInfoCollection =
ManagementAuthentication.GetUsers(0, -1);
message = "\nUsers count: " + managementUserInfoCollection.Count.ToString();
display = display + message;
bool isInCollection = false;
message = null;
foreach (ManagementUserInfo userInfo in managementUserInfoCollection)
{
message = message + "\nName: " + userInfo.Name;
message = message + " Enabled: " + userInfo.Enabled;
message = message + " ToString: " + userInfo.ToString();
// Check to see if the management user is already in the collection.
if (managementusername.Equals(userInfo.Name))
{
isInCollection = true;
}
}
Remarks
This method returns the name of the IIS Manager user. The returned value is the same as the value of the Name property.