Delphi OpenTextFileDialog用法


本文整理自网络,侵删。

 
var D: TOpenTextFileDialog;
    S: TStringList;
begin
    D := TOpenTextFileDialog.Create(nil);
    try
      D.Title := 'Import from File';
      D.Filter := 'Text File|*.txt|All Files|*';

      if D.Execute then
      begin
          S := TStringList.Create;
          try
            S.LoadFromFile(D.FileName, D.Encodings.Objects[D.EncodingIndex] as TEncoding);

            M.SelText := S.Text;
          finally
            S.Free;
          end;
      end;

    finally
      D.Free;
    end;

相关阅读 >>

Delphi xe tparallel.for循环

Delphi xe10实现移动端支付宝、微信支付接口

Delphi daysbetween 用法片段

Delphi中的各种文件类型介绍

Delphi 关闭显示器

Delphi 日期时间计算

Delphi 拷贝文件夹内所有内容

Delphi wmi 取显卡gpu信息

Delphi将image存入mysql数据库

Delphi datasettojson jsontodataset

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...