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 操作 pdf -- 使用 acrobat sdk 初探

Delphi xe2获取文件的 md5、crc、sha-1、sha-256、sha-512

Delphi 从paintbox拷贝一部分内容到tbitmap

cef4Delphi 语言区域设置

Delphi剪切板-监视剪贴板

Delphi ntfs usn 磁盘文件搜索

Delphi 关于汉字换行问题

Delphi adoquery 运用

Delphi用idhttp提交自定义cookie

Delphi 全局钩子锁定键盘

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



打赏

取消

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

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

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

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

评论

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