"skumar" <an*******@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
May i please have a sample code of how to do this.
Using a namespace in .net??
or using shell command??
Can you let me know the code for this mapping. Also this is a web
scenario. what permissions should we grant to ASP.net user for doing this??
Mapping seems like a bad idea. Note that drives are mapped per users, so
they will be mapped as whoever your webapp is running as. Unless you are
doing impersonation, this is going to be the same user every time. You will
get an error if you try and map a drive already mapped. Of course your code
can check for this, but I can imagine a lot of concurrency problems. What
if one user has just mapped the drive, and the code checks and sees if it is
already mapped, but then the first users is finished and the drive is
unmapped, you will have problems. There are other problems too. If you are
using impersonation, what if that user is already using that drive letter?
Why not use the UNC as Curt suggested?
-John Oakes