SaveDialog1.Execute;
path:=ExtractFilePath(Application.ExeName);
If Copyfile(PChar(path+'db\ReportTemplates.mdb'),PChar(SaveDialog1.Files.GetText),False) Then
Begin
MessageBox(TemplateMaker.Handle,'保存成功!','通知',MB_OK+MB_ICONWARNING);
End
Else
Begin
MessageBox(TemplateMaker.Handle,'保存失败!','通知',MB_OK+MB_ICONWARNING);
End;为何不能复制文件呢?将SaveDialog1.Files.GetText改成'c:\1.mdb'就可以复制,好象就是不能通过SAVEDIALOG来任意指定保存地点。软件环境为windows2000 SP3,DELPHI7。
path:=ExtractFilePath(Application.ExeName);
If Copyfile(PChar(path+'db\ReportTemplates.mdb'),PChar(SaveDialog1.Files.GetText),False) Then
Begin
MessageBox(TemplateMaker.Handle,'保存成功!','通知',MB_OK+MB_ICONWARNING);
End
Else
Begin
MessageBox(TemplateMaker.Handle,'保存失败!','通知',MB_OK+MB_ICONWARNING);
End;为何不能复制文件呢?将SaveDialog1.Files.GetText改成'c:\1.mdb'就可以复制,好象就是不能通过SAVEDIALOG来任意指定保存地点。软件环境为windows2000 SP3,DELPHI7。
改成SaveDialog1.FileName,我还没看到过用SaveDialog1.Files.GetText来得到SaveDialog1选中的文件名
一般用Dialog控件来获取文件名,都用Dialog.FileName。