无法访问c#.net中的网络路径? [英] Not access Network path in c#.net?

查看:101
本文介绍了无法访问c#.net中的网络路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试访问网络路径.所有驻留在网络上的文件都希望保存在一个阵列中.
我的代码是:-

I am trying to access network path. and all files reside on network want to keep into one array.
My code is:-

string strTimePeriod = @"\\172.19.32.201\trizetto$\TIEO\Daily Hc Report\" + currentMonthAndYear;
string[] filePaths;
filePaths = Directory.GetFiles(strTimePeriod);



但是我收到以下错误消息:-

找不到路径的一部分" \\\\ 172.19.32.201 \\ trizetto $ \\ TIEO \\ Daily Hc Report \\ NOV 11"

在此先感谢!
Mangesh:-)



But i am getting following error Message:-

"Could not find a part of the path ''\\\\172.19.32.201\\trizetto$\\TIEO\\Daily Hc Report\\NOV 11''"

Thanks in Advance!
Mangesh :-)

推荐答案

\ TIEO \ Daily Hc Report \" + currentMonthAndYear; 字符串 [] filePaths; filePaths = Directory.GetFiles(strTimePeriod);
\TIEO\Daily Hc Report\" + currentMonthAndYear; string[] filePaths; filePaths = Directory.GetFiles(strTimePeriod);



但是我收到以下错误消息:-

找不到路径"\\\\ 172.19.32.201 \\ trizetto



But i am getting following error Message:-

"Could not find a part of the path ''\\\\172.19.32.201\\trizetto


\\ TIEO \\ Daily Hc Report \\ NOV 11"的一部分"

在此先感谢!
Mangesh:-)
\\TIEO\\Daily Hc Report\\NOV 11''"

Thanks in Advance!
Mangesh :-)


包含空格的路径必须用引号引起来.因此,请像这样更改您的代码:

Paths containing spaces have to be in quotes. So please change your code like this:

String strTimePeriod = "\"\\\\172.19.32.201\\trizetto


这篇关于无法访问c#.net中的网络路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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