home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 4 Unleashed
/
Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso
/
source
/
chap38
/
frmnet~2.frm
< prev
next >
Wrap
Text File
|
1995-09-11
|
2KB
|
103 lines
VERSION 4.00
Begin VB.Form frmNetInfo
Caption = "Network Information"
ClientHeight = 1560
ClientLeft = 3120
ClientTop = 2385
ClientWidth = 3765
Height = 1965
Left = 3060
LinkTopic = "Form1"
ScaleHeight = 1560
ScaleWidth = 3765
Top = 2040
Width = 3885
Begin VB.CommandButton cmdShowResource
Caption = "Show &Resource"
Height = 375
Left = 1920
TabIndex = 3
Top = 960
Width = 1455
End
Begin VB.TextBox txtDevice
Height = 375
Left = 360
TabIndex = 0
Text = "txtDevice"
Top = 360
Width = 3015
End
Begin VB.CommandButton cmdShowUser
Caption = "Show &User"
Default = -1 'True
Height = 375
Left = 360
TabIndex = 1
Top = 960
Width = 1455
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "Local Device Identifier"
Height = 255
Left = 360
TabIndex = 2
Top = 120
Width = 3015
End
End
Attribute VB_Name = "frmNetInfo"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Sub cmdShowResource_Click()
Dim GetResource As Long
Dim DeviceID As String
Dim ResourceName As String
Dim lngResource As Long
Dim Msg As String
ResourceName = Space(50)
lngResource = Len(ResourceName)
DeviceID = UCase$(txtDevice)
GetResource = WNetGetConnection(DeviceID, ResourceName, lngResource)
Msg = "Device " + DeviceID + vbCrLf + "Connected To: " + ResourceName
MsgBox Msg, , "Network Resource Information"
End Sub
Private Sub cmdShowUser_Click()
Dim GetUser As Long
Dim DeviceID As String
Dim UserName As String
Dim lngName As Long
Dim Msg As String
UserName = Space(25)
lngName = Len(UserName)
DeviceID = UCase$(txtDevice)
GetName = WNetGetUser(DeviceID, UserName, lngName)
Msg = "Device " + DeviceID + vbCrLf + "Is Being Used By " + UserName
MsgBox Msg, , "Network User Information"
End Sub
Private Sub Form_Load()
txtDevice = ""
txtResource = ""
End Sub