在VC中,怎样用程序建立一个拨号连接?Show源码!

allfresh 2001-07-29 01:13:09
我想在程序中建立一个拨号连接,不要调用系统的建立向导,在程序中全部搞定,
请高手接分!
...全文
110 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
airhawk 2001-07-31
  • 打赏
  • 举报
回复
有一套rapi函数,再看看msdn,很容易搞定的。。。。。。
allfresh 2001-07-31
  • 打赏
  • 举报
回复
谢谢 flywhc(午夜蓝调) 辛苦了!
flywhc 2001-07-31
  • 打赏
  • 举报
回复
先用
DWORD ret = RasEnumDevices(devinfo, &needed, &num_devices);
找到拨号设备
然后建立
RASENTRY entry;
memset(&entry, 0, sizeof(RASENTRY));

entry.dwSize = sizeof(RASENTRY);
entry.dwfOptions = RASEO_RemoteDefaultGateway | RASEO_ModemLights | RASEO_IpHeaderCompression |
RASEO_SwCompression | RASEO_NetworkLogon;
entry.dwfNetProtocols = RASNP_Ip /*| RASNP_NetBEUI | RASNP_Ipx*/;
entry.dwFramingProtocol = RASFP_Ppp;

strcpy(entry.szDeviceType, devinfo[i].szDeviceType);
strcpy(entry.szDeviceName, devinfo[i].szDeviceName);

strcpy(entry.szLocalPhoneNumber, phone_no);

DWORD ret = RasSetEntryProperties(NULL, // pointer to full path and filename of phone-book file
conn_name, // pointer to an entry name
&entry, // buffer that contains entry information
sizeof(RASENTRY),// size, in bytes, of the lpRasEntry buffer
NULL, // buffer that contains device-specific
0); // configuration information size
allfresh 2001-07-30
  • 打赏
  • 举报
回复
三请
allfresh 2001-07-29
  • 打赏
  • 举报
回复
请赐教
ForApply 2001-07-29
  • 打赏
  • 举报
回复
up
allfresh 2001-07-29
  • 打赏
  • 举报
回复
再请赐教

4,356

社区成员

发帖
与我相关
我的任务
社区描述
通信技术相关讨论
社区管理员
  • 网络通信
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