复制代码 代码如下:
/// <summary>
/// 操作系统名称
/// </summary>
/// <returns></returns>
public string getOSInfo()
{
return System.Environment.OSVersion.Platform.ToString();
}
/// <summary>
/// 操作系统版本
/// </summary>
/// <returns></returns>
public string getOSVersion()
{
return System.Environment.OSVersion.ToString();
}
/// <summary>
/// 机器名
/// </summary>
/// <returns></returns>
public string getMachineName()
{
return System.Environment.MachineName.ToString();
}
/// <summary>
/// 登录系统的用户名
/// </summary>
/// <returns></returns>
public string getUserName()
{
return System.Environment.UserName.ToString();
}
/// <summary>
/// 获取逻辑盘
/// </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>
/// 获取网络域名
/// </summary>
/// <returns></returns>
public string getDomainName()
{
return System.Environment.UserDomainName.ToString();
}
/// <summary>
/// 获取网络内存占用
/// </summary>
/// <returns></returns>
public string getUsedMemory()
{
return (System.Environment.WorkingSet/(1024.0*1024.0)).ToString("F")+"M";
}
/// <summary>
/// 公共语言运行库的主版本、次版本、内部版本和修订号
/// </summary>
/// <returns></returns>
public string getFxVersion()
{
return System.Environment.Version.ToString();
}
/// <summary>
/// 操作系统名称
/// </summary>
/// <returns></returns>
public string getOSInfo()
{
return System.Environment.OSVersion.Platform.ToString();
}
/// <summary>
/// 操作系统版本
/// </summary>
/// <returns></returns>
public string getOSVersion()
{
return System.Environment.OSVersion.ToString();
}
/// <summary>
/// 机器名
/// </summary>
/// <returns></returns>
public string getMachineName()
{
return System.Environment.MachineName.ToString();
}
/// <summary>
/// 登录系统的用户名
/// </summary>
/// <returns></returns>
public string getUserName()
{
return System.Environment.UserName.ToString();
}
/// <summary>
/// 获取逻辑盘
/// </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>
/// 获取网络域名
/// </summary>
/// <returns></returns>
public string getDomainName()
{
return System.Environment.UserDomainName.ToString();
}
/// <summary>
/// 获取网络内存占用
/// </summary>
/// <returns></returns>
public string getUsedMemory()
{
return (System.Environment.WorkingSet/(1024.0*1024.0)).ToString("F")+"M";
}
/// <summary>
/// 公共语言运行库的主版本、次版本、内部版本和修订号
/// </summary>
/// <returns></returns>
public string getFxVersion()
{
return System.Environment.Version.ToString();
}
标签:
系统参数
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“asp.net 获取系统中参数的实现代码”评论...