VC实现PPPOE拨号
来源:互联网 发布:edius软件官方下载 编辑:程序博客网 时间:2024/04/28 22:43
背景:代替手工自动进行PPPOE拨号
相关知识:
主要使用的函数:
The RasDial function establishes a RAS connection betweena RAS client and a RAS server. The connection data includes callbackand user-authentication information
DWORD RasDial(
__in LPRASDIALEXTENSIONS lpRasDialExtensions,
__in LPCTSTR lpszPhonebook,
__in LPRASDIALPARAMS lpRasDialParams,
__in DWORD dwNotifierType,
__in LPVOID lpvNotifier,
__in LPHRASCONN lphRasConn
);
Return Value
If the function succeeds, the return value isERROR_SUCCESS and a handle to the RAS connection is returned in thevariable pointed to by lphRasConn.
If the function fails, the return value is from Routing and Remote Access Error Codes or Winerror.h.
更多消息请查看 :
http://msdn.microsoft.com/en-us/library/aa377004(VS.85).aspx
RASDIALPARAMS ms;
RASDIALPARAMS params;
HRASCONN handle=NULL;
memset(&ms, '/0', sizeof(params));
params.dwSize=sizeof(RASDIALPARAMS);
CString entryname;
CString tmp;
tmp.Format("%d", i);
entryname="UE"+tmp;//需要拨号的名称,也就是建立的宽带连接的名称,如UE0
strcpy(params.szEntryName,entryname);
strcpy(params.szPhoneNumber,"");
strcpy(params.szCallbackNumber,"");
strcpy(params.szUserName,"tm500"); //用户名
strcpy(params.szPassword, "tm500"); //密码
strcpy(params.szDomain, "");
Message +="/n"+entryname+"dailying up ......";
UpdateData(TRUE);
//指定的拨号连接。
int a =RasDial(NULL, NULL, ¶ms, NULL, NULL, &handle);
if (a!=ERROR_SUCCESS)
{
MessageBox("正在拨打的计算机没有应答,稍后请再试");
Message +="/n"+entryname+"dailying up failed....../n";
UpdateData(TRUE);
DWORD off=RasHangUp(handle);
//SendMessage(WM_CLOSE);
if (off==0)
{
MessageBox("连接已断开");
//printf("连接已断开.../n");
}
else{
//printf("断开连接出错.../n");
MessageBox("断开连接出错.");
}
}
- VC实现PPPOE拨号
- VC实现PPPOE拨号
- Android 实现PPPoE拨号
- Android 实现PPPoE拨号
- RasAPI函数实现PPPOE拨号
- PPPOE拨号
- pppoe拨号
- uclinux 下PPPoE 拨号
- PPPoE拨号调试
- PPPoE拨号过程解析
- PPPOE拨号过程
- ubantu pppoe拨号
- PPPoE拨号流程
- OpenWrt之PPPoE拨号
- PPPoE拨号流程
- PPPoE拨号流程
- PPPoE拨号流程
- 华为配置PPPOE拨号
- 如何做一名项目负责人
- 奋斗的一生
- 热带水果莫入冰箱?水果存放冰箱大法
- foobar2000 v1.0.3安装
- 我们——程序员应该关注,功能?设计?
- VC实现PPPOE拨号
- 我对软件开发的一点思考
- [DirectX][DirectInput][JoyStick]DirectInput的JoyStick创建步骤整理
- 盘点云计算领域中的重量级公司
- 关于 JDeveloper 出现 unable to create an instance of the java virtual machine 错误的解决办法
- 飞信类
- Asp.net事件的发生顺序
- Linux下getsockopt/setsockopt 函数说明
- 具名函数的四种调用方式(1)