页面导航: 首页网络编程JavaScript应用技巧 → 正文内容

Save a File Using a File Save Dialog Box

发布:dxy 字体:[增加 减小] 类型:转载
Demonstration script that allows you to enter a file name in a File Save dialog box, and then saves a sample text file (consisting entirely of the current date) under that file name. 
Supported Platforms
Windows Server 2003
 No
Windows XP
 Yes
Windows 2000
 No
Windows NT 4.0
 No
Windows 98
 No

Script Code

Set objDialog = CreateObject("SAFRCFileDlg.FileSave") 
objDialog.FileName = "C:\Scripts\Script1.vbs" 
objDialog.FileType = "VBScript Script" 
intReturn = objDialog.OpenFileSaveDlg 
If intReturn Then 
    Set objFSO = CreateObject("Scripting.FileSystemObject") 
    Set objFile = objFSO.CreateTextFile(objDialog.FileName) 
    objFile.WriteLine Date 
    objFile.Close 
Else 
    Wscript.Quit 
End If 
百度中搜索更多的关于Save a File Using a File Save Dialog Box内容,或者用Google搜索相关更多
浏览次数:载入中... 打印本文关闭本文返回首页

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行