PDA

Click to See Complete Forum and Search --> : mapping a network drive?


siyan
Jun 28th, 2002, 08:41 PM
anybody know how to map a netwokr drive in vb.net? i've looked around in teh system.net.authenticationmanager and related things, but i can't figure it out

TIA

-C

siyan
Jun 30th, 2002, 03:15 PM
*bump*

C'mon..somebody has to know :(

Musician
Jun 30th, 2002, 07:40 PM
You might want to check out WMI:-

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting06112002.asp

Windows Scripting has a command to map a network drive but you also need to know what letter to map it to (i.e. what letter is available?). In any case I don't know enough about wmi to tell you about it so I recommend you read up on it.

There may well be an easy way of doing this in .net but I 'aint heard about it yet.

Finally if you want to go back in time and use APIs then you should be able to find some old vb6 code to do this and convert it.

siyan
Jul 2nd, 2002, 07:06 PM
thanks..i'll read up on that when i get the chance

I have VB6 API calls to do the mapping somewhere..and to check for the first aviable drive letter (not that hard...), but i'm doing this program more or less as an exercise. first goaround in .net, and i'd prefer to keep it free of any hack'n'slash methods around problems.

anybody know the .net framwork method to do it? i'm sure there's gotta be a way..

-C

wolfrose
May 27th, 2003, 04:31 PM
how do you find the next available drive letter to map a network drive to?

Slow_Learner
May 28th, 2003, 02:17 PM
ms-help://MS.VSCC/MS.MSDNVS/vbcn7/html/vaconDriveFolderAccess.htm

Use GetLogicalDrives to see which drives are taken, pick one that isn't - or prompt the user.