S
sbzldlb
Unregistered / Unconfirmed
GUEST, unregistred user!
在2000 和 xp 都能创建VPN连接
但是在XP 里 不能将 要求数据加密(没有断开) 这个选项去掉
而在2000里是可以的 不知道是什么原因
请大家帮忙啊
function TF_SystemSetFrm.CreateConn(ConnName,ServerIP:String;NeedDataEncrypt:Boolean):Boolean;
var
rasEntry : TRasEntry;
rasEntrySize :longInt;
dwResult : longInt;
begin
rasEntrySize := SizeOf(rasEntry);
fillchar(rasEntry,rasEntrySize,0);
rasEntry.dwSize := rasEntrySize;
rasEntry.szDeviceType := RASDT_VPN;
if NeedDataEncrypt then
rasEntry.dwfOptions := RASEO_RequireMsEncryptedPw or RASEO_RequireDataEncryption;
rasEntry.dwfOptions := rasEntry.dwfOptions or
RASEO_IpHeaderCompression or RASEO_RemoteDefaultGateway or
RASEO_RequireEncryptedPw or RASEO_SwCompression or
RASEO_NetworkLogon or RASEO_UseCountryAndAreaCodes;
strpcopy(rasEntry.szLocalPhoneNumber,ServerIP);
rasEntry.dwCountryID := 86;
rasEntry.dwCountryCode := 21;
rasEntry.dwfNetProtocols := RASNP_Ipx + RASNP_Ip + RASNP_NetBeui;
rasEntry.dwFramingProtocol := RASFP_ppp;
if (GetSystemVer = 'Windows 2000') or (GetSystemVer = 'Windows XP') then
rasEntry.szDeviceName := 'WAN 微型端口 (PPTP)'
else
rasEntry.szDeviceName := 'Microsoft VPN Adapter';
dwResult := RasSetEntryProperties(nil,PChar(ConnName),@rasEntry,sizeof(rasEntry),nil,0);
if dwResult <> 0 then
Result:=False
else Result:=True;
end;
但是在XP 里 不能将 要求数据加密(没有断开) 这个选项去掉
而在2000里是可以的 不知道是什么原因
请大家帮忙啊
function TF_SystemSetFrm.CreateConn(ConnName,ServerIP:String;NeedDataEncrypt:Boolean):Boolean;
var
rasEntry : TRasEntry;
rasEntrySize :longInt;
dwResult : longInt;
begin
rasEntrySize := SizeOf(rasEntry);
fillchar(rasEntry,rasEntrySize,0);
rasEntry.dwSize := rasEntrySize;
rasEntry.szDeviceType := RASDT_VPN;
if NeedDataEncrypt then
rasEntry.dwfOptions := RASEO_RequireMsEncryptedPw or RASEO_RequireDataEncryption;
rasEntry.dwfOptions := rasEntry.dwfOptions or
RASEO_IpHeaderCompression or RASEO_RemoteDefaultGateway or
RASEO_RequireEncryptedPw or RASEO_SwCompression or
RASEO_NetworkLogon or RASEO_UseCountryAndAreaCodes;
strpcopy(rasEntry.szLocalPhoneNumber,ServerIP);
rasEntry.dwCountryID := 86;
rasEntry.dwCountryCode := 21;
rasEntry.dwfNetProtocols := RASNP_Ipx + RASNP_Ip + RASNP_NetBeui;
rasEntry.dwFramingProtocol := RASFP_ppp;
if (GetSystemVer = 'Windows 2000') or (GetSystemVer = 'Windows XP') then
rasEntry.szDeviceName := 'WAN 微型端口 (PPTP)'
else
rasEntry.szDeviceName := 'Microsoft VPN Adapter';
dwResult := RasSetEntryProperties(nil,PChar(ConnName),@rasEntry,sizeof(rasEntry),nil,0);
if dwResult <> 0 then
Result:=False
else Result:=True;
end;