求邮箱自动登录代码
想实现点击按钮直接登录邮箱(默认浏览器中登录) 求代码太荣幸了 ~~~~可是我还是不太明白给个完整的例子 好不?
鱼哥厉害
刚自己弄了个简单的 不知道楼主是这个意思不 源码也上传了
procedure TForm1.Button1Click(Sender: TObject);
Var
UserName,Password,LoginUrl:String;
begin
if (Edit1.Text='') or (Edit2.Text='') then
ShowMessage('请完整输入账号、密码!')
else
begin
UserName:=Edit1.text;
Password:=Edit2.Text;
if ComboBox1.ItemIndex=0 then
begin
LoginUrl:='http://reg.163.com/logins.jsp?type=1&url=http://entry.mail.126.com/cgi/ntesdoor?&username='+ UserName + '@126.com&password='+Password;
Shellexecute(0,'open','iexplore.exe',Pchar(LoginUrl),'',SW_SHOWNORMAL);
end;
if ComboBox1.ItemIndex=1 then
begin
LoginUrl:='https://reg.163.com/logins.jsp?username='+UserName+'&password='+Password+'&url=http://fm163.163.com/coremail/fcg/ntesdoor2';
Shellexecute(0,'open','iexplore.exe',Pchar(LoginUrl),'',SW_SHOWNORMAL);
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text:='';
Edit2.Text:='';
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked then
Edit2.PasswordChar:=#0
else
Edit2.PasswordChar:='*';
end;
procedure TForm1.Label3Click(Sender: TObject);
begin
Shellexecute(0,'open','iexplore.exe',Pchar('http://328783896.qzone.qq.com'),'',SW_SHOWNORMAL);
end; data := TIdMultiPartFormDataStream.Create;
ResponseStream := TMemoryStream.Create;
try
IdHttp1.Request.ContentType := data.RequestContentType;
data.AddFormField('tbUserName','username');
data.AddFormField('tbPassword','******');
data.PrepareStreamForDispatch;
data.Position := 0;
IdHTTP1.Post(edtHost.Text, data, ResponseStream);
finally
data.Free;
ResponseStream.Free;
end; 小甲鱼 发表于 2012-12-22 17:12 static/image/common/back.gif
太荣幸了 ~~~~可是我还是不太明白给个完整的例子 好不?:P aminghanhua 发表于 2012-12-22 22:11 static/image/common/back.gif
鱼哥厉害
刚自己弄了个简单的 不知道楼主是这个意思不 源码也上传了
非常感谢 代码也很简练实用 但是我用不了可能是我没有说明白,我的意思是自动获取密码框与登录框然后输入,这个我就什么邮箱都等登录了 ,望回复~~~感激涕零:'( 小甲鱼 发表于 2012-12-22 17:12 static/image/common/back.gif
在win7 64位里用delphi7 找不到TIdMultiPartFormDataStream怎么回事啊
页:
[1]