L
linuxping
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TfrmMain.Button1Click(Sender: TObject);
var
str,CookList,Cookiestr:String;
List:TStringList;
I:Integer;
begin
list:=TStringList.Create;
try
IdHTTP1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322)';
IdHTTP1.Request.AcceptEncoding:='gzip, deflate';
IdHTTP1.Request.Accept:='*/*';
IdHTTP1.HandleRedirects:=True;
IdHTTP1.RedirectMaximum:=3;
IdHTTP1.AllowCookies:=True;
IdHTTP1.Get('http://www.cwzj.com/W/View_Info.asp?Id=1523');
for i:=0 to IdHTTP1.Response.RawHeaders.Count-1 do
begin
if UpperCase(Copy(IdHTTP1.Response.RawHeaders,1,10))= 'SET-COOKIE' then
begin
Cookiestr :=TrimRight(Copy(IdHTTP1.Response.RawHeaders,12,MAXINT));
Cookiestr :=Copy(CookieStr,1,Pos(';',CookieStr));
CookList :=CookList+CookieStr;
end;
end;
//IdHTTP1.Request.SetHeaders;
//IdHTTP1.Request.RawHeaders.Values['Cookie']:=cooklist;
ShowMessage(Cooklist);
{name=1&sex=保密&xxid=1523&xxtime=2007-5-30 18:41:49&xxts=365&xxmem=0&tit=留言:&tel=22222222&email=333333@163.com&neirong=3&Submit=马上发布}
List.Add('name=wangping&');
List.Add('sex=保密&');
List.Add('xxid=1523&');
List.Add('xxtime=2007-5-30 18:41:49&');
List.Add('xxts=365&');
List.Add('xxmem=0&');
List.Add('&tit=留言');
List.Add('tel=22222222&');
List.Add('email=333333@163.com&');
List.Add('neirong=3&');
List.Add('Submit=马上发布');
IdHTTP1.Post('http://www.cwzj.com/W/savehf.asp',List);
idhttp1.Get(IdHTTP1.Response.Location);
finally
list.free;
end;
end;
提交不了数据..........
从IE上手动提交就可以,郁闷啊
var
str,CookList,Cookiestr:String;
List:TStringList;
I:Integer;
begin
list:=TStringList.Create;
try
IdHTTP1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322)';
IdHTTP1.Request.AcceptEncoding:='gzip, deflate';
IdHTTP1.Request.Accept:='*/*';
IdHTTP1.HandleRedirects:=True;
IdHTTP1.RedirectMaximum:=3;
IdHTTP1.AllowCookies:=True;
IdHTTP1.Get('http://www.cwzj.com/W/View_Info.asp?Id=1523');
for i:=0 to IdHTTP1.Response.RawHeaders.Count-1 do
begin
if UpperCase(Copy(IdHTTP1.Response.RawHeaders,1,10))= 'SET-COOKIE' then
begin
Cookiestr :=TrimRight(Copy(IdHTTP1.Response.RawHeaders,12,MAXINT));
Cookiestr :=Copy(CookieStr,1,Pos(';',CookieStr));
CookList :=CookList+CookieStr;
end;
end;
//IdHTTP1.Request.SetHeaders;
//IdHTTP1.Request.RawHeaders.Values['Cookie']:=cooklist;
ShowMessage(Cooklist);
{name=1&sex=保密&xxid=1523&xxtime=2007-5-30 18:41:49&xxts=365&xxmem=0&tit=留言:&tel=22222222&email=333333@163.com&neirong=3&Submit=马上发布}
List.Add('name=wangping&');
List.Add('sex=保密&');
List.Add('xxid=1523&');
List.Add('xxtime=2007-5-30 18:41:49&');
List.Add('xxts=365&');
List.Add('xxmem=0&');
List.Add('&tit=留言');
List.Add('tel=22222222&');
List.Add('email=333333@163.com&');
List.Add('neirong=3&');
List.Add('Submit=马上发布');
IdHTTP1.Post('http://www.cwzj.com/W/savehf.asp',List);
idhttp1.Get(IdHTTP1.Response.Location);
finally
list.free;
end;
end;
提交不了数据..........
从IE上手动提交就可以,郁闷啊