本文整理自网络,侵删。
台湾最近银行与第三方支付、行动支付发展越来越快,而Delphi使用indy元件时,如果处理SSL网站时不是很容易。后来找到了ipwork的元件还不错用。列一下关键的程式ipwhttp1 := Tipwhttp.Create(Application);ipwhttp1.Config('CodePage=65001');posturl:=posturl+'barcode='+sBarcode;ipwhttp1.Post(sPaymentURL+'?'+posturl);result:=UTF8ToString(ipwhttp1.TransferredData);ipwhttp1.free;另外处理像SHA/AES等加解密也很方便
function GetTokenKey(s:String):String;var ipcHash1: TipcHash;beginipcHash1 := TipcHash.Create(Application);ipcHash1.Reset();ipcHash1.Algorithm := TipcHashAlgorithms(haSHA256);ipcHash1.InputMessage := s;ipcHash1.ComputeHash();result :=lowercase(ipcHash1.HashValue);ipcHash1.Free;end;
来源:http://superlevin.ifengyuan.tw/delphi-%E9%80%A3%E6%8E%A5-ssl-tls-1-2-%E7%AC%AC%E4%B8%89%E6%96%B9%E6%94%AF%E4%BB%98%E9%87%91%E6%B5%81%E5%95%8F%E9%A1%8C/
相关阅读 >>
Delphi xe10 文件目录/路径操作 (andorid、ios、windows)
Delphi+access错误"不正常地定义参数对象。提供了不一致或不完整的信息。"
更多相关阅读请进入《Delphi》频道 >>