新建个form放上richedit,从网络上读取文本并且在处于不可编辑状态,比如载入http:\\192.168.1.1\text.txt显示在richedit的文本框内,并且别人用dele删除不了,[代码处理的好再给加分... 新建个form 放上richedit ,从网络上读取文本并且在处于不可编辑状态,比如载入http:\\192.168.1.1\text.txt 显示在 richedit的文本框内,并且别人用dele删除不了,
[代码处理的好 再给加分拜谢]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdHTTP;
type
TForm1 = class(TForm)
RichEdit1: TRichEdit;
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
S:WideString;
H:TIdHTTP;
begin
H:=TIdHTTP.Create(nil);
try
S:=H.Get(Edit1.Text) ;//下载文本
RichEdit1.Text:=s;
RichEdit1.ReadOnly:=True;//这样不能删除
finally
H.Free;
H:=nil;
end;
end;
end.