3个回答
展开全部
private void Upload_Net()
{
string SPATH = @"\\10.193.241.17\ccib";
try
{
Directory.GetFiles(SPATH);
}
catch
{
Process process = new Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.Start();
process.StandardInput.WriteLine("net use " + SPATH + " /delete");
process.StandardInput.WriteLine("net use " + SPATH + " foxconn@2008 /USER:ccib");
process.StandardInput.WriteLine("exit");
string []FileName=Directory.GetFiles(SPATH);
}
}
{
string SPATH = @"\\10.193.241.17\ccib";
try
{
Directory.GetFiles(SPATH);
}
catch
{
Process process = new Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.Start();
process.StandardInput.WriteLine("net use " + SPATH + " /delete");
process.StandardInput.WriteLine("net use " + SPATH + " foxconn@2008 /USER:ccib");
process.StandardInput.WriteLine("exit");
string []FileName=Directory.GetFiles(SPATH);
}
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
string [] files = Directory.GetFiles(@"c:\");
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |