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;

相关阅读 >>

idftp tencoding and iidtextencoding

Delphi android使用idhttp.get抓取https(ssl)文件

Delphi显示 jpg、png、gif 图片及 gif 动画

Delphi 判断字符串是否为纯字母组合

Delphi中判断某个文件是否已经打开

Delphi 动态添加资源文件

Delphi webbrowser的关于流载入流保存和流生成

Delphi spy++ 拖拽功能

Delphi 设置系统静音取消系统静音

Delphi 显示选择文件夹对话框 (有新建按钮)

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



打赏

取消

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

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

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

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

评论

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