爱招飞帮助手册 爱招飞帮助手册
首页
  • 学习手册

    • 基本入门
    • 功能介绍
    • 控件说明
    • 功能用法
    • 专用模板
    • 开发流程
    • 函数程序
  • 学习手册

    • 基本入门
    • 功能介绍
    • 控件说明
    • 系统工具
    • 系统管理
    • 数据库工具
    • 专用模板
    • 外部功能
    • 开发流程
    • 函数代码
  • 开发手册
  • 学习手册

    • 基本入门
    • 功能介绍
    • 控件说明
    • 功能用法
    • 专用模板
    • 开发流程
    • 函数程序
  • 开发手册
  • 学习手册

    • 基本入门
    • 功能介绍
    • 控件说明
    • 功能用法
    • 专用模板
    • 开发流程
    • 函数程序
  • 开发手册
  • 学习手册

    • 安装配置
    • 快速上手
    • 界面介绍
    • 功能介绍
    • 报表设计
  • 学习手册

    • 安装配置
    • 快速上手
    • 界面介绍
    • 功能介绍
    • RestAPI
    • WebSocket
  • 学习手册

    • 安装配置
    • 快速上手
    • 程序架构
    • 界面介绍
    • 功能介绍
  • 学习手册

    • 安装配置
    • 快速上手
    • 界面介绍
    • 功能介绍
  • 学习手册

    • 安装配置
    • 快速上手
    • 界面介绍
    • 功能介绍
    • 预设资料
    • RestAPI说明
    • WebSocket说明
    • MQTT说明
    • Python说明
    • 自定程序
    • 运行卫士
    • 自动化作业
    • 函数程序
    • 控件使用
  • 开发手册
  • FastERP
  • FastWeb
  • Smart
  • PinToo
  • Flying
  • TARS
  • 通用功能

    • Report
    • Script
    • Echarts
    • Chart
    • DB Install
    • HiDesk
    • HiNAT
    • FastBPM
    • ReportBuilder
首页
  • 学习手册

    • 基本入门
    • 功能介绍
    • 控件说明
    • 功能用法
    • 专用模板
    • 开发流程
    • 函数程序
  • 学习手册

    • 基本入门
    • 功能介绍
    • 控件说明
    • 系统工具
    • 系统管理
    • 数据库工具
    • 专用模板
    • 外部功能
    • 开发流程
    • 函数代码
  • 开发手册
  • 学习手册

    • 基本入门
    • 功能介绍
    • 控件说明
    • 功能用法
    • 专用模板
    • 开发流程
    • 函数程序
  • 开发手册
  • 学习手册

    • 基本入门
    • 功能介绍
    • 控件说明
    • 功能用法
    • 专用模板
    • 开发流程
    • 函数程序
  • 开发手册
  • 学习手册

    • 安装配置
    • 快速上手
    • 界面介绍
    • 功能介绍
    • 报表设计
  • 学习手册

    • 安装配置
    • 快速上手
    • 界面介绍
    • 功能介绍
    • RestAPI
    • WebSocket
  • 学习手册

    • 安装配置
    • 快速上手
    • 程序架构
    • 界面介绍
    • 功能介绍
  • 学习手册

    • 安装配置
    • 快速上手
    • 界面介绍
    • 功能介绍
  • 学习手册

    • 安装配置
    • 快速上手
    • 界面介绍
    • 功能介绍
    • 预设资料
    • RestAPI说明
    • WebSocket说明
    • MQTT说明
    • Python说明
    • 自定程序
    • 运行卫士
    • 自动化作业
    • 函数程序
    • 控件使用
  • 开发手册
  • FastERP
  • FastWeb
  • Smart
  • PinToo
  • Flying
  • TARS
  • 通用功能

    • Report
    • Script
    • Echarts
    • Chart
    • DB Install
    • HiDesk
    • HiNAT
    • FastBPM
    • ReportBuilder
  • PinToo帮助主页
  • 学习手册

    • 基本入门

    • 功能介绍

    • 控件说明

    • 功能用法

    • 专用模板

    • 开发流程

    • 函数程序

      • 系统函数
      • 系统程序
      • 自定函数
        • 1. TfxDm类函数
          • 1.1. AnsiToUnicode
          • 1.2. CreateGuid
          • 1.3. GetBatchNo
          • 1.4. GetBillNo
          • 1.5. GetDateTime
          • 1.6. GetFileMd5
          • 1.7. GetLoadingDatas
          • 1.8. GetLoadingUsers
          • 1.9. GetNodeID
          • 1.10. GetTextMd5
          • 1.11. GetTickCount
          • 1.12. HexToInt
          • 1.13. ReturnValue
          • 1.14. ReplaceText
          • 1.15. SqliteGetFrameMemory
          • 1.16. StreamToSqlStr
          • 1.17. UnicodeToChinese
        • 2. TfxFun类函数
          • 2.1. Base64Get
          • 2.2. ByteToHex
          • 2.3. CalCRC16
          • 2.4. CreateStringStream
          • 2.5. GetFirstDayofMonth
          • 2.6. GetLastDayofMonth
          • 2.7. GetPropValue
          • 2.8. GetAlarmsPath
          • 2.9. GetCachePath
          • 2.10. GetCameraPath
          • 2.11. GetDocumentsPath
          • 2.12. GetDownloadsPath
          • 2.13. GetHomePath
          • 2.14. GetLibraryPath
          • 2.15. GetMoviesPath
          • 2.16. GetMusicPath
          • 2.17. GetNumber
          • 2.18. GetPicturesPath
          • 2.19. GetPublicPath
          • 2.20. GetRingtonesPath
          • 2.21. GetSharedAlarmsPath
          • 2.22. GetSharedCameraPath
          • 2.23. GetSharedDocumentsPath
          • 2.24. GetSharedMoviesPath
          • 2.25. GetSharedMusicPath
          • 2.26. GetSharedPicturesPath
          • 2.27. GetSharedRingtonesPath
          • 2.28. GetTempPath
          • 2.29. HexCalCRC
          • 2.30. IntToHex
          • 2.31. NetHttpClientPost
          • 2.32. NetHttpGet
          • 2.33. NetHttpPost
          • 2.34. NetHttpPut
          • 2.35. NetHttpDelete
          • 2.36. GetJSONObject
          • 2.37. GetJSONArray
          • 2.38. GetJSONString
          • 2.39. GetJSONNumber
          • 2.40. GetJSONInteger
          • 2.41. GetJSONFloat
          • 2.42. GetJSONBool
          • 2.43. GetJSONValue
          • 2.44. JSONArray_AddJSONObject
          • 2.45. JSONObject_AddJSONArray
          • 2.46. JSONParse
          • 2.47. ParseJSONValue
          • 2.48. NextMonth
          • 2.49. ParseJSONObject
          • 2.50. PrintBitmap
          • 2.51. RoundToCH
          • 2.52. SendArticleMessage
          • 2.53. SendCustomMessage
          • 2.54. SendTemplateMessage
          • 2.55. SendWechatMsg
          • 2.56. StrToHex
          • 2.57. StreamToBase64
          • 2.58. SystemSupportsPrint
          • 2.59. UrlDecode
          • 2.60. UrlEncode
      • 自定程序
  • 开发手册

