用这个拨号试试:
function MyDial(FEntryName: String;
FPhoneNumber: String;
FCallbackNumber: String;
FUserName: String;
FPassword: String;
FDomain: String;
FHRasConn: THRasConn): Longint;
var
DialParams: TRasDialParams;
lpfPassword: LongBool;
begin
if FHRasConn > 0 then HangUp;
FillChar(DialParams, SizeOf(TRasDialParams), #0);
with DialParams do
begin
dwSize:=Sizeof(TRasDialParams);
StrPCopy(szEntryName, FEntryName);
end;
if FEntryName <> '' then
begin
Result := RasGetEntryDialParams(nil, DialParams, lpfPassWord);
if Result <> 0 then Exit;
end
else
with DialParams do
begin
dwSize := SizeOf(TRASDialParams);
szEntryName := '';
UniqueString(FPhoneNumber);
StrLCopy(szPhoneNumber, PChar(FPhoneNumber), RAS_MaxPhoneNumber);
UniqueString(FCallBackNumber);
UniqueString(FCallBackNumber);
StrLCopy(szCallbackNumber, PChar((FCallBackNumber)),
RAS_MaxCallbackNumber);
UniqueString(FUserName);
StrLCopy(szUserName,PChar((FUserName)) , UNLEN);
UniqueString(fPassWord);
StrLCopy(szPassword, PChar((fPassWord)), PWLEN);
UniqueString(FDomain);
StrLCopy(szDomain, Pchar(FDomain), DNLEN);
end;
FHRasConn := 0;
Result := RasDial(nil, nil, DialParams, 0, nil, FHRasConn);
end;