用HTTP协议发Post或Get请求啊。
不过Delphi里有现成的控件可用(TIdHttp),
如果没装也可用TNMHttp来达到目的。
如:
IdHttp1.Get('http://localhost/login.asp?name=abc&password=123');必要时用HttpApp单元时的HttpEncode方法编码一下字符串。
不过Delphi里有现成的控件可用(TIdHttp),
如果没装也可用TNMHttp来达到目的。
如:
IdHttp1.Get('http://localhost/login.asp?name=abc&password=123');必要时用HttpApp单元时的HttpEncode方法编码一下字符串。
{我随便写的请参考 呵呵~~~}
procedure TForm3.Button1Click(Sender: TObject);
begin
if Length(Edit5.Text)=11 then begin
NMHTTP.InputFileMode := false;
NMHTTP.OutputFileMode := false;
NMHTTP.ReportLevel := Status_Basic;
//NMHTTP.Get('GET形式和POST一样用这是Fastnet的问题');
NMHTTP.Post('http://smsknl.163.com/smsuser/preRegist.jsp?userPhone='+Edit5.Text,'');
//只有用这样的方法才能正确的用Post传递如果用Demo下的例子是传递不出去的!
Memo2.Text := NMHTTP.Body;
if Pos('不可用的手机号码',Memo2.Text)<>0 then begin
ShowMessage('号码错误,我们暂时不接受神州行用户。');
end{-if} else begin
Label8.Caption:='您注册的手机号码:'+Edit5.Text;
NoteBook1.PageIndex:=1;
end;
end{-if} else begin
ShowMessage('手机号码不能小于11位数字');
end;
end;