都是与网页相关的控件 idhttp可以直接操作底层数据 webbrowser则是封装了对模拟浏览器 的操作 1、idhttp 获取中文网页内容乱码 procedure TForm1.Button1Click(Sender: TObject); var f : textFile; ss : TStringStream; s : String; begin try ss := TStringStream.Create('', TEncoding.GetEncoding(65001));//utf-8编码 idhttp1.Get(edtURL.Text,ss); s := ss.DataString; except Showmessage('网络出错!'); Exit; end; AssignFile(f,'c:/111.txt'); rewrite(f); write(f,s); closeFile(f); if pos(edtkeyWords.Text,s)<>0 then Showmessage('快快寻宝去吧!'); end;