目录

自定函数

# PinToo 自定函数


# 1. TfxDm类函数

  需引用ufxDm单元。

# 1.1. AnsiToUnicode

function AnsiToUnicode(Str: string): string;
1

说明: Ansi转Unicode码

返回值: Srtring字符串类型。

  • AnsiToUnicode函数语法中各部分说明
部分 说明
Str 需要转换的字符串
  • 示例
var
    vStr: String;
begin
    //转字符转换成Unicode码
    vStr:= fxDM.AnsiToUnicode('我是中国人');
end;
1
2
3
4
5
6
  • 运行结果

\u6211\u662F\u4E2D\u56FD\u4EBA


# 1.2. CreateGuid

function CreateGuid:string;
1

说明: 获取唯一GUID。

返回值: String字符类型。

  • 示例
Var
    vGUID:String;
begin
    vGUID := CreateGuid;
    Showmessage(vGUID);
end;
1
2
3
4
5
6
  • 运行结果:

73782A6D-0E78-406F-AC9E-F48CB82772CF


# 1.3. GetBatchNo

function GetBatchNo(QBillID: string): string;
1

说明: 获取批号。

返回值: Srtring字符串类型。

  • GetBatchNo函数语法中各部分说明
部分 说明
QBillID 流水编号
  • 示例
begin
    fxDM.GetBatchNo(‘17020004’);
end;
1
2
3

# 1.4. GetBillNo

function GetBillNo(QBillID: string; QDate: TDateTime; QPreview: Boolean):
    string;
1
2

说明: 获取单据流水号。

返回值: String字符类型。

  • GetBillNo函数语法中各部分说明
部分 说明
QBillID 单据流水号规则编号
QDate 日期
QPreview 是否预览模式
  • 示例
// 参数QPreview为true时,流水号生成只是预览模式,还未正式产生

begin
    fxDM.GetBillNo (‘17020004’,Now(),false);
end;
1
2
3
4
5

# 1.5. GetDateTime

Function GetDateTime: TDateTime;
1

说明: 获取日期时间。

返回值: TDateTime日期时间类型。

  • 示例
var
    vDateTime: TDateTime;
begin
    //连线模式时取服务器时间,离线SQLite模式时取本地设备时间
    vDateTime := fxDm.GetDateTime;
end;
1
2
3
4
5
6

# 1.6. GetFileMd5

function GetFileMd5(AStream: TStream): string;
1

说明: 文件流MD5加密。

返回值: String字符类型。

  • GetFileMd5函数语法中各部分说明
部分 说明
AStream 文件流

# 1.7. GetLoadingDatas

function GetLoadingDatas: string;
1

说明: 获取本地方案信息。

返回值: String字符串类型。

  • 示例
var
    vDatas: String;
begin
    //获取本地方案信息
    vDatas:= fxDm.GetLoadingDatas;
end;
1
2
3
4
5
6

# 1.8. GetLoadingUsers

function GetLoadingUsers: string;
1

说明: 获取本地用户信息。

返回值: string字符串类型。

  • 示例
var
    vUsers: String;
begin
    //获取本地用户信息
    vUsers:= fxDm.GetLoadingUsers;
end;
1
2
3
4
5
6

# 1.9. GetNodeID

function GetNodeID(QCount: Integer = 1; QNoRecord: Boolean = False):
    Integer;
1
2

说明: 获取唯一ID。

返回值: Integer 整数类型。

  • GetNodeID函数语法中各部分说明
部分 说明
QCount 取多少个ID(不能超过999)
QNoRecord 是否返回结果集
  • 示例
Var
    vNodeID:integer;
begin
    vNodeID := fxDM.GetNodeID;
end;
1
2
3
4
5

# 1.10. GetTextMd5

function GetTextMd5(const Value: string): string;
1

说明: 字符串MD5加密。

返回值: String字符类型。

  • GetTextMd5函数语法中各部分说明
部分 说明
Value 字符串
  • 示例
Var
    v:String;
begin
    v := GetTextMd5('123ABC');
    Showmessage(v);
end;
1
2
3
4
5
6
  • 运行结果:

68BA07ABF0D370630620EA43C68FABBD


# 1.11. GetTickCount

function GetTickCount: Int64;
1

说明: 获取毫秒。

返回值: Int64整型。

  • 示例
var
    v1,v2:int64;
begin
    //获取执行耗时
    v1:= GetTickCount;
    v2:= GetTickCount;
    Showmessage(IntTostr(v2-v1));
end;
1
2
3
4
5
6
7
8

# 1.12. HexToInt

function HexToInt(Const HexValue: String) : Integer;
1

说明: 16进制转整数

返回值: 整型


# 1.13. ReturnValue

function ReturnValue(sSQL: String; iReturnType: Integer = 0): Variant;
1

说明: 根据SQL取值

返回值: 变体Variant类型

  • ReturnValue函数语法中各部分说明
部分 说明
sSQL 指定一个SQL内容
iReturnType iReturnType返回值类型 0:字符;1:整数;2:浮点;3:布尔;4日期
  • 示例
var
    vSQL:string;
    v:variant;
begin
    //获取字符内容
    v:= fxDM.ReturnValue (vSQL);
    //获取整数内容
    v:= fxDM.ReturnValue (vSQL,1);
    //获浮点内容
    v:= fxDM.ReturnValue (vSQL,2);
end;
1
2
3
4
5
6
7
8
9
10
11

# 1.14. ReplaceText

function ReplaceText(const AText, AFromText, AToText: string): string;
1

说明: 字符串替换

返回值: String字符类型。

  • ReplaceText函数语法中各部分说明
部分 说明
AText 原字符串
AFromText 需要替换的字符串
AToText 替换字符串
  • 示例
Var
    v:String;
