zoukankan      html  css  js  c++  java
  • 单机版的 弹出文件选择框JS

    <script language="javascript" type="text/javascript">
                  function BrowseFolder()
             {
                 try
                 {
                    var Message = "请选择文件夹";  //选择框提示信息
                    var Shell = new ActiveXObject( "Shell.Application" );
                    //var Folder = Shell.BrowseForFolder(0,Message,0x0040,0x11);//起始目录为:我的电脑
                    var Folder = Shell.BrowseForFolder(0,Message,0); //起始目录为:桌面
                    if(Folder != null)
                    {
                        //debugger;
                        Folder = Folder.items();  // 返回 FolderItems 对象
                        Folder = Folder.item();  // 返回 Folderitem 对象
                        Folder = Folder.Path;   // 返回路径
                       
                        if(Folder.charAt(Folder.length-1) != "\\")
                        {
                            Folder = Folder + "\\";
                        }
                                      return Folder;
                    }
                }
                catch(e)
                {
                    alert(e.message);
                }

           }
        </script>

  • 相关阅读:
    vs整合MySQL和QT
    VS2019中QT连接及使用
    JavaScript 进阶入门
    解决MySQL workbench的resultgird不出现的问题
    JavaScript入门
    CSS学习
    Linux下如何查看tomcat是否启动、查看tomcat启动日志
    oracle常见的函数
    java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter
    位运算(&、|、^、~、>>、<<)
  • 原文地址:https://www.cnblogs.com/lgxll/p/2727419.html
Copyright © 2011-2022 走看看