Can't access file via Map Network Drive
Hi,
.NET 2005 - I used System.Diagnostics.Process class to start cmd.exe and map network drive to a server on a different domain as follow:
....
If System.IO.Directory.Exists(sourceDir) = True Then
myInput.Write("net use z: /DELETE " & myInput.NewLine)
End If
**Is the map directory exist? DELETE it before creating it.
If System.IO.Directory.Exists("z:") = True Then
myInput.Write("net use z: /DELETE " & myInput.NewLine)
End If
'**Map network drive
myInput.Write("net use z: \\server password /USER:domain\username /PERSISTENT:YES " & myInput.NewLine)
....
After this mapping, I was able to access file while I am debuging my code locally. However, it was not successful when I public to a website. Website directory security? Any suggestion?
By the way, I noticed a lot of program use WNetAddConnection2. Anyone know how I could retain this?
Thanks
Peter
__________________
Peter
|