begin
    //将字符串中的CC替换成--
    v:='AAbbCCddEE1212$';
    v := ReplaceText(v,'CC','--');
    Showmessage(v);
end;
1
2
3
4
5
6
7
8
  • 运行结果:

AAbb--ddEE1212$


# 1.15. SqliteGetFrameMemory

function SqliteGetFrameMemory(AFrm, AObj: string): string;
1

说明: 获取窗体对象信息。

返回值: String字符串类型。

  • SqliteGetFrameMemory函数语法中各部分说明
部分 说明
AFrm 窗体名称
AObj 对角名称

# 1.16. StreamToSqlStr

function StreamToSqlStr(AStream: TStream): string;
1

说明: 流转成SQL文字格式。

返回值: String字符类型。

  • StreamToSqlStr函数语法中各部分说明
部分 说明
AStream 数据流

# 1.17. UnicodeToChinese

function UnicodeToChinese(inputstr: string): string;
1

说明: Unicode码转成汉字。

返回值: Srtring字符串类型。

  • UnicodeToChinese函数语法中各部分说明
部分 说明
inputstr 需要转换的Unicode码字符串
  • 示例
var
    vStr: String;
begin
    //将Unicode字符转换成汉字
    vStr:= fxDM.UnicodeToChinese('\u6211\u662F\u4E2D\u56FD\u4EBA');
    showmessage(vStr);
end;
1
2
3
4
5
6
7
  • 运行结果

我是中国人

# 2. TfxFun类函数

  如要使用以下函数,请引用ufxFuntions单元。

# 2.1. Base64Get

function Base64Get(FileName:String):String
1

说明: 读出文件内容转码为base64字符串

返回值: 字符串String类型

  • Base64Get函数语法中各部分说明
部分 说明
FileName 指定一个需要转码的文件路径
  • 示例
Var
    V:string;
Begin
    V := PaxFunc.Base64Get(FThis,'c:\\123.bmp');
end;
1
2
3
4
5

# 2.2. ByteToHex

function ByteToHex(Src: Byte): String;
1

说明: 字节转16进制

返回值: 字符串String类型


# 2.3. CalCRC16

function CalCRC16(AData: array of Byte; AStart, AEnd: Integer): Word;
1

说明: 字节数组计算CRC校验和

返回值: 无符号整型


# 2.4. CreateStringStream

function CreateStringStream(Encoding:String='UTF8'):TStringStream;
1

说明: 指定编码类型创建字符串流 返回值: TStringStream 字符串流

  • CreateStringStream函数语法中各部分说明
部分 说明
Encoding 编码类型
  • 示例
Procedure fxIdHTTPServer1OnCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
  aRequestContent: string;
  reqstream:TStringStream;
  APathInfo :String;
begin
    AResponseInfo.CustomHeaders.Add('Access-Control-Allow-Origin:*');
    AResponseInfo.CustomHeaders.Add('Access-Control-Allow-Headers:*');
    AResponseInfo.CustomHeaders.Add('Access-Control-Allow-Method:*');
    AResponseInfo.ContentType := 'application/json;charset=utf-8'; //解决 AResponseInfo 返回中文乱码问题

  APathInfo := ARequestInfo.Document;
  if ARequestInfo.Command.ToLower = ('POST').ToLower then
  begin
    if APathInfo = '/api/dvrs' then
    begin
      if (ARequestInfo.PostStream <> nil) and (ARequestInfo.PostStream.Size > 0) then
      begin
        ARequestInfo.PostStream.Position := 0;
        //创建UTF8编码的字符串流
        reqstream:=paxfunc.CreateStringStream('UTF8');
        try
         ARequestInfo.PostStream.Position := 0;
         reqstream.LoadFromStream(ARequestInfo.PostStream);
         aRequestContent := reqstream.DataString;
         fxMemo1.Lines.Insert(0, FormatDateTime('HH:NN:SS.ZZZ ', now) + '/api/dvrs->' + aRequestContent);
        finally
          reqstream.Free;
        end;

       AResponseInfo.ContentText := aRequestContent; //成功 响应201
       AResponseInfo.WriteContent;
      end;
    end;
  end;
end;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

# 2.5. GetFirstDayofMonth

function GetFirstDayofMonth(const DT: TDateTime): TDateTime;
1

说明: 获取指定日期所在月份的第一天

返回值: 日期TDateTime类型

  • GetFirstDayofMonth函数语法中各部分说明
部分 说明
DT 指定的一个日期类型
  • 示例
Var
    vMonthFirstDay:TDateTime;
Begin
    vFirstEndDay := fxFun.GetFirstDayofMonth(‘2019-07-10’);
end;
1
2
3
4
5
  • 运行结果:

2019-07-01


# 2.6. GetLastDayofMonth

function GetLastDayofMonth(const DT: TDateTime): TDateTime;
1

说明: 获取指定日期所在月份的第后一天

返回值: 日期TDateTime类型

  • GetLastDayofMonth函数语法中各部分说明
部分 说明
DT 指定的一个日期类型
  • 示例
Var
    vMonthEndDay:TDateTime;
Begin
    vMonthEndDay := fxFun.GetFirstDayofMonth(‘2019-07-10’);
end;
1
2
3
4
5
  • 运行结果:

2019-07-31


# 2.7. GetPropValue

function GetPropValue(QControl:TComponent; QControlProp: string): Variant;
1

说明: 获取控件属性值

返回值: 变体Variant 类型

  • GetPropValue函数语法中各部分说明
部分 说明
QControl 需要获取属性的控件
QControlProp 控件属性名称

示例

var
    vPropValue:variant;
begin
    //获取窗体fxButton1对象的Name名称
    vPropValue := fxFun.GetPropValue(fxButton1,'Name');
    Showmessage(vPropValue);
end;
1
2
3
4
5
6
7

# 2.8. GetAlarmsPath

function GetAlarmsPath:String;
1

说明:

返回值: 字符串String类型


# 2.9. GetCachePath

function GetCachePath: string;
1

说明: 获取缓存目录

返回值: 字符串String类型


# 2.10. GetCameraPath

function GetCameraPath:String;
1

说明: 获取相片目录

返回值: 字符串String类型


# 2.11. GetDocumentsPath

function GetDocumentsPath: string;
1

说明: 获取文档目录

返回值: 字符串String类型


# 2.12. GetDownloadsPath

function GetDownloadsPath:String;
1

说明: 获取下载目录

返回值: 字符串String类型


# 2.13. GetHomePath

function GetHomePath: string;
1

说明: 获取用户程序数据目录

返回值: 字符串String类型


