- 1、本文档共3页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
《adsl 实现宽带拨号》.doc
VB6.0代码
1、第一个问题还要添上连接名(就是拨号连接的名字)
我这里有一个现成的代码,挺长的,能上网、断网、查看网络状态、查看连接数目,如果其它的不需要的话,自己看函数的名字,删了即可
把一下代码粘贴到模块中,在窗体某控件的时间中写:花的贴身高手必威体育精装版章节 /html/1/1974
Dim recAdConn
recAdConn = AddConnection(连接名, , , 用户名, 密码, )
Public Type RASCONN95
dwSize As Long
hRasConn As Long
szEntryName(256) As Byte
szDeviceType(16) As Byte
szDeviceName(128) As Byte
End Type
Public Type RASCONNSTATUS95
dwSize As Long
RasConnState As Long
dwError As Long
szDeviceType(16) As Byte
szDeviceName(128) As Byte
End Type
Public Declare Function RasGetConnectStatus Lib RasApi32.DLL Alias RasGetConnectStatusA (ByVal hRasCon As Long, lpStatus As Any) As Long
Public Declare Function lstrcpy Lib kernel32 Alias lstrcpyA (lpString1 As Any, ByVal lpString2 As String) As Long
Public Declare Function RasDial Lib RasApi32.DLL Alias RasDialA (lpRasDialExtensions As Any, ByVal lpszPhonebook As String, lprasdialparams As Any, ByVal dwNotifierType As Long, lpvNotifier As Long, lphRasConn As Long) As Long
Public Declare Function RasHangUp Lib RasApi32.DLL Alias RasHangUpA (ByVal hRasConn As Long) As Long
Public Declare Function RasEnumConnections Lib RasApi32.DLL Alias RasEnumConnectionsA (lprasconn As Any, lpcb As Long, lpcConnections As Long) As Long
Public Function AddConnection(strNewEntryName As String, strNewPhoneNumber As String, strNewCallbackNumber As String, strNewUsername As String, strNewPassword As String, strNewDomain As String) As Long
Const APINULL = 0
Dim lngRetCode As Long
Dim lngRetLstrcpy As Long
Dim lngRetHangUp As Long
Dim lprasdialparams As RASDIALPARAMS95
On Error GoTo 10
lprasdialparams.dwSize = 1052
lngRetLstrcpy = lstrcpy(lprasdialparams.szEntryName(0), strNewEntryName)
lngRetLstrcpy = lstrcpy(lprasdialparams.szPhoneNumber(0), strNewPhoneNumber)
lngRetLstrcpy = lstrcpy(lprasdialparams.szCallbackNumber(0), strNewCallbackNumber)
lngRetLstrcpy = lstrcpy(lprasdialparams.szUserName(0), strNewUsername)
lngRetLstrcpy = lstrcpy(lprasdialparams.szPassword(0), strNewPassw
文档评论(0)