Home > Web Front-end > JS Tutorial > Save a File Using a File Save Dialog Box_javascript技巧

Save a File Using a File Save Dialog Box_javascript技巧

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 19:12:12
Original
1438 people have browsed it

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 
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
To save hosts, how can I save it as?
From 1970-01-01 08:00:00
0
0
0
How to save modified data
From 1970-01-01 08:00:00
0
0
0
Modify to save()
From 1970-01-01 08:00:00
0
0
0
How to save online editor
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template