编程创建宽带连接后,怎么设置为“允许没有安全措施的密码”
编程创建宽带连接后,如何设置为“允许没有安全措施的密码”
用RasSetEntryProperties已成功创建一个宽带连接,
但无论怎么设置 RasEntry.dwfOptions 都不能设置连接属性为“允许没有安全措施的密码”
请大虾出招,期待ing
------最佳解决方案--------------------
=0x01000000;
lpRasEntry->dwfOptions
------其他解决方案--------------------
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.
------其他解决方案--------------------
[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);
------其他解决方案--------------------
哥哥姐姐快来支招啊
------其他解决方案--------------------
不会,帮你顶起
------其他解决方案--------------------
我也遇到这个问题了
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;
用RasSetEntryProperties已成功创建一个宽带连接,
但无论怎么设置 RasEntry.dwfOptions 都不能设置连接属性为“允许没有安全措施的密码”
请大虾出招,期待ing
------最佳解决方案--------------------
=0x01000000;
lpRasEntry->dwfOptions
------其他解决方案--------------------
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.
------其他解决方案--------------------
[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);
------其他解决方案--------------------
哥哥姐姐快来支招啊
------其他解决方案--------------------
不会,帮你顶起
------其他解决方案--------------------
我也遇到这个问题了
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;