Z
zsjj
Unregistered / Unconfirmed
GUEST, unregistred user!
开始我用Idhttp.post但怎么也登陆不了,后来我用Get的方法登陆,可以了(代码在下面),但这两天这个方法也登陆不了,实在想不出办法了,希望哪位大侠能帮忙解决一下,不胜感激
function TForm_main.loginTaobao(name:string;password:string):boolean;
var html:string;
begin
try
html:=idhttp1.Get('http://member1.taobao.com/member/login.jhtml?TPL_username='+name+'&TPL_password='+password+'&action=Authenticator&TPL_redirect_url=http://my.taobao.com/mytaobao/home/my_taobao.jhtml&event_submit_do_login=anything&');
if pos(widestring('您需要登录后才能继续刚才的操作'),widestring(html))>0 then
begin result := false; self.showlog( '用户'+name+'登陆失败,请检查用户名或者密码是否正确'); end
else
begin result :=true; self.showlog( '用户'+name+'已经成功登陆'); end;
except
result := false;
self.showlog( '登陆过程中发生错误,登陆失败');
end;
end;
function TForm_main.loginTaobao(name:string;password:string):boolean;
var html:string;
begin
try
html:=idhttp1.Get('http://member1.taobao.com/member/login.jhtml?TPL_username='+name+'&TPL_password='+password+'&action=Authenticator&TPL_redirect_url=http://my.taobao.com/mytaobao/home/my_taobao.jhtml&event_submit_do_login=anything&');
if pos(widestring('您需要登录后才能继续刚才的操作'),widestring(html))>0 then
begin result := false; self.showlog( '用户'+name+'登陆失败,请检查用户名或者密码是否正确'); end
else
begin result :=true; self.showlog( '用户'+name+'已经成功登陆'); end;
except
result := false;
self.showlog( '登陆过程中发生错误,登陆失败');
end;
end;