home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / nivb_src / dirdrive.frm < prev    next >
Text File  |  1993-06-03  |  2KB  |  76 lines

  1. VERSION 2.00
  2. Begin Form DirDriveForm 
  3.    Caption         =   "Directory Services Test (Drive APIs)"
  4.    Height          =   3405
  5.    Left            =   810
  6.    LinkTopic       =   "Form2"
  7.    ScaleHeight     =   3000
  8.    ScaleWidth      =   6360
  9.    Top             =   1185
  10.    Width           =   6480
  11.    Begin ListBox DriveList 
  12.       Height          =   1980
  13.       Left            =   120
  14.       TabIndex        =   1
  15.       Top             =   360
  16.       Width           =   6135
  17.    End
  18.    Begin CommandButton OKButton 
  19.       Caption         =   "&OK"
  20.       Height          =   372
  21.       Left            =   3000
  22.       TabIndex        =   0
  23.       Top             =   2520
  24.       Width           =   732
  25.    End
  26.    Begin Label Label2 
  27.       Caption         =   "* Search drives"
  28.       Height          =   252
  29.       Left            =   120
  30.       TabIndex        =   3
  31.       Top             =   2400
  32.       Width           =   1332
  33.    End
  34.    Begin Label Label1 
  35.       Caption         =   "Network drive mappings"
  36.       Height          =   252
  37.       Left            =   120
  38.       TabIndex        =   2
  39.       Top             =   120
  40.       Width           =   2172
  41.    End
  42. End
  43.  
  44. Sub Form_Load ()
  45.     'DriveList.Clear
  46.  
  47.     For drive% = 0 To 25
  48.         ccode% = GetDriveInformation(drive%, connID%, dirHandle%)
  49.         If (dirHandle% <> 0) Then
  50.             dirPath$ = String$(255, 0)
  51.             ccode% = GetDirectoryPath(dirHandle%, dirPath$)
  52.             dirPath$ = Left$(dirPath$, InStr(dirPath$, Chr$(0)) - 1)
  53.             If (ccode% = SUCCESSFUL) Then
  54.                 fileServerName$ = String$(48, 0)
  55.                 GetFileServerName connID%, fileServerName$
  56.                 fileServerName$ = Left$(fileServerName$, InStr(fileServerName$, Chr$(0)) - 1)
  57.         
  58.                 If (IsSearchDrive(drive% + 65) = 1) Then
  59.                     DriveList.AddItem "* " + Chr$(drive% + 65) + ":   " + fileServerName$ + "/" + dirPath$
  60.                 Else
  61.                     DriveList.AddItem "  " + Chr$(drive% + 65) + ":   " + fileServerName$ + "/" + dirPath$
  62.                 End If
  63.             Else
  64.                 DriveList.AddItem "Can't get path for this drive"
  65.             End If
  66.         ElseIf (ccode% <> SUCCESSFUL) Then
  67.               DriveList.AddItem "  " + Chr$(drive% + 65) + ":   " + "Mapped to a local drive"
  68.         End If
  69.     Next drive%
  70. End Sub
  71.  
  72. Sub OKButton_Click ()
  73.     Unload DirDriveForm
  74. End Sub
  75.  
  76.