GFNetRes/NetWorkRes.frm
VERSION 5.00
Begin VB.Form Testfrm
Caption = "Form1"
ClientHeight = 3660
ClientLeft = 60
ClientTop = 315
ClientWidth = 4665
LinkTopic = "Form1"
ScaleHeight = 3660
ScaleWidth = 4665
StartUpPosition = 3 'Windows‑Standard
Begin VB.CommandButton Command5
Caption = "LocalToRemoteName"
Height = 315
Left = 2700
TabIndex = 7
Top = 2400
Width = 1875
End
Begin VB.CommandButton Command4
Caption = "GetDriveInfo"
Height = 350
Left = 2688
TabIndex = 6
Top = 1980
Width = 1918
End
Begin VB.CommandButton Command3
Caption = "GetShortPath"
Height = 350
Left = 2688
TabIndex = 5
Top = 3192
Width = 1918
End
Begin VB.TextBox Text2
Height = 238
Left = 56
TabIndex = 4
Top = 3248
Width = 2535
End
Begin VB.TextBox Text1
Height = 238
Left = 60
TabIndex = 3
Top = 2800
Width = 2535
End
Begin VB.CommandButton Command2
Caption = "GetLongPath"
Height = 350
Left = 2688
TabIndex = 2
Top = 2744
Width = 1918
End
Begin VB.CommandButton Command1
Caption = "GetNetworkResources"
Height = 350
Left = 672
TabIndex = 1
Top = 1980
Width = 1918
End
Begin VB.ListBox List1
Height = 1815
Left = 60
TabIndex = 0
Top = 60
Width = 4550
End
End
Attribute VB_Name = "Testfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'(c)2001, 2002, 2004 by Louis.
'
'Downloaded from www.louis‑coder.com.
'Demonstrates how to get information about shared network resources,
'such as network machines and shared folders.
Private Sub Command1_Click()
'on error resume next
Dim X As NetWorkGetNetWorkResourcesResultStruct
Dim Temp As Long
'reset
List1.Clear 'reset
'begin
X = NetWorkGetNetWorkResources
For Temp = 1 To X.ResultNumber
List1.AddItem X.Result_NetResourceComment(Temp)
List1.AddItem X.Result_NetResourceTypeID(Temp)
List1.AddItem X.Result_NetResourceLocalName(Temp)
List1.AddItem X.Result_NetResourceRemoteName(Temp)
List1.AddItem X.Result_NetResourceProviderName(Temp)
Next Temp
End Sub
Private Sub Command2_Click()
'on error resume next
Debug.Print NetWorkGetLongPath(Text1.Text)
End Sub
Private Sub Command3_Click()
Debug.Print NetWorkGetShortPath(Text2.Text)
End Sub
Private Sub Command4_Click()
'on error resume next
Dim XNumber As Integer
Dim XArray() As NetworkDriveInfoStruct
Dim Temp As Long
'reset
List1.Clear 'reset
'begin
Debug.Print Network_GetNetworkDriveInfo(XNumber, XArray())
For Temp = 1 To XNumber
List1.AddItem XArray(Temp).DriveLocalName + vbTab + XArray(Temp).DriveRemoteName
Next Temp
End Sub
Private Sub Command5_Click()
'on error resume next
Debug.Print NetWorkLocalToRemoteName("\\KONDENSATOR\C") ' \cstrike.exe ")
End Sub
[END OF FILE]