Implementation Code for asp.net to obtain System Parameters

Source: Internet
Author: User

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 ();
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.