方法一:<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> dir:string;<br>begin<br> dir:='c:/';//初始目录<br> SelectDirectory(dir, [sdAllowCreate,sdPerformCreate,sdPrompt],1000);<br> showmessage('你选择了'+dir);//用户选择的目录;<br>end;<br>方法二:<br>procedure TForm1.Button2Click(Sender: TObject);<br>var<br> dir:string;<br>begin<br> selectdirectory('选择文件夹','c:/',dir);<br> showmessage('你选择了'+dir);//用户选择的目录<br>end;<br>