"\\192.168.0.1\d$\王小明"
但是这只是示例,实际运用中尽量不用带汉字的路径
try { ManagementScope ms = new ManagementScope(@"\\衡中10.19.96.215")ConnectionOptions conn = new ConnectionOptions()conn.Username = "用户名"conn.Password = "密码"ms.Options = connms.Connect()DirectoryInfo di = new DirectoryInfo(@"\\192.168.8.12\c$\gongxiang\")StringBuilder sb = new StringBuilder()foreach(DirectoryInfo subDIR in di.GetDirectories()) { sb.Append(subDIR.Name + "行腔\n\r")} MessageBox.Show("get\n\r"咐带山 + sb.ToString())} catch(Exception ex) { MessageBox.Show(ex.Message)}欢迎分享,转载请注明来源:内存溢出
评论列表(0条)