我在form上放置了一个SaveDialog1,和button1
然后在button1里写下如下代码;
procedure TForm1.Button1Click(Sender: TObject);
var
filepath:string;
begin
if SaveDialog1.Execute=true then filepath:=SaveDialog1.FileName
else exit;
showmessage(filepath);
showmessage(getcurrentdir);
end;
我点击button1后并在dialog中随便选择一个文件;
发现showmessage(filepath)与showmessage(getcurrentdir)显示
的路径是一样的;我原来以为getcurrentdir应该是取得
当前程序所在的位置路径;为什么getcurrentdir的路径会随SaveDialog1.FileName而变化呢?
我用的是delphi6
windowsxp(personfinal)
请问是什么原因?还是我理解有误呢!请大家指教!谢谢!