日期:2014-05-16 浏览次数:20536 次
function browsefolder(path) { try { var message = "\u8bf7\u9009\u62e9\u6587\u4ef6\u5939"; //选择框提示信息 var shell = new ActiveXObject("Shell.Application"); var folder = shell.BrowseForfolder(0, message, 64, 17);//起始目录为:我的电脑 //var folder = Shell.BrowseForfolder(0,Message,0); //起始目录为:桌面 if (folder != null) { folder = folder.items(); // 返回 folderItems 对象 folder = folder.item(); // 返回 folderitem 对象 folder = folder.Path; // 返回路径 if (folder.charAt(folder.length - 1) != "\\") { folder = folder + "\\"; } Ext.getCmp(path).setValue(folder); return folder; } } catch (e) { alert(e.message); } }