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 base64加解密

Delphi 用sql语句添加删除修改字段

Delphi systemparametersinfo 用法

Delphi 控制台读写

Delphi tdatetime 日期时间值的比较

Delphi实现qq右下角弹出信息窗口

Delphi判断文件夹(目录)是否存在,不存在就创建的办法

Delphi添加任务栏右键菜单

Delphi处理http请求自定义header

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



打赏

取消

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

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

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

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

评论

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