سؤال

I have several paths that I'm connected to through net use, but they are not listed on my system as a network drive since I'm connected to the using the following net use command: net use \\{server}\{environment} that is, I'm not listing them as an active drive on my system.

I would like to have the ability to enumerate through all of them using C# (so that I could build a program that will quickly connect / disconnect from each path).

هل كانت مفيدة؟

المحلول

Well, you'll have to use WMI - the query "SELECT * FROM Win32_NetworkConnection" will give you list of all the network connections on the system.

An example for working with WMI available here: http://www.c-sharpcorner.com/uploadfile/puranindia/windows-management-instrumentation-in-C-Sharp/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top