請問,怎樣創建一個文件夾?
例如:我要創建E:\data\data.txt, 也就是說我要在E:創建一個Data\的文件夾, 然後創建一個data.txt的文件, 多謝了!!!
例如:我要創建E:\data\data.txt, 也就是說我要在E:創建一個Data\的文件夾, 然後創建一個data.txt的文件, 多謝了!!!
解决方案 »
- 关于dll 动态调用
- advstringgrid的数据怎么居中显示?
- 关于IBTable的filter的小用法,急,在线等
- 请问vc编的DLL的函数参数中有指针的应该如何调用,谢谢
- 这个sql怎么写??
- 帮忙看看WORD2002或者WORD97的工具一拦中是不是有个合并列印功能,WORD2000没有这功能
- 请教斑竹——关于DELPHI 的图形处理——急急急急急急
- 数据库 类 的问题
- 为什么Application.CreateForm(Tmilk_main, milk_main)不能建立一个milk_mainp窗体?
- 请问怎样终止一个子进程!TerminateProcess()不行
- 请教打开一个报表文件
- 读不到串口数据?
filecreate('E:\data\data.txt');
GENERIC_READ or GENERIC_WRITE,
0,
nil,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
0);
GENERIC_READ or GENERIC_WRITE,
0,
nil,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
0);
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