如何使用ProcessStartInfo访问共享文件夹 [英] How to access shared folder using ProcessStartInfo

查看:514
本文介绍了如何使用ProcessStartInfo访问共享文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的服务器中打开一个共享文件夹,代码是:

I want to open a shared folder in my server and the code is:

ProcessStartInfo si = new ProcessStartInfo("explorer.exe", @"/root,\\172.16.242.41\photos");
si.UserName = textEdit2.Text;
System.Security.SecureString ss = new System.Security.SecureString();
foreach (char c in textEdit4.Text.ToCharArray())
   ss.AppendChar(c);
si.Password = ss;
si.UseShellExecute = false;
Process.Start(si);



无论我如何尝试,我总是得到登录失败:未知用户名或密码错误。



我的服务器不属于任何域。它属于工作组。

原因是什么?


No matter how I try, I always get "Logon failure: unknown user name or bad password".

My server doesn't belong to any domain. It belongs to workgroup.
Is it the reason?

推荐答案

你应该能够使用下面的代码打开文件夹:

You should be able to do this using the code below to open the folder:
System.Diagnostics.Process.Start(networkPathHere)


这篇关于如何使用ProcessStartInfo访问共享文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