# 2.14. GetLibraryPath

function GetLibraryPath: string;
1

说明: 获取库文件目录

返回值: 字符串String类型


# 2.15. GetMoviesPath

function GetMoviesPath:String;
1

说明: 获取电影目录

返回值: 字符串String类型


# 2.16. GetMusicPath

function GetMusicPath:String;
1

说明: 获取音乐目录

返回值: 字符串String类型


# 2.17. GetNumber

function GetNumber(S: string):string;
1

说明: 截取字符串中的数字。

返回值: String字符类型。

  • GetNumber函数语法中各部分说明
部分 说明
S 指定一个包含数字的字符串
  • 示例
var
    v:string;
begin
    v:= fxFun.GetNumber(‘12A56B.A11’);
    //显示返回的SQL内容
    Showmessage(v);
end;
1
2
3
4
5
6
7
  • 运行结果:

125611


# 2.18. GetPicturesPath

function GetPicturesPath:String;
1

说明: 获取图片目录

返回值: 字符串String类型


# 2.19. GetPublicPath

function GetPublicPath: string;
1

说明: 获取公共目录

返回值: 字符串String类型


# 2.20. GetRingtonesPath

function GetRingtonesPath:String;
1

说明: 获取铃声目录

返回值: 字符串String类型


# 2.21. GetSharedAlarmsPath

function GetSharedAlarmsPath:String;
1

说明:

返回值: 字符串String类型


# 2.22. GetSharedCameraPath

function StreamToBase64(AStream:TStream):String;
1

说明: 获取共享的相机目录

返回值: 字符串String类型


# 2.23. GetSharedDocumentsPath

function GetSharedDocumentsPath:String;
1

说明: 获取共享文档目录

返回值: 字符串String类型


# 2.24. GetSharedMoviesPath

function GetSharedMoviesPath:String;
1

说明: 获取共享电影目录

返回值: 字符串String类型


# 2.25. GetSharedMusicPath

function GetSharedMusicPath:String;
1

说明: 获取共享音乐目录

返回值: 字符串String类型


# 2.26. GetSharedPicturesPath

function StreamToBase64(AStream:TStream):String;
1

说明: 获取共享图片目录

返回值: 字符串String类型


# 2.27. GetSharedRingtonesPath

function GetSharedRingtonesPath:String;
1

说明: 获取共享铃声目录

返回值: 字符串String类型


# 2.28. GetTempPath

function GetTempPath: string;
1

说明: 用于获取为临时文件指定的目录

返回值: 字符串String类型


# 2.29. HexCalCRC

function HexCalCRC(sHex:string):String;
1

说明: 计算16进制CRC校验和

返回值: 字符串String类型


# 2.30. IntToHex

function IntToHex(Const Value: Integer): string;
1

说明: 整数转16进制

返回值: 字符串String类型


# 2.31. NetHttpClientPost

function NetHttpClientPost(Qurl:string; QDataStrings:TStrings; QContentType:
    string): string;
1
2

说明: 提交Http请求

返回值: 字符string类型

  • NetHttpClientPost函数语法中各部分说明
部分 说明
Qurl Http 内容
QDataStrings 字符串列表
QContentType Http请求头 4种 application/json, application/xml multipart/form-data ,application/x-www-form-urlencoded
  • 示例
//飞印Flying Http打印
var
 v:string;
 vList: TStrings;
 ReportName,PrinterName:string;
begin
  ReportName  := 'AAAcustomer.fr3'; //报表名称 《客户基本信息》
  PrinterName := FThis.cbb_PrinterS.Text; //打印机名称
 vList := TStringList.Create;
 try
  vList.Clear;
  ///*必选。报表文件名*/
  vList.Values['ReportName'] := fxfun.URLEncode(ReportName); 
  ///*可选。报表版本, 为空则默认1  如果本地报表的版本过低 将从 ReportUrl 地址进行下载更新*/   
  vList.Values['ReportVersion'] := fxfun.URLEncode('1');       
  ///*可选。为空 将不更新本地报表 , 如果本地报表不存在可以从该地址自动下载*/
  vList.Values['ReportUrl'] := fxfun.URLEncode('http://192.168.1.100:8808/report/fastreport/'+ReportName);  
  ///*可选。打印份数,支持指定打印份数。默认1份,如果为零,不打印,只返回报表生成的pdf,jpg等文件*/ 
  vList.Values['Copies'] := fxfun.URLEncode('1');              
  ///*可选。指定打印机,为空的话 使用默认打印机, 请在 控制面板 -> 设备和打印机 中查看您的打印机的名称 */
  vList.Values['PrinterName'] := fxfun.URLEncode(PrinterName); 
  ///*可选。打印右偏移,单位厘米。报表的水平方向上的偏移量,向右为正,向左为负。*/
  vList.Values['PrintOffsetX'] := fxfun.URLEncode('0'); 
  ///*可选。打印下偏移,单位厘米。 报表的垂直方向上的偏移量,向下为正,向上为负。*/       
  vList.Values['PrintOffsetY'] := fxfun.URLEncode('0');   
  ///*可选。多个打印任务同时打印时,根据该id确定返回的是哪个打印任务。 */
  vList.Values['taskId'] := paxfunc.URLEncode('1234567');   
  ///*可选。只要token值在列表中 方可打印*/            
  vList.Values['token'] := fxfun.URLEncode('aa');   
  ///*可选。预览模式,不打印 */           
  vList.Values['Preview'] := fxfun.URLEncode('1');   
  ///*可选。输出文件格式,为空默认为 pdf,也可以指定 jpg,xls,csv,rtf,htm等*/          
  vList.Values['ExportFileType'] := fxfun.URLEncode('pdf');    
  ///*可选。是否发送邮件,1为发送,0为不发送,如果为F时*/
  vList.Values['SendEmail'] := fxfun.URLEncode('0');    
  ///*可选。邮件接收者,为邮箱内容,不指定则引用服务端的接收者邮箱*/      
  vList.Values['EMailTo'] := fxfun.URLEncode('example@yourdomain.com'); 
  ///*可选。邮件主题*/     
  vList.Values['EMailSubject'] := fxfun.URLEncode('客户基本信息清单'); 
  ///*可选。邮件正文*/
  vList.Values['EMailBody'] := fxfun.URLEncode('您好,请注意查阅。');  
  ///*字段行:type ftBlob (base64格式) ,ftString ftInteger ftBoolean, ftFloat, ftCurrency,ftDateTime,size (ftString 设置为实际长度,其他的设置为0,例如 ftInteger ftBlob 等设置为0 )
  vList.Values['AField'] := fxfun.URLEncode('[' 
		+'{"type": "ftString", "name": "CustomerID","size": 255,"required": true},'
		+'{"type": "ftString", "name": "CompanyName","size": 255,"required": false},'
		+'{"type": "ftString", "name": "ContactName","size": 255,"required": false},'
		+'{"type": "ftString", "name": "ContactTitle","size": 255,"required": false},'
		+'{"type": "ftString", "name": "Address","size": 255,"required": false},'
		+'{"type": "ftString", "name": "City","size": 255,"required": false},'
		+'{"type": "ftString", "name": "Region","size": 255,"required": false},'
		+'{"type": "ftString", "name": "PostalCode","size": 255,"required": false},'
		+'{"type": "ftString", "name": "Country","size": 255,"required": false},'
		+'{"type": "ftString", "name": "Phone","size": 255,"required": false},'
		+'{"type": "ftString", "name": "Fax","size": 255,"required": false},'
		+']');
  ///*数据行  
  vList.Values['AData'] := fxfun.URLEncode('['  
		+'{"CustomerID": "SDYQKJ", "CompanyName": "易桥科技", "ContactName": "高文杰", "ContactTitle": "经理", "Address": "商动力大厦", "City": "济宁", "Region": "华东", "PostalCode": "272100", "Country": "中国", "Phone": "13165191728", "Fax": "0537-2345660"},'
		+'{"CustomerID": "SEVES", "CompanyName": "艾德高科技", "ContactName": "谢小姐", "ContactTitle": "经理", "Address": "起义路 231 号", "City": "天津", "Region": "华北", "PostalCode": "013072", "Country": "中国", "Phone": "(030) 55657717", "Fax": ""},'
		+']');
 //发送打印请求,返回Json执行结果   
 v:= fxfun.NetHttpClientPost('http://192.168.1.100:8808/printreport',vList,'application/xml'); 
 FThis.Memo1.Lines.Add(fxfun.urlDecode(v));
 finally
 vList.Free;
 end;
