我想打开一个文件,如,*.db,然后文件名不变,转存成*.xls即Excel文件!就该怎么做?
解决方案 »
- Iocomp TiStripChart画曲线问题
- 调查一下这里有多少Delphi程序员上“Delphi K.Top討論區”
- Tchart控件的一些问题,请各位指点,谢了,完成结分
- 急!请问如何把一个数组保存到数据库中的一个Blob字段中,又如何取出? ?
- 请问如何将一段unicode编码转成一段二进制编码. 求实例! 急!
- 如何将数据库的数据转换成*.doc文件?
- 一个看上去很简单的问题,但我得到的回答都不正确(13个)
- 三层构架中 AS 端如何主动发送信息到 Client 端
- 请问: Delphi中有在整个硬盘中查找指定文件或者目录的函数吗?不会又要递归搜索吧?!
- 都说会者不难,难者不会呀,本人有一个问题是QuickRort方面的,请各位仁兄指点一二
- 要SOCKET点对点传送的原文件吗?
- 本机没有flash.ocx也能正常运行用到了Shockwaveflash控件的flash播放器吗?
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;