S
swlove
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);<br>var<br> bi: TBrowseInfo;<br> pidl: pItemIdList;<br> strPath,CreatePath,displayname: string;<br>begin<br> SetLength (displayname, 100);<br><br> bi.hwndOwner := Handle;<br> bi.pidlRoot := nil;<br> bi.pszDisplayName := pChar (displayname); //是用来取得文件名的<br> bi.lpszTitle := '选择文件夹';<br> bi.ulFlags :=$0040; //对话框类型<br> bi.lpfn := nil;<br> bi.lParam := 0;<br> pidl := ShBrowseForFolder (bi);//取得目录(文件夹)名称<br> SetLength (strPath, 100);<br> ShGetPathFromIdList (pidl, PChar(strPath));<br> CreatePath:='mkdir'+' '+ string(strPath) + ' '+'../';<br> Edit1.Text:=CreatePath;<br><br>end;<br><br><br><br>比如选择了 C:/aa ,那么Edit1上的文本应该是C:/aa../ 才是,但为什么还是C:/aa ?<br><br><br>谢谢