end;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

# 2.32. NetHttpGet

function NetHttpGet(const Qurl: string; const QSource:string = ''): string;
1

说明: 获取Http请求

返回值: 字符string类型

  • NetHttpGet函数语法中各部分说明
部分 说明
Qurl Http URL地址
QSource 请求 Body主体的内容,如无内容可留空
  • 示例
var
    vValue:string;
begin
    //获取一个64位唯一ID
    vValue := fxFun.NetHttpGet('http://192.168.1.100:8809/system/newid','');
    Showmessage(vValue) ;
end;
1
2
3
4
5
6
7
  • 运行结果:

{"status":0,"message":"ok","id":82806688449335296}


# 2.33. NetHttpPost

function NetHttpPost(const Qurl: string; const QSource: string = ''; const QResponseContent: string = ''; const QContentType: string = ''; const QHeaders:TStringList = nil): string;
1

说明: 提交Http请求

返回值: 字符string类型

  • NetHttpPost函数语法中各部分说明
部分 说明
Qurl Http 内容
QSource 请求体内容
QResponseContent 响应的内容的格式类型
QContentType Http请求的内容类型 支持4种类型 application/json,application/xml, multipart/form-data,application/x-www-form-urlencoded
QHeaders Http请求头
  • 示例
var
    JsonObject:TJSONObject;
    vJson:String;
begin
    //通过Http请求,提交数据,JSon格式
    JsonObject := TJSONObject.Create
        .AddPair('customerName', 'XX科技有限公司')
        .AddPair('documentDate', '2019-07-30 00:00:00')
        .AddPair('documentNo', 'WUR20190730001')
        .AddPair('makerPeople', '小王')
        .AddPair('makerDate', '2019-07-30 23:01:01')
        .AddPair('materialCode', '01001')
        .AddPair('materialName', '牛津布')
        .AddPair('piece', '12')
        .AddPair('quantity','122' )
        .AddPair('remark', '备注1')
        .AddPair('status', '审核')
        .AddPair('specification', '180D')
        .AddPair('makerPeople', '小王')
        .AddPair('storehouse', 'A-12')
        .AddPair('unit', '米')
        .AddPair('warehouse', '白坯仓库');

    vJson:= '['+JsonObject.ToString+']';
    fxFun.NetHttpPost('http://127.0.1.1/printing/tofoProdUse/add',vJson ,
'application/json','application/json',nil);
End;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

# 2.34. NetHttpPut

function NetHttpPut(const Qurl: string; const QSource: string = ''; const QResponseContent: string = ''; const QContentType: string = ''; const QHeaders:TStringList = nil): string;
1

说明: 提交Http请求 返回值: 字符string类型

  • NetHttpPut函数语法中各部分说明
部分 说明
Qurl Http 内容
QSource 请求体内容
QResponseContent 响应的内容的格式类型
QContentType Http请求的内容类型 4种 application/json,application/xml, multipart/form-data,application/x-www-form-urlencoded
QHeaders Http请求头

# 2.35. NetHttpDelete

function NetHttpDelete(const Qurl: string; const QSource:string = ''): string;
1

说明 获取Http请求(Delete方法)。 返回值 字符string类型

  • NetHttpDelete函数语法中各部分说明
部分 说明
Qurl Http URL内容
QSource Http请求体的内容

# 2.36. GetJSONObject

function GetJSONObject(const QJSONObject: TJSONValue; const QPath:String):TJSONObject;
1

说明: 获取JSON对象中指定的嵌套对象。 返回值: TJSONObject类型。

  • GetJSONObject 函数语法中各部分说明
部分 说明
QJSONObject 要进行获取对象操作的JSON对象名称
QPath 对象在JSON中的路径名称,路径的名称之间以"."作为分隔标志
  • 示例

  假设需要对以下JSON进行解析。

{
    "status": "OK",
    "Language":{
        "DefaultLanguage": 1
    }
}
1
2
3
4
5
6
//PasScript
Var 
  J:TJSONObject;
  s: String;
begin
  //J:=TJSONObject.Create;
  s:= '{"status": "OK","Language":{"DefaultLanguage": 1}}';
  j := fxfun.GetJSONObject(fxfun.ParseJSONValue(s),'Language');
  ShowMessage(fxfun.GetJSONNumber(j,'DefaultLanguage'));
  //上述两句程序也可改写为
  //ShowMessage(fxfun.GetJSONNumber(j,'Language.DefaultLanguage'));
