How to use RAS API(rasapi32.dll) with VB? 100 point!
My friends,
I want to implement a module to use rasapi32.dll in vb, and i export all functions, but i can't find its arguments, structure(type info) of it.If you have the source code, please help me.
Thanks with power score!
问题点数:34、回复次数:8Top
1 楼jifeng(疾风)回复于 2001-01-10 02:25:00 得分 1
关注Top
2 楼jifeng(疾风)回复于 2001-01-10 02:29:00 得分 5
我有个例子,你要么?Top
3 楼vbdabster(BEYOND)回复于 2001-01-10 08:48:00 得分 5
我也有个,你要吗Top
4 楼MildSeven(方言)回复于 2001-01-10 10:09:00 得分 0
I found the way at MSDN. Thank you.Top
5 楼MildSeven(方言)回复于 2001-01-10 10:29:00 得分 0
OkTop
6 楼dragonleon(老婆,老婆我爱你)回复于 2001-01-10 12:54:00 得分 5
啊?怎么这帖子还没删除啊?都解决了,要我来干吗?Top
7 楼wanyong(地狱使者)回复于 2001-01-11 16:34:00 得分 0
可以把例程发给我吗?
wanyong117@sina.com.cnTop
8 楼h_x_k(一缕清烟)回复于 2001-01-11 18:36:00 得分 18
这是我在D1VB发的东东,咱们不要MIAL过去MAIL过来的好吗?直接点,呵呵
Public Declare Function RasEnumConnections Lib "RasApi32.dll" Alias "RasEnumConnectionsA" (lpRasCon As Any, lpcb As Long, lpcConnections As Long) As Long
Public Declare Function RasGetConnectStatus Lib "RasApi32.dll" Alias "RasGetConnectStatusA" (ByVal hRasCon As Long, lpStatus As Any) As Long
`
Public Const RAS95_MaxEntryName = 256
Public Const RAS95_MaxDeviceType = 16
Public Const RAS95_MaxDeviceName = 32
`
Public Type RASCONN95
dwSize As Long
hRasCon As Long
szEntryName(RAS95_MaxEntryName) As Byte
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type
`
Public Type RASCONNSTATUS95
dwSize As Long
RasConnState As Long
dwError As Long
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type
`A call to the function IsConnected returns true if the computer has established a connection to the internet.
Public Function IsConnected() As Boolean
Dim TRasCon(255) As RASCONN95
Dim lg As Long
Dim lpcon As Long
Dim RetVal As Long
Dim Tstatus As RASCONNSTATUS95
`
TRasCon(0).dwSize = 412
lg = 256 * TRasCon(0).dwSize
`
RetVal = RasEnumConnections(TRasCon(0), lg, lpcon)
If RetVal <> 0 Then
MsgBox "ERROR"
Exit Function
End If
`
Tstatus.dwSize = 160
RetVal = RasGetConnectStatus(TRasCon(0).hRasCon, Tstatus)
If Tstatus.RasConnState = &H2000 Then
IsConnected = True
Else
IsConnected = False
End If
End Function
Top





