I can view a remotly connected pc from this article:Remote Desktop using c-net . but i dont need it. I just have to connect with that pc and get the free space data of C drive. How could i do this? I can connect to a remote desktop. I can get driveInfo using IO namespace. but how to combine them?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Use the
System.Management
namespace andWin32_Volume
WMI class for this. You can query for an instance with aDriveLetter
ofC:
and retrieve itsFreeSpace
property as follows:There is also a
Capacity
property that stores the total size of the volume.Here is the vb.net equivalent in case you need to translate it.
You can collect remote pc information by using WMI, but it requires RPC to be running on the remote pc.
Please take a look at these links: http://www.codeproject.com/Articles/8804/Collecting-Remote-System-Information-With-WMI and http://blogs.msdn.com/b/securitytools/archive/2009/07/29/wmi-programming-using-c-net.aspx