Private Sub Command1_Click()
Dim ras_conn_info(255) As RASCONN95
Dim buf_size As Long
Dim i As Long
Dim num_connections As Long
Dim conn_name As String
txtResults.Text = ""
ras_conn_info(0).dwSize = RASCONN95_SIZE
buf_size = 256 * ras_conn_info(0).dwSize
RasEnumConnections ras_conn_info(0), buf_size, _
num_connections
For i = 0 To num_connections - 1
conn_name = StrConv(ras_conn_info(i).szEntryName(), _
vbUnicode)
conn_name = Left$(conn_name, InStr(conn_name, _
Chr$(0)) - 1)
If Len(conn_name) > 0 Then
txtResults.Text = txtResults.Text & _
"Connected to " & conn_name & vbCrLf
End If
Next i
txtResults.Text = txtResults.Text & "Done"
End Sub
|