Save a File Using a File Save Dialog Box

Geass_星河

Geass_星河

2016-02-19 09:24

get新技能是需要付出行动的,即使看得再多也还是要动手试一试。今天图老师小编跟大家分享的是Save a File Using a File Save Dialog Box,一起来学习了解下吧!
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:ScriptsScript1.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 
展开更多 50%)
分享

猜你喜欢

Save a File Using a File Save Dialog Box

Web开发
Save a File Using a File Save Dialog Box

Locate a File Using a File Open Dialog Box

Web开发
Locate a File Using a File Open Dialog Box

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

Hibernate save() saveorupdate()的用法

Web开发
Hibernate save() saveorupdate()的用法

《王权2幻想王国》加快save速度

电脑网络
《王权2幻想王国》加快save速度

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

用save for web优化网页图象

PS PS教程
用save for web优化网页图象

user itext create a word file

编程语言 网络编程
user itext create a word file

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

Add a Formatted Table to a Word Document

Add a Formatted Table to a Word Document

Sample script that deletes a SQL Server database

Sample script that deletes a SQL Server database
下拉加载更多内容 ↓