Click here to Skip to main content
15,905,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi my friends
i use this code for access to my image but it give me error
i should access to them use computer name
fileInDir = Directory.GetFilles("\\PARISA-PC\\C:OMEGA\\KAJ", "*.Bmp", SearchOption.TopDirectoryOnly);
please help me
Posted
Updated 2-Nov-13 0:33am
v2
Comments
fatima...68 2-Nov-13 6:49am    
thank you my friend phil.o its work

1 solution

You cannnot express an UNC path like you did; and you have to escape backslashes (or put an @ to declare the string). The correct path is:
C#
fileInDir = Directory.GetFilles(@"\\PARISA-PC\C$\OMEGA\KAJ", "*.Bmp", SearchOption.TopDirectoryOnly);

Or, without @:
C#
fileInDir = Directory.GetFilles("\\\\PARISA-PC\\C$\\OMEGA\\KAJ", "*.Bmp", SearchOption.TopDirectoryOnly);
 
Share this answer
 

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