end;
1
2
3
4
5
6
7
8
9
10
11
12

  以上程序运行后获取到的值为1。

# 2.37. GetJSONArray

function GetJSONArray(const QJSONObject: TJSONValue; const QPath:String):TJSONArray;
1

说明: 获取JSON对象中指定的数组列。 返回值: TJSONArray类型。

  • GetJSONArray 函数语法中各部分说明
部分 说明
QJSONObject 要进行获取对象操作的JSON对象名称
QPath 对象在JSON中的路径名称,路径的名称之间以"."作为分隔标志
  • 示例

  假设需要对以下JSON进行解析。

{
    "status": "OK",
    "Language":{
        "DefaultLanguage": 1,
        "options":[
            {"options":1},
            {"options":2}
        ]
    }
}
1
2
3
4
5
6
7
8
9
10
//PasScript
Var 
  J:TJSONObject;
  A:TJSONArray;
  s: String;
begin
  s:= '{"status": "OK","Language":{"DefaultLanguage": 1,"options":[{"options":1},{"options":2}]}}';
  j := TJSONObject(fxfun.ParseJSONValue(s));
  A := fxfun.GetJSONArray(j,'Language.options');
  J := TJSONObject(A.Items[1]);
  ShowMessage(fxfun.GetJSONNumber(j,'options'));
end;
1
2
3
4
5
6
7
8
9
10
11
12

  以上程序运行后获取到的值为2。

# 2.38. GetJSONString

function GetJSONString(const QJSONObject: TJSONValue; const QPath:String):String;
1

说明: 获取JSON对象中指定键值的字符串。 返回值: String类型。

  • GetJSONString 函数语法中各部分说明
部分 说明
QJSONObject 要进行获取对象操作的JSON对象名称
QPath 对象在JSON中的路径名称,路径的名称之间以"."作为分隔标志

  假设需要对以下JSON进行解析。

{
    "status": "OK",
    "Language":{
        "DefaultLanguage": 1
    }
}
1
2
3
4
5
6
//PasScript
Var 
  J:TJSONObject;
  s: String;
begin
  s:= '{"status": "OK","Language":{"DefaultLanguage": 1}}';
  j := TJSONObject(fxfun.ParseJSONValue(s));
  ShowMessage(fxfun.GetJSONString(j,'status'));
end;
1
2
3
4
5
6
7
8
9

  以上程序运行后获取到的值为OK。

# 2.39. GetJSONNumber

function GetJSONNumber(const QJSONObject: TJSONValue; const QPath:String):String;
1

说明: 获取JSON对象中指定的键值中的数值。 返回值: String类型。

  • GetJSONNumber 函数语法中各部分说明
部分 说明
QJSONObject 要进行获取对象操作的JSON对象名称
QPath 对象在JSON中的路径名称,路径的名称之间以"."作为分隔标志
  • 示例

  假设需要对以下JSON进行解析。

{
    "status": "OK",
    "Language":{
        "DefaultLanguage": 1
    }
}
1
2
3
4
5
6
//PasScript
Var 
  J:TJSONObject;
  s: String;
begin
  s:= '{"status": "OK","Language":{"DefaultLanguage": 1}}';
  j := TJSONObject(fxfun.ParseJSONValue(s));
  j := fxfun.GetJSONObject(j,'Language');
  ShowMessage(fxfun.GetJSONNumber(j,'DefaultLanguage'));
  //上述两句程序也可改写为
  //ShowMessage(fxfun.GetJSONNumber(j,'Language.DefaultLanguage'));
end;
1
2
3
4
5
6
7
8
9
10
11
12

  以上程序运行后获取到的值为1。

# 2.40. GetJSONInteger

function GetJSONInteger(const QJSONObject: TJSONValue; const QPath:String):Integer;
1

说明: 获取JSON对象中指定的键值中的整数数值,并以整数的形式返回。 返回值: Integer类型。

  • GetJSONInteger 函数语法中各部分说明
部分 说明
QJSONObject 要进行获取对象操作的JSON对象名称
QPath 对象在JSON中的路径名称,路径的名称之间以"."作为分隔标志
  • 示例

  假设需要对以下JSON进行解析。

{
    "status": "OK",
    "Language":{
        "DefaultLanguage": 1
    }
}
1
2
3
4
5
6
//PasScript
Var 
  J:TJSONObject;
  s: String;
  i: Integer;
begin
  s:= '{"status": "OK","Language":{"DefaultLanguage": 1}}';
  j := TJSONObject(fxfun.ParseJSONValue(s));
  i := fxfun.GetJSONInteger(j,'Language.DefaultLanguage');
  ShowMessage(IntToStr(i));
end;
1
2
3
4
5
6
7
8
9
10
11

  以上程序运行后获取到的值为1。

# 2.41. GetJSONFloat

function GetJSONFloat(const QJSONObject: TJSONValue; const QPath:String):Double;
1

说明: 获取JSON对象中指定的键值中的浮点数数值,并以浮点数的形式返回。 返回值: Double类型。

  • GetJSONFloat 函数语法中各部分说明
部分 说明
QJSONObject 要进行获取对象操作的JSON对象名称
QPath 对象在JSON中的路径名称,路径的名称之间以"."作为分隔标志
  • 示例

  假设需要对以下JSON进行解析。

{
    "status": "OK",
    "Language":{
        "DefaultLanguage": 1.1
    }
}
1
2
3
4
5
6
//PasScript
Var 
  J:TJSONObject;
  s: String;
  i: Double;
begin
  s:= '{"status": "OK","Language":{"DefaultLanguage": 1.1}}';
  j := TJSONObject(fxfun.ParseJSONValue(s));
  i := fxfun.GetJSONFloat(j,'Language.DefaultLanguage');
  ShowMessage(FloatToStr(i));
end;
1
2
3
4
5
6
7
8
9
10
11

  以上程序运行后获取到的值为1.1。

# 2.42. GetJSONBool

function GetJSONBool(const QJSONObject: TJSONValue; const QPath:String):Boolean;
1

说明: 获取JSON对象中指定的键值中的布尔数值,并以布尔值的形式返回。 返回值: Boolean类型。

  • GetJSONBool 函数语法中各部分说明
部分 说明
QJSONObject 要进行获取对象操作的JSON对象名称
QPath 对象在JSON中的路径名称,路径的名称之间以"."作为分隔标志

  假设需要对以下JSON进行解析。

{
    "status": true,
    "Language":{
        "DefaultLanguage": 1
    }
}
1
2
3
4
5
6
//PasScript
Var 
  J:TJSONObject;
  s: String;
