469,903 Members | 1,887 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Problem Accessing Network Drives (Network Authentication)

My application should periodically connect to multiple network drives to
see if the certain files were created.

I would do this to retrieve the list of files in UNC path //server1/backup/:

----------------------------------
Folder = "//server1/backup/"
Dim listoffiles As New List(Of System.IO.FileInfo)
listoffiles.AddRange(New System.IO.DirectoryInfo(Folder).GetFiles())
----------------------------------

This doesn't work though, because network drive expects network
credentials to be passed.

If I opened the same path (//server1/backup/) in windows explorer, it
would ask me for name and password, but the code above doesn't do any of
that, it just tells me that the drive doesn't exist.

Is there any way to pass network credentials programmatically?

I spent 3 days searching all over the Internet trying to find an answer,
but it seems dot net simply doesn't have any other option than mapping
the drive. I tried 3-4 of those mapping solutions, but neither worked
reliably.

All I want is to access network path (unc) using network credentials, if
there is no way to do so in dot net it would really be a sad discovery.

Joe

Nov 29 '07 #1
1 1990
I am planning on writing a blog entry about limitations of .net 2003/2005.
Microsoft support, can you please confirm, that this is not possible?
Nov 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Yazeed | last post: by
1 post views Thread by Lamberti Fabrizio | last post: by
4 posts views Thread by marc.gibian | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.