我想使用一个windows标准save对话框,让用户选择存储文件的文件夹,返回值是该文件夹的完整路径。如何做?

解决方案 »

  1.   

    if SaveDialog1.Execute then then showmessage(SaveDialog1.filename);
      

  2.   

    利用SaveDialog控件,
    if opendialog1.Execute then
    begin
        RichEdit1.Lines.LoadFromFile(opendialog1.FileName);
        showmessage(SaveDialog1.filename);
    end;
      

  3.   

    给你一个笨方法:
    var
      j,i:integer;
      sPath,ePath:string;
    begin
    if SaveDialog1.Execute then
    sPath:=SaveDialog1.filename;
    i:=pos('\',sPath);
    j:=i;
    ePath:=copy(sPath,i+1,100000);
    while i>0 do
    begin
      i:=pos('\',ePath);
      if i<>0 then
      begin
         ePath:=copy(ePath,i+1,100000);
         j:=j+i;
      end;
    end;
    edit1.text:=copy(sPath,1,j-1);
    end;
      

  4.   

    if SaveDialog1.Execute then
      Result := ExtractFilePath(SaveDialog1.FileName);
      

  5.   

    uses FileCtrl;procedure TForm1.Button1Click(Sender: TObject);
    var path:string;
    begin
        if SelectDirectory('','',Path) then
          Label1.Caption:=path+'\';
    end;