You need to use impersonation. You use an account that is in the domain of
the remote server when trying to fetch data from that server. You may be
able to create an ASPNET user on that machine with the same password as used
on the Web server. Not sure about that part.
Also, don't use a mapped drive but a UNC path:
http://msdn.microsoft.com/library/de...ersonation.asp http://msdn.microsoft.com/library/de...haspdotnet.asp http://groups.google.ca/groups?hl=fr...13%26rnum%3D11
"Jacques Wentworth" <Ja*****@HealthSystems.co.za> wrote in message
news:eM**************@TK2MSFTNGP10.phx.gbl...
Hi Ken
How can I give the ASPNET user access to the remote drive?
Jacques
Ken Cox [Microsoft MVP] wrote: Is Q: a mapped drive?
If so, it may be mapped for the logged on user but not the ASPNET user.
Also, the ASPNET user probably doesn't have permissions to access a
remote drive.
Ken
"Jacques Wentworth" <Ja*****@HealthSystems.co.za> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I'm trying to access a Folder on a different Server using ASP.NET, and
are getting a DirectoryNotFoundException. It works fine when I access
the local drives on the server. I made sure the folder does exist.
I've put my code below to show what I'm trying to do.
Thanks
Jacques Wentworth
'Dim dirs As String() = Directory.GetFiles("C:\temp")
Dim dirs As String() = Directory.GetFiles("Q:\BARDATA.PRD")
Dim dir As String
For Each dir In dirs
Label1.Text = Label1.Text & dir & vbCrLf
Next