function getUrlSource(strUrl: string):string; //获取网页源码
begin //try
lsResult := IdHTTP1.GET(strUrl); //except
//ShowMessage('获取源码出错');
//end;end;
错误提示:IdHTTP1没定义!页面上已加入TIdHTTP控件。
begin //try
lsResult := IdHTTP1.GET(strUrl); //except
//ShowMessage('获取源码出错');
//end;end;
错误提示:IdHTTP1没定义!页面上已加入TIdHTTP控件。
解决方案 »
- 如何写这样的Panel 控件?
- 如何设置公式
- delphi中查询统计问题,求助
- 用InstallShield Express制作Delphi数据库安装程序的问题,请各位指教,欢迎大家一起讨论,高分相关哦!
- 判断字符串中是否包含某一字符子串
- 关于Coinitialize()在dll中的调用问题,请高手指教。
- VirtualTrees控件的两个事件怎么用(vsttreeLoadNode,vsttreeSaveNode)为什么我的代码提示内存溢出
- 电脑的专有名称太多了,英文简写更让人眼花缭乱,怎样可以收集这些简写,并知道他们的确切含义?谢谢!
- 如何通过delphi将foxpro中的.dat文件转换为.txt文件,然后导入informix数据库中?
- 如何动态取得detailband的高度!!!
- 帮顶有分。制作组合控件,捕获事件的难题。
- 函数传递中CONST 的问题
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
private
{ Private declarations }
public
{ Public declarations }
function getUrlSource(strUrl: string):string;
end;var
Form1: TForm1;implementation{$R *.dfm}function TForm1.getUrlSource(strUrl: string): string;
begin
//try
lsResult := IdHTTP1.GET(strUrl); //except
//ShowMessage('获取源码出错');
//end;
end;
也许你没有uses含有IdHTTP1的unit
独立函数,需要指明控件是那个form里的