delphi BytesToFile


本文整理自网络,侵删。

 
procedure BytesToFile(bData:TByteArray; sPath:string);
var
hFile:    THandle;
dWritten: DWORD;
begin
  hFile := CreateFile(PChar(sPath), GENERIC_WRITE, FILE_SHARE_WRITE, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
  if hFile <> 0 then
  begin
    SetFilePointer(hFile, 0, nil, FILE_BEGIN);
    WriteFile(hFile, bData[0],Length(bData), dWritten, nil);
    CloseHandle(hFile);
  end;
end;

相关阅读 >>

Delphi一个非常完整的取windows os 版本信息的函数

fmsoft_unigui个文件说明

Delphi 打包文件到apk安装包中

Delphi根据输入日期按年月周日输出日期段

Delphi 实现延时自动关闭对话框

Delphi 读取png base64编码文件生成图片

老外写的在桌面添加快捷方式(Delphi xe5 android)

Delphi listview基本用法大全

Delphi webbrowser 使滚动条滚动到底部

Delphi 使用 lockbox 做加密解密

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...