문제

I'm fairly new to WebDAV , how do I go about coding in vb or C# to automap a network drive and check if letter G:\ is available and if it is , assign that letter, if not go to H , I, J ,K drives ?

thank you in advance

도움이 되었습니까?

해결책

You can start a process to add the network drive. Then you can check to see when and how p finishes.

Dim p As Process
p = System.Diagnostics.Process.Start("net.exe", "use r: \\reo\c-drive")

Here is one way to check the availability of a drive letter:

If System.IO.Directory.Exists("c:\") Then ...

You can also use Windows API calls, which are messier to write but don't require a separate process.

It's usually not necessary to map a network drive, however, because you can generally use the network path instead of the mapped drive letter.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top