一、string转为ansistring 二、ansistring 转为string 1、直接赋值 (有警告) 三、string 转为Tbytes 1、bytes:= bytesof(str) 已转为ansi编码 四、ansistring 转为Tbytes 1、bytes:= bytesof(str) ansi编码 五、Tbytes 转为string 1、 str:=stringof(bytes) Tbytes 为ansi编码 六、PChar转String 用StrPas函数,StrPas(PChar):AnsiString;
//SMS if IsPhoen(edtTEL.Text) then begin SysconfigRun; if Sysconfig.ReadBool('SMS','AddingSend',False) then begin if Sysconfig.ReadInteger('SMS','AddingMode',0) = 0 then begin if MessageBox(Handle, PChar('是否发送短信? '), PChar('短信'), MB_ICONINFORMATION or MB_YESNO or MB_DEFBUTTON1) = IDYES then begin goto GoToS; end; end else begin GoToS : Params := TStringList.Create; IDHTTP1 := TIdHTTP.Create(nil); reg := TPerlRegEx.Create; Params.Add('ac='+trim(Sysconfig.ReadString('SMS','SMSA',''))); Params.Add('authkey='+trim(Sysconfig.ReadString('SMS','SMSP',''))); Params.Add('m='+trim(edtTEL.Text)); Params.Add('action=sendOnce'); Params.Add('cgid='+trim(Sysconfig.ReadString('SMS','CGID',''))); Params.Add('csid='+trim(Sysconfig.ReadString('SMS','CSID',''))); Params.Add('c='+Utf8ToAnsi(UTF8Encode(Matching(edtTID.Text,edtUserName.Text,edt2.Text,trim(Sysconfig.ReadString('SMS','AddingInfo',DateTimeToStr(Now))))))); if Sysconfig.ReadString('SMS','AddingInfo','') <> '' then begin WriteLog(IDHTTP1.Post('http://smsapi.c123.cn/OpenPlatform/OpenApi', Params)); end; FreeAndNil(IDHTTP1); FreeAndNil(Params); FreeAndNil(reg); end; end; Sysconfig.Destroy; end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论