Copy codeThe Code is as follows:
/// <Summary>
/// Operating system name
/// </Summary>
/// <Returns> </returns>
Public string getOSInfo ()
{
Return System. Environment. OSVersion. Platform. ToString ();
}
/// <Summary>
/// Operating system version
/// </Summary>
/// <Returns> </returns>
Public string getOSVersion ()
{
Return System. Environment. OSVersion. ToString ();
}
/// <Summary>
/// Machine name
/// </Summary>
/// <Returns> </returns>
Public string getMachineName ()
{
Return System. Environment. MachineName. ToString ();
}
/// <Summary>
/// User name used to log on to the system
/// </Summary>
/// <Returns> </returns>
Public string getUserName ()
{
Return System. Environment. UserName. ToString ();
}
/// <Summary>
/// Obtain the Logical Disk
/// </Summary>
/// <Returns> </returns>
Public string getLogicalDrives ()
{
String drivers = "";
String [] logical_drivers = System. Environment. GetLogicalDrives ();
Foreach (string dr in logical_drivers)
{
Drivers + = dr + ";";
}
Return drivers;
}
/// <Summary>
/// Obtain the network domain name
/// </Summary>
/// <Returns> </returns>
Public string getDomainName ()
{
Return System. Environment. UserDomainName. ToString ();
}
/// <Summary>
/// Obtain network memory usage
/// </Summary>
/// <Returns> </returns>
Public string getUsedMemory ()
{
Return (System. Environment. WorkingSet/(1024.0*1024.0). ToString ("F") + "M ";
}
/// <Summary>
/// Main version, minor version, internal version, and revision number of the Public Language Runtime Library
/// </Summary>
/// <Returns> </returns>
Public string getFxVersion ()
{
Return System. Environment. Version. ToString ();
}