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
martin lanny - 29 Nov 2007 20:13 GMT
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?
Trevor Benedict - 30 Nov 2007 01:06 GMT
The example being a ASP.NET example. Not sure if it might be of help, but explains what has to be done.
Regards,
Trevor Benedict
MCSD
"Trevor Benedict" <TrevorNews@yahoo.com> wrote in message news:...
You could use this sample
http://support.microsoft.com/kb/306158
Regards,
Trevor Benedict
MCSD