110,536
社区成员
发帖
与我相关
我的任务
分享
//使用SystemInformation的静态成员获得系统信息并显示出来;
class Class1
{
static void Main(string[] args)
{
Console.WriteLine("计算机名:_"+System.Windows.Forms.SystemInformation.ComputerName.ToString());
Console.WriteLine("启动方式:_"+System.Windows.Forms.SystemInformation.BootMode.ToString());
Console.WriteLine("域名:
_"+System.Windows.Forms.SystemInformation.UserDomainName.ToString());
}
}
Microsoft.VisualBasic.Devices.Computer com = new Microsoft.VisualBasic.Devices.Computer();
Console.WriteLine("可用内存:" + com.Info.AvailablePhysicalMemory / (1024 * 1024) + "M");
Console.WriteLine("总物理内存:" + com.Info.TotalPhysicalMemory / (1024 * 1024) + "M");
Console.WriteLine("可用虚拟内存:" + com.Info.AvailableVirtualMemory / (1024 * 1024) + "M");
Console.WriteLine("总虚拟内存:" + com.Info.TotalVirtualMemory / (1024 * 1024) + "M");
Console.WriteLine("计算机名称:" + com.Name);