共享文件夹中的文件列表 [英] List of File from Shared Folder

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

问题描述

大家好,



如何从另一台计算机共享的文件夹中获取文件列表?

Ex:计算机名: asp-001文件夹:web\fdg\log \

所以,我想知道\\\\ p-001中是否有。* xml文件web\fdg\log



任何帮助或建议?

Hi All,

How can I get List of Files from Folder shared by another computer?
For Ex: Computer Name: asp-001 Folder: web\fdg\log\
So, I would like to know is there any ".*xml" file present in "\\asp-001\web\fdg\log"

Any Help or Suggestion?

推荐答案

试试这个

try this
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(Location);
foreach (System.IO.FileInfo f in dir.GetFiles("*.*"))
{

}


您可以指定搜索模式。您可以在搜索模式中使用通配符说明符,例如* .bmp选择带扩展名的文件或a *选择以字母:a开头的文件。

You can specify search pattern. You can use wildcard specifiers in the search pattern, e.g. "*.bmp" to select files with the extension or "a*" to select files beginning with letter ":a".
<br />
[C#]<br />
string[] filePaths = Directory.GetFiles(@"c:\MyDir\", "*.bmp");<br />
// returns<br />


这篇关于共享文件夹中的文件列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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