请各位指教!在下先谢了...
5 个解决方案
#1
把文件拷贝是最简单的方法吧
没用过Parodox,不知道有没有backup database的命令
没用过Parodox,不知道有没有backup database的命令
#2
CopyFile()就可以实现,如果要Copy目录就麻烦一点。
#3
我好像看过那里是API函数。。。
#4
procedure TFExport.SendToDisk;
var
FromFile : String;
ToFile : String;
SearchRec : TSearchRec;
SHFileOpStruct: TSHFileOpStruct;
FromDir: PChar;
ToDir: PChar;
begin
FromFile := DefaultDir + '数据\' + FileName + '.mds';
ToFile := 'A:\' + FileName + '.mds';
if FindFirst(FromFile, faAnyfile,SearchRec) = 0 then
begin
GetMem(FromDir, Length(FromFile)+2);
try
GetMem(ToDir, Length(ToFile)+2);
try
FillChar(FromDir^, Length(FromFile)+2, 0);
FillChar(ToDir^, Length(ToFile)+2, 0);
StrCopy(FromDir, PChar(FromFile));
StrCopy(ToDir, PChar(ToFile));
with SHFileOpStruct do
begin
Wnd := Handle; // Assign the window handle
wFunc := FO_COPY; // Specify a file copy
pFrom := FromDir;
pTo := ToDir;
fFlags := 0;
fAnyOperationsAborted := true;
hNameMappings := nil;
lpszProgressTitle := nil;
if SHFileOperation(SHFileOpStruct) <> 0 then
RaiseLastWin32Error;
end;
finally
FreeMem(ToDir, Length(ToFile)+2);
end;
finally
FreeMem(FromDir, Length(FromFile)+2);
end;
end else
begin
Application.MessageBox(pchar('无法定位数据文件!'),pchar('注意'),mb_ok);
Abort;
end;
end;
把硬盘上的文件/目录拷贝到软盘的程序
var
FromFile : String;
ToFile : String;
SearchRec : TSearchRec;
SHFileOpStruct: TSHFileOpStruct;
FromDir: PChar;
ToDir: PChar;
begin
FromFile := DefaultDir + '数据\' + FileName + '.mds';
ToFile := 'A:\' + FileName + '.mds';
if FindFirst(FromFile, faAnyfile,SearchRec) = 0 then
begin
GetMem(FromDir, Length(FromFile)+2);
try
GetMem(ToDir, Length(ToFile)+2);
try
FillChar(FromDir^, Length(FromFile)+2, 0);
FillChar(ToDir^, Length(ToFile)+2, 0);
StrCopy(FromDir, PChar(FromFile));
StrCopy(ToDir, PChar(ToFile));
with SHFileOpStruct do
begin
Wnd := Handle; // Assign the window handle
wFunc := FO_COPY; // Specify a file copy
pFrom := FromDir;
pTo := ToDir;
fFlags := 0;
fAnyOperationsAborted := true;
hNameMappings := nil;
lpszProgressTitle := nil;
if SHFileOperation(SHFileOpStruct) <> 0 then
RaiseLastWin32Error;
end;
finally
FreeMem(ToDir, Length(ToFile)+2);
end;
finally
FreeMem(FromDir, Length(FromFile)+2);
end;
end else
begin
Application.MessageBox(pchar('无法定位数据文件!'),pchar('注意'),mb_ok);
Abort;
end;
end;
把硬盘上的文件/目录拷贝到软盘的程序
#5
谢谢COBI(我是小新),不过这个程序我得研究一下。。。如果有注释,我想是最好的。。。不过说什么我都要非常感谢你。。。
#1
把文件拷贝是最简单的方法吧
没用过Parodox,不知道有没有backup database的命令
没用过Parodox,不知道有没有backup database的命令
#2
CopyFile()就可以实现,如果要Copy目录就麻烦一点。
#3
我好像看过那里是API函数。。。
#4
procedure TFExport.SendToDisk;
var
FromFile : String;
ToFile : String;
SearchRec : TSearchRec;
SHFileOpStruct: TSHFileOpStruct;
FromDir: PChar;
ToDir: PChar;
begin
FromFile := DefaultDir + '数据\' + FileName + '.mds';
ToFile := 'A:\' + FileName + '.mds';
if FindFirst(FromFile, faAnyfile,SearchRec) = 0 then
begin
GetMem(FromDir, Length(FromFile)+2);
try
GetMem(ToDir, Length(ToFile)+2);
try
FillChar(FromDir^, Length(FromFile)+2, 0);
FillChar(ToDir^, Length(ToFile)+2, 0);
StrCopy(FromDir, PChar(FromFile));
StrCopy(ToDir, PChar(ToFile));
with SHFileOpStruct do
begin
Wnd := Handle; // Assign the window handle
wFunc := FO_COPY; // Specify a file copy
pFrom := FromDir;
pTo := ToDir;
fFlags := 0;
fAnyOperationsAborted := true;
hNameMappings := nil;
lpszProgressTitle := nil;
if SHFileOperation(SHFileOpStruct) <> 0 then
RaiseLastWin32Error;
end;
finally
FreeMem(ToDir, Length(ToFile)+2);
end;
finally
FreeMem(FromDir, Length(FromFile)+2);
end;
end else
begin
Application.MessageBox(pchar('无法定位数据文件!'),pchar('注意'),mb_ok);
Abort;
end;
end;
把硬盘上的文件/目录拷贝到软盘的程序
var
FromFile : String;
ToFile : String;
SearchRec : TSearchRec;
SHFileOpStruct: TSHFileOpStruct;
FromDir: PChar;
ToDir: PChar;
begin
FromFile := DefaultDir + '数据\' + FileName + '.mds';
ToFile := 'A:\' + FileName + '.mds';
if FindFirst(FromFile, faAnyfile,SearchRec) = 0 then
begin
GetMem(FromDir, Length(FromFile)+2);
try
GetMem(ToDir, Length(ToFile)+2);
try
FillChar(FromDir^, Length(FromFile)+2, 0);
FillChar(ToDir^, Length(ToFile)+2, 0);
StrCopy(FromDir, PChar(FromFile));
StrCopy(ToDir, PChar(ToFile));
with SHFileOpStruct do
begin
Wnd := Handle; // Assign the window handle
wFunc := FO_COPY; // Specify a file copy
pFrom := FromDir;
pTo := ToDir;
fFlags := 0;
fAnyOperationsAborted := true;
hNameMappings := nil;
lpszProgressTitle := nil;
if SHFileOperation(SHFileOpStruct) <> 0 then
RaiseLastWin32Error;
end;
finally
FreeMem(ToDir, Length(ToFile)+2);
end;
finally
FreeMem(FromDir, Length(FromFile)+2);
end;
end else
begin
Application.MessageBox(pchar('无法定位数据文件!'),pchar('注意'),mb_ok);
Abort;
end;
end;
把硬盘上的文件/目录拷贝到软盘的程序
#5
谢谢COBI(我是小新),不过这个程序我得研究一下。。。如果有注释,我想是最好的。。。不过说什么我都要非常感谢你。。。