begin
  s:= '{"status": true,"Language":{"DefaultLanguage": 1}}';
  j := TJSONObject(fxfun.ParseJSONValue(s));
  if (fxfun.GetJSONBool(j,'status')) then
    ShowMessage('{"status": true}');
end;
1
2
3
4
5
6
7
8
9
10

  以上程序运行后获取到的值为{"status": true}。

# 2.43. GetJSONValue

function GetJSONValue(const QJSONObject: TJSONValue; const QPath:String):TJSONValue;
1

说明: 获取JSON对象中指定的键值中的值。 返回值: TJSONValue类型。

  • GetJSONBool 函数语法中各部分说明
部分 说明
QJSONObject 要进行获取对象操作的JSON对象名称
QPath 对象在JSON中的路径名称,路径的名称之间以"."作为分隔标志

# 2.44. JSONArray_AddJSONObject

function JSONArray_AddJSONObject(QJSONArray:TJSONArray;const QJSONObject: TJSONValue):TJSONArray;
1

说明: 在原有的JSON队列中添加一个新的JSON对象 返回值: TJSONArray类型。

  • GetJSONBool 函数语法中各部分说明
部分 说明
QJSONArray 要进行获取对象操作的JSON队列名称
QJSONObject 要添加的JSON对象名称

  假设有以下的队列:

[{"status":"ok"}]
1

  需要向其中添加以下的json对象:

{"status":"no"}
1
Var 
  J:TJSONValue;
  A:TJSONArray;
  s1,s2: String;
begin
  s1:= '[{"status":"ok"}]';
  s2:= '{"status":"no"}';
  A := fxfun.ParseJSONValue(s1);
  J := fxfun.ParseJSONValue(s2);
  A := fxfun.JSONArray_AddJSONObject(A,J);
  ShowMessage(A.ToString);
end;
1
2
3
4
5
6
7
8
9
10
11
12

  执行以上程序,输出的结果为 [{"status","ok"},{"status":"no"}]

# 2.45. JSONObject_AddJSONArray

function JSONObject_AddJSONArray(QJSONObject: TJSONObject; const Str: string; const Val: TJSONValue):TJSONObject;
1

说明: 在原有的JSON对象中添加一个新的JSON值以获取一个新的JSON对象 返回值: TJSONObject类型。

部分 说明
QJSONObject 要获取的JSON对象名称
Str 要添加的键名
Val 要添加的键值(json队列)

  假设有以下的json对象:

{"status":"ok"}
1

  需要合并以下的json队列作为子对象:

[{"status":"no"}]
1
Var 
  J1:TJSONObject;
  J2:TJSONObject;
  A: TJSONValue;
  s1,s2: String;
begin
  s1:= '{"status":"ok"}';
  s2:= '[{"status":"no"}]';
  J1 := TJSONObject(paxfunc.ParseJSONValue(s1));
  A := paxfunc.ParseJSONValue(s2);
  J2 := paxfunc.JSONObject_AddJSONArray(J1,'array',A);
  ShowMessage(J2.ToString);
end;
1
2
3
4
5
6
7
8
9
10
11
12
13

  执行以上程序,输出的结果为 [{"status","ok"},"array":[{"status":"no"}]}

# 2.46. JSONParse

function JSONParse(QType, QPath, QJson: string): string;
1

说明: 解析JSON,获取JSON中的单元的取值。 返回值: string类型。

部分 说明
QType 要获取的JSON对象类型 GetJSONObject,GetJSONArray,GetJSONNumber、GetJSONObject、GetJSONValue、GetJSONBool、GetJSONPair
QPath 获取的JSON对象的路径名称
QJSON 要解析的JSON对象文本
  • 示例
