愛招飛幫助手冊 愛招飛幫助手冊
  • FastERP-1
  • Smart
  • PinToo
  • FastWeb
  • FastERP-2 企業管理系統 (opens new window)
  • 印染業ERP (opens new window)
  • 工廠終端機 (opens new window)
  • TARS
  • MARS
  • TaskRunner
  • Flying
  • FastDesk
  • HiDesk
  • HiNAT
  • FastBPM
  • 設備故障診斷 (opens new window)
  • 設備最佳運轉效益 (opens new window)
  • 企業智能助手SmeGPT (opens new window)
  • 燈號管理 (opens new window)
  • 戰情室 (opens new window)
  • 能源管理 (opens new window)
  • 人車定位 (opens new window)
  • 戰情指揮系統 (opens new window)
  • FastERP-1
  • FastWeb
  • Smart
  • PinToo
  • Flying
  • TARS
  • 通用功能

    • Report
    • Script
    • Echarts
    • Chart
    • DB Install
  • FastERP-1
  • Smart
  • PinToo
  • FastWeb
  • FastERP-2 企業管理系統 (opens new window)
  • 印染業ERP (opens new window)
  • 工廠終端機 (opens new window)
  • TARS
  • MARS
  • TaskRunner
  • Flying
  • FastDesk
  • HiDesk
  • HiNAT
  • FastBPM
  • 設備故障診斷 (opens new window)
  • 設備最佳運轉效益 (opens new window)
  • 企業智能助手SmeGPT (opens new window)
  • 燈號管理 (opens new window)
  • 戰情室 (opens new window)
  • 能源管理 (opens new window)
  • 人車定位 (opens new window)
  • 戰情指揮系統 (opens new window)
  • FastERP-1
  • FastWeb
  • Smart
  • PinToo
  • Flying
  • TARS
  • 通用功能

    • Report
    • Script
    • Echarts
    • Chart
    • DB Install
  • 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://isoface.net');
    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', 'isoface.net')
    .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
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式