打开记事本,随便命名,保存下面的内容
需要修改的地方:
保存,修改后缀名为reg;双击运行自动生成ChiticData的协议,在Html中写上这个协议即可打开本地运行程序
// 浏览文件夹(指定文件路径)function BrowseFolder() {try {var Message = "Please select the folder path."//选择框提示信息var Shell = new ActiveXObject("Shell.Application")var Folder = Shell.BrowseForFolder(0, Message, 0x0040, 0x11)//起始目录为:我的电脑//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 + "\\"}return Folder}} catch (e) {alert(e.message)}}//保存文件function SaveInfoToFile(folder, fileName) {var filePath = folder + fileNamevar fileInfo = "hahahaha"var fso = new ActiveXObject("Scripting.FileSystemObject")var file = fso.CreateTextFile(filePath, true)file.Write(fileInfo)file.Close()}以上代码并没有处理xml,关于xml可以找相关资料。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)