我用idhttp向google提交查询,关键字为mp3,但我执行时总报http/1.0 501 not implemented 这个错误。跟踪执行时发现mystr不能正常赋值,请问是怎么回事?
procedure TForm1.Button2Click(Sender: TObject);
const
posturl='http://www.google.com/intl/zh-CN/';
postcmd='btnG=';
var
mystr,tempstring:Tstringlist;
currentdirectory,inputstring:string;
begin
tempstring:=tstringlist.Create ;
mystr:=Tstringlist.Create ;
getdir(0,currentdirectory);
inputstring:=inputbox('搜索:','参数','mp3');
mystr.Add(postcmd+inputstring);
tempstring.Add(idhttp1.Post(posturl,mystr));
tempstring.SaveToFile('test.html');
webbrowser1.Navigate(currentdirectory+'/test.html');
mystr.Free;
tempstring.Free;
end;