使用C#.NET在LAN上捕获系统信息 [英] Capture System Information on LAN using C# .NET

查看:70
本文介绍了使用C#.NET在LAN上捕获系统信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii,我是.Net网络编程的新手,
我想为局域网上的不同系统的详细信息创建一个应用程序,例如:
系统名称,CPU使用率百分比,内存使用率百分比

以及磁盘管理信息,例如:
卷驱动器号,可用磁盘空间,已用磁盘空间,可用磁盘空间

您能提供一些想法或帮助吗?
Thanx

解决方案

对于磁盘管理,herez示例代码:

 DriveInfo []驱动器= DriveInfo.GetDrives();
  foreach (在驱动器中的DriveInfo d 驱动器)
 {
     如果(d.IsReady)
     {
         Console.WriteLine(" ,d.Name);
         Console.WriteLine(" ,d.AvailableFreeSpace);
     }
 }
 Console.ReadKey(); 



有关系统信息,请获取以下语句:

 System.Environment.UserDomainName;
System.Environment.OSVersion.ToString(); 


您可以使用WMI(Windows管理规范)在Windows平台上获取平台相关信息.

Hii, I''m Newbie in .Net Network Programming,
I Want to create a application to details of Different system on LAN like:
System Name, % CPU Utilisation , % Memory Utilisation

And Disk management information like:
Volume drive letter, Usable Disk Space, Used Disk Space, Free Disk Space

Can u provide some idea or help,
Thanx

解决方案

For disk management, herez sample code:

DriveInfo[] drives = DriveInfo.GetDrives();
 foreach (DriveInfo d in drives)
 {
     if (d.IsReady)
     {
         Console.WriteLine("Drive: {0}", d.Name);
         Console.WriteLine("Available free space: {0} bytes\n", d.AvailableFreeSpace);
     }
 }
 Console.ReadKey();



For system info, the below statements fetch:

System.Environment.UserDomainName;
System.Environment.OSVersion.ToString ();


You can make use of WMI (Windows Management Instrumentation) for fetching the platform related information on the windows platform.


这篇关于使用C#.NET在LAN上捕获系统信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