|
-
Apr 25th, 2002, 11:49 AM
#1
Thread Starter
I wonder how many charact
DriveListBox question
Ok,
I have a drive list box, which unfortunately, does not show network drives available .
The drive list box (along with its tied in dir listbox), need to be able to browse the network so a user can point my program to a directory containing data files on the network.
I searched the forum for similiar questions, and people responded about Mapping a network drive, however, I am not sure how to do so. Can this be done runtime, or does an Administrator have to set this?
-
Apr 25th, 2002, 11:51 AM
#2
have you already tried "//network_location" as the source for the listbox?
-
Apr 25th, 2002, 11:55 AM
#3
First, the DriveListBox will only show those drives that currently exist, or are actually mapped. Its easy to map a drive
VB Code:
Private Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Long
'Description
'Here \\vdk00005\proj is the name of the network path
'H: is the Drive Letter
'Map Network Drive (Connect)
WNetAddConnection "\\vdk00005\proj", "", "H:"
-
Apr 25th, 2002, 11:58 AM
#4
Thread Starter
I wonder how many charact
If I set the location manually in code, yes, that works. But I need to be able to have the user select the drive. I guess what I mean is, my computer does not have the other networked computer hard drive mapped, only a shortcut on my desktop.
So should my program try mapping the drive, or should I leave it to the customer's administrator to map the drive, and then it will automatically show up in the DirListBox...
As you can tell, I know little about mapping a network drive, or really what that means...
-
Apr 25th, 2002, 12:01 PM
#5
Then, show them this
VB Code:
Private Declare Function WNetConnectionDialog Lib "mpr.dll" (ByVal hwnd As Long, ByVal dwType As Long) As Long
Private Sub Command1_Click()
Call WNetConnectionDialog(Me.hwnd, 1)
End Sub
-
Apr 25th, 2002, 12:10 PM
#6
Thread Starter
I wonder how many charact
Awesome !
Thank you Hack!
One further question, what does reconnect at login mean? Does that mean the user won't have to remap a drive at login?
-
Apr 25th, 2002, 12:16 PM
#7
Yes. Thats what it means. I don't know whether you need this or not, but here is the Disconnect box as well.
VB Code:
Private Declare Function WNetDisconnectDialog Lib "mpr.dll" Alias "WNetDisconnectDialog" (ByVal hwnd As Long, ByVal dwType As Long) As Long
Private Sub Command1_Click()
Call WNetDisconnectDialog(Me.hwnd, 1)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|