编程创建宽带连接后,如何设置为“允许没有安全措施的密码”

majiming 2010-04-11 10:37:52
用RasSetEntryProperties已成功创建一个宽带连接,
但无论怎么设置 RasEntry.dwfOptions 都不能设置连接属性为“允许没有安全措施的密码”

请大虾出招,期待ing
...全文
545 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
BXF_CHINA 2012-05-24
  • 打赏
  • 举报
回复
请不要乱回答。
树直屏 2012-02-21
  • 打赏
  • 举报
回复
问题解决啦!!!!!
呵呵,希望能给后人一点启示吧!!
加上下面这句就可以了,默认的创建出来宽带连接就是“允许没有安全措施的密码”
rasEntry.dwType = RASET_Broadband;

不过手动改成“需要有安全措施的密码”之后,就改不回来了,必需手动改回去。我也不知道为什么。
总之很多东西还是不懂,不过问题也算解决了,虽然有点瑕疵。呵呵
树直屏 2012-02-21
  • 打赏
  • 举报
回复
我也遇到这个问题了,你们解决了吗?
哪位好心人给说说吧。
这个问题困扰我很久了
majiming 2010-10-17
  • 打赏
  • 举报
回复
不能沉了再顶
majiming 2010-05-11
  • 打赏
  • 举报
回复
问题没解决,顶上去
xjb2001 2010-05-05
  • 打赏
  • 举报
回复
dwfOptions

A set of bit flags that specify connection options. Set one or more of the following flags.

Note

You must clear all RASEO_RequiredXXX flags and the RASEO_Custom flag before setting RASEO_RequireEncryptedPw or RASEO_RequireMsEncryptedPw.


lpRasEntry->dwfOptions = RASEO_RemoteDefaultGateway;
lpRasEntry->dwfOptions |=0x04000000;//RASEO_ShowDialingProgress ;
//RASEO_RequireEncryptedPw
lpRasEntry->dwfOptions |=0x01000000;
lpRasEntry->dwfOptions |= RASEO_ModemLights;


我这样也不行? 我靠
xjb2001 2010-05-05
  • 打赏
  • 举报
回复
我也遇到这个问题了

LPRASENTRY lpRasEntry = NULL;
DWORD cb = sizeof(RASENTRY);
DWORD dwBufferSize = 0;
DWORD dwRet = 0;
CString str;

dwBufferSize = sizeof(RASENTRY);
lpRasEntry = (LPRASENTRY)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwBufferSize);
//lpRasEntry = (LPRASENTRY)GlobalAlloc(GPTR, sizeof(RASENTRY));
lpRasEntry->dwSize = sizeof(RASENTRY);

if (lpRasEntry == NULL)
{
str.Format("error 2 dwBufferSize %d ",dwBufferSize);
AfxMessageBox(str);
return ;
}

ZeroMemory(lpRasEntry, sizeof(RASENTRY));
lpRasEntry->dwSize = dwBufferSize;

lpRasEntry->dwfOptions |= RASEO_RemoteDefaultGateway;
lpRasEntry->dwfOptions |=0x04000000;//RASEO_ShowDialingProgress ;

lpRasEntry->dwfOptions |=0x01000000;
lpRasEntry->dwfOptions |= RASEO_ModemLights;


// lpRasEntry->dwType = 5;//RASET_Broadband;

lstrcpy(lpRasEntry->szDeviceType, "pppoe");//RASDT_PPPoE);
lstrcpy(lpRasEntry->szDeviceName, "pppoe supplicant link");

lpRasEntry->dwfNetProtocols = RASNP_Ip;
lpRasEntry->dwFramingProtocol = RASFP_Ppp;

dwBufferSize = lpRasEntry->dwSize;

dwRet = RasSetEntryProperties(NULL, "pppoe supplicant link", lpRasEntry, dwBufferSize, NULL, 0); // 创建连接
HeapFree(GetProcessHeap(), 0, (LPVOID)lpRasEntry);
//GlobalFree(lpRasEntry);

if (dwRet != 0)
{
AfxMessageBox("error 3");
return ;
}



建出来的 连接,是 需要有安全方式的密码,很奇怪中
liumenghappy 2010-04-21
  • 打赏
  • 举报
回复
不会,帮你顶起
majiming 2010-04-16
  • 打赏
  • 举报
回复
哥哥姐姐快来支招啊
hellward 2010-04-11
  • 打赏
  • 举报
回复
dwfOptions
A set of bit flags that specify connection options. Set one or more of the following flags.
dwfOptions的RASEO_RequireEncryptedPw位不要设置就行了。详见msdn
RASEO_RequireEncryptedPw :If this flag is set, only secure password schemes can be used to authenticate the client with the server. This prevents the PPP driver from using the PAP plain-text authentication protocol to authenticate the client. The CHAP and SPAP authentication protocols are also supported. Clear this flag for increased interoperability, and set it for increased security.
Windows NT/2000/XP: This flag corresponds to the Require Encrypted Password check box in the Security dialog box. See also RASEO_RequireMsEncryptedPw.

Windows 95/98/ME: This flag corresponds to the Require Encrypted Password check box in the Server Type dialog box.
majiming 2010-04-11
  • 打赏
  • 举报
回复
[1 楼 hellward ]
谢谢你的回复,我不知你实际测试了没,但我测试了没用,这些我都看过了。
你看我的代码,位未设置,仍然不行,用的VC6.0

RASENTRY rasEntry;
memset(&rasEntry, 0, sizeof(RASENTRY));

rasEntry.dwSize = sizeof(RASENTRY);
rasEntry.dwfOptions = RASEO_RemoteDefaultGateway;
rasEntry.dwfOptions=~RASEO_RequireEncryptedPw & rasEntry.dwfOptions;
rasEntry.dwCountryID = 1;
rasEntry.dwCountryCode = 1;
rasEntry.dwfNetProtocols = 4;
rasEntry.dwFramingProtocol = 1;
lstrcpy(rasEntry.szDeviceType,"pppoe");
lstrcpy(rasEntry.szDeviceName,"WAN 微型端口(PPPOE)");


RasSetEntryProperties(NULL, "新连接", &rasEntry,sizeof(RASENTRY), NULL, 0);

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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