请教,请教!Rasapi32.dll开发的新建网络拨号问题。(求帮忙,高分)
我用Rasapi32.dll中的RasSetEntryPropertiesA建立了一个拨号连接。
但在连接属性的“网络”页中“internet 协议版本 6 (tcp/ipv6)”一直处于未选中状态,我想让其被选择,应该怎么设置参数?
我的代码:
function Create_ADSL_Connection(sEntryName, sServer, sUsername, sPassword: string): Boolean;
var
sDeviceName, sDeviceType: string;
re: TRasEntry;
rc: TRasCredentialsA;
begin
sDeviceName := 'WAN 微型端口 (PPPOE)'; // 'WAN 微型端口 (PPTP)';
sDeviceType := 'modem';
with re do
begin
Result := False;
ZeroMemory(@re, SizeOf(re));
dwSize := SizeOf(re);
dwCountryCode := 86;
dwCountryID := 86;
dwDialExtraPercent := 75;
dwDialExtraSampleSeconds := 120;
dwDialMode := 1;
dwEncryptionType := 3;
dwfNetProtocols := 4;
dwfOptions := 83952400;
dwfOptions2 := 367;
dwFramingProtocol := 1;
dwHangUpExtraPercent := 10;
dwHangUpExtraSampleSeconds := 120;
dwRedialCount := 3;
dwRedialPause := 60;
dwType := 5;
dwEncryptionType := 3;
StrCopy(@szDeviceName[0], PAnsichar(sDeviceName));
StrCopy(@szDeviceType[0], PAnsichar(sDeviceType));
StrCopy(@szLocalPhoneNumber[0], PAnsichar(sServer));
end;
with rc do
begin
ZeroMemory(@rc, SizeOf(rc));
dwSize := SizeOf(rc);
dwMask := 11;
StrCopy(@szUserName[0], PAnsichar(sUsername));
StrCopy(@szPassword[0], PAnsichar(sPassword));
end;
if RasSetEntryPropertiesA(nil, PChar(sEntryName), @re, SizeOf(re), nil, 0) = 0 then
if RasSetCredentialsA(nil, PChar(sEntryName), @rc, 0) = 0 then
Result := True;
end;