请问FileWrite函数的具体用途?它可以指定文件的大小吗?
如:FileWrite(fData,wrBuf,sizeof(wrBuf));
它的具体含义?FileWrite函数写的数据是直接写到磁盘还是写到一个缓冲中??
如:FileWrite(fData,wrBuf,sizeof(wrBuf));
它的具体含义?FileWrite函数写的数据是直接写到磁盘还是写到一个缓冲中??
解决方案 »
- 再问一个面试关于TREEVIEW的题目(delphi)
- delphi2006中为何小数0.23只显示.23
- 哪里有免注册的共享软件加密算法库 V3.22 ?
- 使用ADO中的事务往SQLSERVER中插入数据时,为什么只有最后一行提交了(再线等待)
- 帮我看看'Select * from mail Where Muser="'+curuser+'...这句话错到哪呢?
- 如何判断一个文件被打开了,然后把它关闭。谢了
- 有个问题大家讨论一下吧!!!
- ADO--SQL语言出错?
- sender是什么东西?
- 我今天活见鬼了今天却遇到了这样的问题
- 新学期开数据库,请说一下几中主流的数据库语言的特点,优点,并能推荐一种
- 怎样才能得到局域网络中的计算名?
var
BackupName: string;
FileHandle: Integer;
StringLen: Integer;
X: Integer;
Y: Integer;
begin
if SaveDialog1.Execute then
begin
if FileExists(SaveDialog1.FileName) then
begin
BackupName := ExtractFileName(SaveDialog1.FileName);
BackupName := ChangeFileExt(BackupName, '.BAK');
if not RenameFile(SaveDialog1.FileName, BackupName) then raise Exception.Create('Unable to create backup file.');
end;
FileHandle := FileCreate(SaveDialog1.FileName);
{ Write out the number of rows and columns in the grid. }
FileWrite(FileHandle,
StringGrid1.ColCount, SizeOf(StringGrid1.ColCount));
FileWrite(FileHandle,
StringGrid1.RowCount, SizeOf(StringGrid1.RowCount));
for X := 0 to StringGrid1.ColCount ?1 do
begin for Y := 0 to StringGrid1.RowCount ?1 do
begin
{ Write out the length of each string, followed by the string itself. }
StringLen := Length(StringGrid1.Cells[X,Y]);
FileWrite(FileHandle, StringLen, SizeOf(StringLen));
FileWrite(FileHandle,
StringGrid1.Cells[X,Y], Length(StringGrid1.Cells[X,Y]);
end;
end;
FileClose(FileHandle);
end;end;