Click here to Skip to main content
15,886,795 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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?
Posted
Updated 3-Dec-17 6:29am

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

}
 
Share this answer
 
Comments
AJ83 21-Jun-11 8:43am    
Hi Ambarishtv,

I have tried this but it is giving error {"Could not find a part of the path \" \\\\asp-001\\Web\\FDG\\log\"." }
koolprasad2003 21-Jun-11 8:47am    
paste all the path in RUN window and give enter button, check if path is open or not ?
If not then check the path
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 />
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900