```JSON
{
    "status": true,
    "Language":{
        "DefaultLanguage": 1
    }
}
1
2
3
4
5
6
7
//PasScript
Var 
  s: String;
begin
  s:= '{"status": "OK","Language":{"DefaultLanguage": 1}}';
  ShowMessage(fxfun.JSONParse('GetJSONString','status',s));
end;
1
2
3
4
5
6
7

# 2.47. ParseJSONValue

function ParseJSONValue(QJson: string): TJSONValue;
1

说明: 获取字符串形式的JSON对象文本,转换为JSON对象。 返回值: TJSONValue类型。

  • GetJSONBool 函数语法中各部分说明
部分 说明
QJSONObject 要进行获取对象操作的JSON对象名称
QPath 对象在JSON中的路径名称,路径的名称之间以"."作为分隔标志

# 2.48. NextMonth

Function NextMonth(ADateTime: Variant): string;
1

说明: 获取指定日期下一个月第一天

返回值: 字符string类型

  • NextMonth函数语法中各部分说明
部分 说明
ADateTime 指定的一个变体类型
  • 示例
Var
    vNextMonth:String;
Begin
    vNextMonth:= fxFun.NextMonth (‘2019-07-10’);
end;
1
2
3
4
5
  • 运行结果:

2019-08-01


# 2.49. ParseJSONObject

function ParseJSONObject(QJsonStr:string):TJsonObject;
1

说明: 解析JSON对象

返回值: TJsonObject类型。

  • ParseJSONObject函数语法中各部分说明
部分 说明
QJsonStr Json格式字符串
  • 示例
var
    v:string;
    JSONObject: TJSONObject;
    LItem: TJSONValue;
    LJPair: TJSONPair;
    data: TJSONArray;
    StrJson: string;
    result: string;
    i: Integer;
begin
    v:=fxfun.NetHttpPost('http://'+fxEdit1.Text+':'+fxEdit2.Text+'/getprinterlist','','application/xml');

    {"taskId":"","status":"ok","data":[{"name":"OneNote"},{"name":"Microsoft XPS Document Writer"},{"name":"Microsoft Print to PDF"},{"name":"Fax"},{"name":"Brother DCP-7080D"},{"name":"7645(No Cut)"}]}
    StrJson := fxfun.urlDecode(v); //假定是上面那个json
    JSONObject := fxfun.ParseJSONObject(StrJson);
    data:= JSONObject.GetValue('data') as TJSONArray;
    for i := 0 to data.size - 1 do
    begin
        LItem := TJSONObject(data.Get(i)).GetValue('name');
        Showmessage(Litem.Value);
    end;
end;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

# 2.50. PrintBitmap

function PrintBitmap(Bitmap: TBitmap; const JobName: string): Boolean;
1

说明: 通过网络打印机打印图片

返回值: 布尔Boolean类型

  • 示例:
fxfun.PrintBitmap(fximage1.Bitmap,'aaa');
1

# 2.51. RoundToCH

function RoundToCH(const AValue: Double; const ADigit: Integer): Double;
1

说明: 四舍五入函数

返回值: 双精度Double类型

  • 函数语法中各部分说明
部分 说明
AValue 指定一个Double类型的数值
ADigit 指定一个小数点保留位数
  • 示例
Var
    vValue: Double;
Begin
    vValue:= fxFun.RoundToCH (12.357,2);
end;
1
2
3
4
5
  • 运行结果:

12.36


# 2.52. SendArticleMessage

function SendArticleMessage(const AccountName, AOpenID: string; AContent:
    String): Boolean;
1
2

说明: 发送图文信息

返回值: 布尔Boolean类型

  • SendArticleMessage函数语法中各部分说明
部分 说明
AccountName 微信公众号
AOpenID 微信用户AOpenID,OpenID为微信用户唯一标识ID
AContent 微信消息内容
  • 示例
var
    j: TJSONObject;
    WechatArticle:TWechatArticle;
    i:integer;
begin
    //组装JSON
    j := TJSONObject.Create;
    j.Addpair('title', '爱招飞是什么?');
    j.AddPair('description', '爱招飞是信息化与物联网整合专家。');
    j.AddPair('URL', 'https://www.isoface.cn');
    j.AddPair('picurl',
    'http://ppic.meituba.com/uploads/allimg/2019/04/15/92_9257.jpg');

    //发送模板消息
    if fxfun.SendArticleMessage('测试号','oTpfe0VB-9vClZ4uSpTD05XbBNyI',j.ToJson)
    Then
        showmessage('发送成功!');
    j.free;
End;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# 2.53. SendCustomMessage

function SendCustomMessage(const AccountName, AOpenID, AContent: string):
    Boolean;
1
2

说明: 发送文本消息

返回值: 布尔Boolean类型

  • SendCustomMessage函数语法中各部分说明
部分 说明
AccountName 微信公众号
AOpenID 微信用户AOpenID,OpenID为微信用户唯一标识ID
AContent 微信消息内容
  • 示例
Begin

    if fxFun.SendCustomMessage
    ('测试号','oTpfe0VB-9vClZ4uSpTD05XbBNyI','这是由PInToo发出的一条消息!') Then
    showmessage('发送成功!');
End;
1
2
3
4
5
6

# 2.54. SendTemplateMessage

function SendTemplateMessage(const AccountName, AJsonContent: string):
    Boolean;
1
2

说明: 发送模板消息

返回值: 布尔Boolean类型

  • SendTemplateMessage函数语法中各部分说明
部分 说明
AccountName 微信公众号
AJsonContent Json格式化字符串
  • 示例
var
    JsonObject:TJSONObject;
Begin

    //组装JSON
    JsonObject := TJSONObject.Create
    .AddPair4('touser', 'oTpfe0VB-9vClZ4uSpTD05XbBNyI')
    .AddPair4('template_id', 'vX0v1WgEMjUwRhv8EsdeD1diwXm1CRZ5v5bty7hHHMs')
    .AddPair4('url', 'www.isoface.cn')
    .AddPair4('topcolor', '#FF0000')
    .AddPair3('data', TJSONObject.Create
        .AddPair3('Caption', TJSONObject.Create
            .AddPair4('value', '这是由PInToo发出的一条消息!')
            .AddPair4('color', '#173177')
    )
);

    //发送模板消息
    fxfun.SendTemplateMessage('测试号', JsonObject.ToJson);
    JsonObject.free;
End;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# 2.55. SendWechatMsg

function SendWechatMsg(const AccountName, AOpenID, ATemplateID, AContent:
    string): Boolean;
1
2

说明: 发送模板消息

返回值: 布尔Boolean类型

  • SendWechatMsg函数语法中各部分说明
部分 说明
AccountName 微信公众号
AOpenID 微信用户AOpenID,OpenID为微信用户唯一标识ID
ATemplateID 微信消息模板ID
AContent 微信消息内容
  • 示例
Begin

    if fxFun.SendWechatMsg('测试号','oTpfe0VB-9vClZ4uSpTD05XbBNyI',
    'vX0v1WgEMjUwRhv8EsdeD1diwXm1CRZ5v5bty7hHHMs','这是由PInToo发出的一条消息!')
    Then
        showmessage('发送成功!');
End;
1
2
3
4
5
6
7

# 2.56. StrToHex

function StrToHex(Src:string):String;
1

说明: 字符转16进制

返回值: 字符串String类型


# 2.57. StreamToBase64

function StreamToBase64(AStream:TStream):String;
1

说明: 流转base64字符串

返回值: 字符串String类型

  • Base64Get函数语法中各部分说明
部分 说明
AStream 指定一个流类型对象
  • 示例
Var
    AStream:TMemoryStream;
begin
    AStream:=TMemoryStream.Create;
    AStream.Position := 0;
    fximage1.Bitmap.SaveToStream(AStream);
    aBase64String := fxfun.StreamToBase64(AStream);
    AStream.Free;
end;

1
2
3
4
5
6
7
8
9
10

# 2.58. SystemSupportsPrint

function SystemSupportsPrint: Boolean;
1

说明: 判断系统是否支持打印

返回值: 布尔Boolean类型

  • 示例:
if SystemSupportsPrint then
   Showmessage('设备系统支持打印功能!');
1
2

# 2.59. UrlDecode

function UrlDecode(url: string): string;
1

说明: Decode解码

返回值: 字符串String类型

  • UrlDecode函数语法中各部分说明
部分 说明
url 指定一个需要解码的字符串
  • 示例
Var
    V:string;
Begin
    V:= fxfun.URLEncode('
    %E5%AE%A2%E6%88%B7%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF%E6%B8%85%E5%8D%95');
end;
1
2
3
4
5
6
  • 运行结果:

客户基本信息清单


# 2.60. UrlEncode

function UrlEncode(const msg: String): String;
1

说明: Encode编码

返回值: 字符串String类型

  • UrlEncode函数语法中各部分说明
部分 说明
msg 指定一个需要编码的字符串
  • 示例
Begin
	fxfun.URLEncode('客户基本信息清单'); 
end;
1
2
3
  • 运行结果:

%E5%AE%A2%E6%88%B7%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF%E6%B8%85%E5%8D%95


系统程序
自定程序

← 系统程序 自定程序→

Copyright © 2021-2025 爱招飞IsoFace | ALL Rights Reserved
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式