111,120
社区成员
发帖
与我相关
我的任务
分享

[/quote]
作为程序员 不应该 这么低端吧......[/quote]
[/quote]
你想啊,如果有防火墙呢?得想办法直接跳过去吧,
如果以前没有存登录的账号和密码呢?得 自动填进去吧.....[/quote]我这边只要设置了共享,并且在一个局域网里面,电脑登录的账号在我们的域里面,就可以直接打开共享文件夹。不需要什么账号跟密码了
作为程序员 不应该 这么低端吧......[/quote]
[/quote]
你想啊,如果有防火墙呢?得想办法直接跳过去吧,
如果以前没有存登录的账号和密码呢?得 自动填进去吧.....
作为程序员 不应该 这么低端吧......[/quote]
作为程序员 不应该 这么低端吧......explorer \\192.168.40.38public string ConnectLan(string p_Path, string p_UserName, string p_PassWord)
{
System.Diagnostics.Process _Process = new System.Diagnostics.Process();
_Process.StartInfo.FileName = "cmd.exe";
_Process.StartInfo.UseShellExecute = false;
_Process.StartInfo.RedirectStandardInput = true;
_Process.StartInfo.RedirectStandardOutput = true;
_Process.StartInfo.CreateNoWindow = true;
_Process.Start();
//NET USE \\192.168.0.1 PASSWORD /USER:UserName
_Process.StandardInput.WriteLine("net use " + p_Path + " " + p_PassWord + " /user:" + p_UserName);
_Process.StandardInput.WriteLine("exit");
_Process.WaitForExit();
string _ReturnText = _Process.StandardOutput.ReadToEnd();// 得到cmd.exe的输出
_Process.Close();
return _ReturnText;
}