I believe this post should have an answer for you!
Basically, it comes down to one of two ways:
Either you import GetDiskFreeSpaceEx and use it on the drive path, or use WMI on a network drive that you map in advance.
Therefore, you need to have network access for this drive.
If you are trying to control a remote system, you can easily create a small application / service that will run on this computer and constantly collect the necessary information and then provide it to the monitoring application using something like WCF or even directly if you want.
Let me know if this was helpful,
Max
EDIT: Actually, I misunderstood your question. I thought you were looking for a way to connect first. However, I will leave this answer so that anyone who finds this through a search can find it useful.
source share