MsgBox "There is no service connected to this drive.", MB_ICONSTOP, "Drive " & UCase$(Left$((txtService(0)), 1)) & ":"
End If
Case 3 ' Find Drive
If Len((txtService(1))) = 0 Or Len((txtService(2))) = 0 Then
Call mnuHelpSel_Click(Index) ' Call help because there are missing parameters
Exit Sub
End If
tService = "\\" & (txtService(1)) & "\" & (txtService(2)) ' Build the service name we are looking for
tTempStr = UT_NetGetServiceDrive(tService) ' Find the drive letter
If Len(tTempStr) <> 0 Then
MsgBox "Service is connected to drive " & UCase$(tTempStr), MB_ICONINFORMATION, "Service: " & tService
Else
MsgBox "This service is not mounted or connected to a local drive.", MB_ICONSTOP, "Service: " & tService
End If
End Select
End Sub
Sub Form_Load ()
' Copyright ⌐ 1994 by Computer Technologies, Inc. All rights reserved.
Dim tTempStr As String
' Center the form on the screen
UT_CenterScreen Me
' Setup form scope globals
ftCRLF = Chr$(13) & Chr$(10)
' Load the services list box
Call APP_ListServices
' Popup the About box dialog
Call mnuHelpSel_Click(5)
End Sub
Sub mnuFileSel_Click (Index As Integer)
' Copyright ⌐ 1994 by Computer Technologies, Inc. All rights reserved.
Dim tTempStr As String
Select Case Index
Case 0 ' Network User
tTempStr = UT_NetUserID()
If Len(tTempStr) = 0 Then ' Not logged in
MsgBox "The user is not logged in to the network. It is also possible that this is a Windows for Workgroups machine using multiple network protocols. If Workgroups is not the first protocol, the user name may not be reported correctly.", MB_ICONINFORMATION, "Network User"
Else ' User is logged in
MsgBox "Logged in to the network as: " & Trim$(tTempStr), MB_ICONINFORMATION, "Network User"
End If
Case 1 ' Network Type
tTempStr = UT_GetNetworkType()
If Len(tTempStr) = 0 Then ' Unknown network type
MsgBox "Unable to determine the network type for this system.", MB_ICONINFORMATION, "Network Type"
Else
MsgBox "The current network is " & Trim$(tTempStr), MB_ICONINFORMATION, "Network Type"
End If
Case 3 ' Exit
Unload frmVBNets
End
End Select
End Sub
Sub mnuHelpSel_Click (Index As Integer)
' Copyright ⌐ 1994 by Computer Technologies, Inc. All rights reserved.
Dim tTempStr As String
Select Case Index
Case 0 ' Mount
MsgBox "The mount option requires a drive letter, a server name, and a service. The password is optional.", MB_ICONINFORMATION, "Using 'Mount'"
Case 1 ' Dismount
MsgBox "The dismount option requires a drive letter.", MB_ICONINFORMATION, "Using 'Dismount'"
Case 2 ' Find Service
MsgBox "The find service option requires a drive letter.", MB_ICONINFORMATION, "Using 'Find Service'"
Case 3 ' Find Drive
MsgBox "The find drive option requires a server name and a service.", MB_ICONINFORMATION, "Using 'Find Drive'"
Case 5 ' About
tTempStr = "Copyright ⌐ 1994 by Computer Technologies, Inc." & ftCRLF & "All rights reserved."
tTempStr = tTempStr & ftCRLF & ftCRLF & "Version 1.1 - Released October 11, 1994."
tTempStr = tTempStr & ftCRLF & ftCRLF & "This demo program and the associated code in CTI-NETS.BAS are the property of Computer Technologies, Inc. It is provided as a service for the personal use of the members of the MS-BASIC forum on CompuServe, and other interested Visual Basic developers."