asp.net gets the implementation code for the parameters in the system

  • 2020-05-16 06:42:58
  • OfStack

 
/// <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> 
///  The name of the machine  
/// </summary> 
/// <returns></returns> 
public string getMachineName() 
{ 
return System.Environment.MachineName.ToString(); 
} 
/// <summary> 
///  The user name of the login system  
/// </summary> 
/// <returns></returns> 
public string getUserName() 
{ 
return System.Environment.UserName.ToString(); 
} 
/// <summary> 
///  Get 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> 
///  Get a web domain name  
/// </summary> 
/// <returns></returns> 
public string getDomainName() 
{ 
return System.Environment.UserDomainName.ToString(); 
} 
/// <summary> 
///  Gets network memory footprint  
/// </summary> 
/// <returns></returns> 
public string getUsedMemory() 
{ 
return (System.Environment.WorkingSet/(1024.0*1024.0)).ToString("F")+"M"; 
} 
/// <summary> 
///  The major, minor, internal, and revision Numbers of the common language runtime  
/// </summary> 
/// <returns></returns> 
public string getFxVersion() 
{ 
return System.Environment.Version.ToString(); 
} 

Related articles: