How to access File over the Network
I am having a hard time on this one, I have a folder over the network with public 开发者_StackOverflowaccess (no credential restriction). I am trying to do a File.Exist or Directory.Exist and I keep on having a exception.
Can someone tell me the good way to do IO over the network.
EDIT 1 FOR DETAILS:
if i do execture => \agoodip\Public\test.txt I get the file etc etc
In my code it look like a basic
Directory.Exist(@"\\agoodip\Public") or
File.exist(@"\\agoodip\Public\test.txt")
The exception I get is Path not found.
EDIT 2 :
I am using Silverlight 3, Is there any security pattern to be aware of to lookup file on the network?
Thanks!
I don't believe that is going to work for you. Silverlight doesn't allow arbitrary access to the file system or shares. Silverlight runs within a sandbox environment so you have restricted access to the file system.
You need to begin your UNC path with two backslashes ("\\") if it refers to a network path rather than a local path.
精彩评论