0
我需要验证我的应用程序可以连接到网络上远程服务器上的默认C $共享。有没有人有一个真正的bulletprrof方式我可以做到这一点?起初,我在做这样的事情:检查UNC连接
Dim ProcessStartInfo As New System.Diagnostics.ProcessStartInfo
ProcessStartInfo.FileName = "net"
ProcessStartInfo.Arguments = "use \\" & strComputer & "\c$ /USER:" & strUsername & " " & strPassword
ProcessStartInfo.WindowStyle = ProcessWindowStyle.Hidden
System.Diagnostics.Process.Start(ProcessStartInfo)
但这可能是有时古怪,挂,需要很长时间才能恢复等。无论采用哪种方式我使用需要能够提供凭据,如果可能的话,当连接失败我需要知道它为什么失败。
谢谢。这可以工作,除非有时候这会在工作组环境中运行,并且每台机器的凭据可能不同。尽管如此,我会继续探索你的链接...... – 2012-01-03 20:00:09