unigui图形验证码
unigui图形验证码
procedure TMainForm.UniButton1Click(Sender: TObject); var url: SockString; serial: TynSerial; i: Integer; ms: TMemoryStream; begin serial := TynSerial.Create; ms := TMemoryStream.Create; try url := 'verifycode'; i := FHttp.Post(url, '', 'text/plain; charset=UTF-8'); if i = 200 then begin serial.Text := FHttp.Content; UniEdit1.Text := serial.ReadString('code'); serial.ReadStream('image', ms); ms.Position := 0; UniImage1.LoadFromStream(ms); end else ShowMessage(i.ToString + ' error'); finally serial.Free; ms.Free; end; end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/10884619.html