复制代码 代码如下:
/// <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();
}
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!