home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_1 / NIVB_SRC / DIRDRIVE.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-06-03  |  2.4 KB  |  71 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. Sub Form_Load ()
  43.     'DriveList.Clear
  44.     For drive% = 0 To 25
  45.         ccode% = GetDriveInformation(drive%, connID%, dirHandle%)
  46.         If (dirHandle% <> 0) Then
  47.             dirPath$ = String$(255, 0)
  48.             ccode% = GetDirectoryPath(dirHandle%, dirPath$)
  49.             dirPath$ = Left$(dirPath$, InStr(dirPath$, Chr$(0)) - 1)
  50.             If (ccode% = SUCCESSFUL) Then
  51.                 fileServerName$ = String$(48, 0)
  52.                 GetFileServerName connID%, fileServerName$
  53.                 fileServerName$ = Left$(fileServerName$, InStr(fileServerName$, Chr$(0)) - 1)
  54.         
  55.                 If (IsSearchDrive(drive% + 65) = 1) Then
  56.                     DriveList.AddItem "* " + Chr$(drive% + 65) + ":   " + fileServerName$ + "/" + dirPath$
  57.                 Else
  58.                     DriveList.AddItem "  " + Chr$(drive% + 65) + ":   " + fileServerName$ + "/" + dirPath$
  59.                 End If
  60.             Else
  61.                 DriveList.AddItem "Can't get path for this drive"
  62.             End If
  63.         ElseIf (ccode% <> SUCCESSFUL) Then
  64.               DriveList.AddItem "  " + Chr$(drive% + 65) + ":   " + "Mapped to a local drive"
  65.         End If
  66.     Next drive%
  67. End Sub
  68. Sub OKButton_Click ()
  69.     Unload DirDriveForm
  70. End Sub
  71.