同意
kevin_gao(困了!累了!睡觉了!)
kevin_gao(困了!累了!睡觉了!)
解决方案 »
- 怎样将一个RTF流插入到word文档中去?
- delphy $ 问题在线等
- excel
- 这个报表怎么解决了?
- 很急的简单问题,帮忙
- iniFile和txtFile相同吗?在使用中有何优缺点?谢谢。
- 如何判断一个目录下有多少个文件并按顺序取出文件名?
- 请问delphi程序如何发布?即release的步骤。
- 请教:怎样找到目录下当天修改的文件?
- delphi 中 显示 autocad 文件 如何实现(用算法实现,能否提供源代码)
- ado控件的异步执行错误:'A connection component is required for async ExecuteOptions.'为什么设executeoption为异步执行就产生此错?
- 我要疯啦!为什么得不到书上示范的结果???请大侠帮忙看看啊,关于Midas中返回错误记录问题。
昨天刚学到的,ExtractFileDir(Application.ExeName),返回可执行文件所在的目录.
当然,一般情况下用GetCurrentDir()或者Getdir也可以!
再不行就用Savedialog或者Opendialog,再dialog compenents中
就要那种界面的.SelectDirectory与之相差太大了
var
pPrograms,pBrowse: PItemIDList;
hBrowseInfo: TBROWSEINFO;
hPChar: PChar;begin
if (not SUCCEEDED(SHGetSpecialFolderLocation(Getactivewindow, aRoot,
pPrograms))) then
EXIT;
hPChar := StrAlloc(max_path);
with hBrowseInfo do
begin
hwndOwner := Getactivewindow;
pidlRoot := pPrograms;
pszDisplayName := hPChar;
lpszTitle := pChar(aCaption);
ulFlags := BIF_RETURNONLYFSDIRS;
lpfn := nil;
lParam := 0;
end; pBrowse := SHBrowseForFolder(hBrowseInfo);
if (pBrowse <> nil) then
if (SHGetPathFromIDList(pBrowse, hPChar)) then Result:= hPChar;
StrDispose(hPChar);end;
条用:
GetFolder(0,'请选择所需的路径:');
str_dir:string;
showmessage(getdir(0,str_dir));
使用
var s:string;
然后使用selectdirectory('选择文件夹','',s)就能够达到需要的效果