在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
问题来源: http://www.cnblogs.com/del/archive/2009/03/09/1284244.html#1472084 {函数} function ReadFileToHex(FileName: string): string; var b: Byte; begin Result := ''; if not FileExists(FileName) then Exit; with TMemoryStream.Create do begin LoadFromFile(FileName); Position := 0; while Position < Size do begin ReadBuffer(b, 1); Result := Result + Format('%.2x ', [b]); end; Trim(Result); Free; end; end; {调用} procedure TForm1.Button1Click(Sender: TObject); var str: string; begin str := ReadFileToHex('c:\temp\test.txt'); ShowMessage(str); end; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论