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双进程监控

Delphi中把执行文件内存中的dll的代码全部保存下来

Delphi实现解析百度搜索结果link?url=

Delphi结合winrar生成自解压文件

Delphi now 返回当前日期及时间

Delphi idhttp post 普通提交乱码处理

Delphi webbrowser1去边框

Delphi日期函数、日期加减

Delphi 删除任意文件的任意位置的任意数量的字符

Delphi简单加密解密

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



打赏

取消

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

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

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

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

评论

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