Delphi

Delphi TextFile UTF8编码读写

69 0

procedure TForm1.Button1Click(Sender: TObject);var Outfile: TextFile;begin AssignFile(Outfile, test_chinese.txt, CP_UTF8); Rewrite(Outfile); //This is the UTF-8 BOM Write(Outfile, #$FEFF); Writeln(Outfile, 总结); Writeln(Outfile,

Delphi

Delphi DateTimePicker控件日期格式

160 0

设置成显示年、月、日、时、分、秒1:将DateTimePicker的Format属性中加入日期格式设成 yyyy-MM-dd HH:mm:ss,注意日期里月份对应的MM是大写,时间里的分钟对应的mm是小写;2:将kind设置为dtkTime;3:将DateMode属性为dmComboBox;4:通常在Form onShow事件中设置DateTimePicker1.DateTime := Now,系统会自动将年月日时分秒信息赋值给该控件。设置成显示年、月、日1:将DateTimePic

Delphi

Delphi 为数字补充前缀0

139 0

标准的Format函数可以做同样的事情!Format(%。10d,[15])将返回0000000015或者:function AddLeadingZeros(const Source: string; Len: Integer): string;var i: Integer;begin Result := Source; for i := 1 to (Len-Length(Source)) do Result := 0 + Resu

Delphi

Delphi HTML转义

32 0

function torehtml(const strHTML: string): string;begin Result :=strHTML; Result := StringReplace(Result, ", ", [rfReplaceAll]); Result := StringReplace(Result, , ', [rfReplaceAl

Delphi 提高unigui开发效率的两个方法
Delphi

Delphi 提高unigui开发效率的两个方法

80 0

1、编译时自己退出运行的程序。在做unigui开发时,每次编译运行时,unigui的应用都会在后台运行,每次重新编译时都必须手工在任务栏里将应用退出才行,非常麻烦,可以在项目编译的参数里加上杀进程的命令,这样每次重新编译时就会自动将旧的进程杀掉。命令参数如下:taskkill /f /im $(OUTPUTFILENAME) 2>1 || exit /B 02、每次运行应用时,自动调用浏览器打开应用。在每次运行应用时都要手动打开浏览器,输入地址各端口,还是有点麻烦,在ServerModule里加

Delphi

Delphi 如何将颜色值转换为HTML格式?

37 0

function GetHTMLColor(cl: TColor; IsBackColor: Boolean): string;var rgbColor: TColorRef;begin if IsBackColor then Result := bg else Result := ; rgbColor := ColorToRGB(cl); Result := Result + color="# + Format(

Delphi

OrangeUI作者开源作品

55 0

OrangeUI作者开源作品大家好,DelphiTeacher开源了三方SDK智能布署工具等源码,希望对大家对接jar,aar,ios framework有所帮助,也欢迎大家一起来完善,使Delphi越来越方便。相应的github地址:公共包:https://github.com/DelphiTeacher/OrangeProjectCommon.git三方SDK对接工具:https://github.com/DelphiTeacher/OrangeSDKSmartDeployment.git对接的免费