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 stringgrid 实例3: 本例功能: 1、修改 tstringgrid的默认宽与高; 2、添加行; 3、确认当前单元并赋值.

Delphi tstringdynarray 使用,分割字符串

Delphi 调用外部程序并等待其运行结束

Delphi webbrowser getelementbyid().innerhtml与getelementbyid().value的区别

Delphi入门语法

Delphi的tstreamreader逐行读取文本文件

Delphi fmx 把内容复制到粘贴板上支持跨平台

Delphi有关asqlite控件支持中文路径的解决方案

Delphi使用spcomm实现串口通信 基础知识

Delphi unigui unicheckbox勾选

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



打赏

取消

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

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

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

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

评论

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