请教 fileread 函数的用法

abai 2003-06-03 01:14:26
fileread 函数该怎么样用,最好能举个例子?
特别是关于该函数的参数 Buffer,该如何定义!
...全文
102 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jjpan 2003-06-03
  • 打赏
  • 举报
回复
procedure TForm1.Button1Click(Sender: TObject);
var
szBuffer: array[0..10] of char;
sPascal: string;
i: longint;
hInput, hOutput: THandle;
begin
hInput := FileOpen('d:\temp\temp5\AAA.txt', 0);
hOutput := FileCreate('d:\temp\temp5\BBB.txt');
i := FileRead(hInput, szBuffer, 10);
sPascal := '1234567890';
StrPCopy(szBuffer, sPascal);
i := FileWrite(hOutput, szBuffer, 10);
FileClose(hInput);
FileClose(hOutput);
end;
参考
abai 2003-06-03
  • 打赏
  • 举报
回复
up

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