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:\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
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
-
Locate a File Using a File Open Dialog Box
Demonstration script that displays a File Open dialog box (open to the folder C:\Scripts), and then echoes back the name of the selected file. Supported Platforms Windows Server 2003 No Windows XP Yes Windows 2000 No Windows NT 4.0 No Windows 98
-
file.mkdir()、file.mkdirs()和file.createNewFile()的区别
file.mkdir()创建单级文件夹,file.mkdirs()创建多级文件夹,file.createNewFile()创建的是一个文件. 下面通过一个demo来验证一下: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setConten
-
c# 生成二维码的示例
二维码是越来越流行了,很多地方都有可能是使用到.如果是静态的二维码还是比较好处理的,通过在线工具就可以直接生成一张二维码图片,比如:草料二维码.但有的时候是需要动态生成的(根据动态数据生成),这个使用在线就工具就无法实现了.最好是能在代码中直接生成一个二维码图片,这里我就介绍下使用QRCoder类库在代码中生成二维码. 网上生成二维码的组件还是挺多的,但是真正好用且快速的却不多.QRCoder就是我在众多中找到的,它的生成速度快.而且使用也相当方便. 开始编码 1.安装 QRCoder组件.在项
-
java文件操作工具类分享(file文件工具类)
复制代码 代码如下: import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.BufferedReader;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.Fil
-
Django处理文件上传File Uploads的实例
HttpRequest.FILES 表单上传的文件对象存储在类字典对象request.FILES中,表单格式需为multipart/form-data <form enctype="multipart/form-data" method="post" action="/foo/"> <input type="file" name="image" /> request.FILES中的键
-
tensorflow模型的save与restore,及checkpoint中读取变量方式
创建一个NN import tensorflow as tf import numpy as np #fake data x = np.linspace(-1, 1, 100)[:, np.newaxis] #shape(100,1) noise = np.random.normal(0, 0.1, size=x.shape) y = np.power(x, 2) + noise #shape(100,1) + noise tf_x = tf.placeholder(tf.float32, x.
-
docker save与docker export的区别
目录 缘起 dockersave dockerexport dockersave和dockerexport的区别 脑洞 缘起 docker save和docker export都能导出镜像包,咋看起来区别似乎不大.本文就针对这个问题,试图搞清楚docker save和docker export的功能是什么?适用于什么应用场景? *注:用户既可以使用 docker load 来导入镜像存储文件到本地镜像库,也可以使用 docker import 来导入一个容器快照到本地镜像库.这两者的区别在于容器
-
java中File类的使用方法
构造函数 复制代码 代码如下: public class FileDemo { public static void main(String[] args){ //构造函数File(String pathname) File f1 =new File("c:\\abc\\1.txt"); //File(String parent,String child) File f2 =new File("c:\\a
-
Perl中使用File::Lockfile确保脚本单实例运行
用Perl写了一些监控脚本,放在crontab中调度执行.有时候会发现一个脚本运行时间过长,会同时跑起多个实例,因此有必要为脚本加上控制,只运行一个实例. 最简单自然的想法,在脚本中检查并创建一个空的lock文件,脚本结束时再删除.通过判断文件是否存在的方式来判断脚本是否已经运行.不过这样做有个bug,如果脚本运行过程中异常终止,lock文件没有正常删除,就会导致脚本无法再运行. 空的lock文件不行,那么考虑在lock文件中加入一点内容,比如进程的PID号,然后通过检查该PID号的进程是否还在
随机推荐
- ASP.NET中repeater嵌套实现代码(附源码)
- vue组件Prop传递数据的实现示例
- nginx win32 版本静态文件测试 (Windows环境)
- Lua之wrap函数用法示例
- 详解使用angular的HttpClient搭配rxjs
- Windows7下安装 Nodejs 并在 WebStorm 9.0.1 下搭建编译 LESS 环境的图文教程
- Asp.Net 动态页面转静态页面主要代码
- C++中auto_ptr智能指针的用法详解
- MySQL Like语句的使用方法
- MySQL启动1053错误解决方法
- PHP可变函数的使用详解
- JavaScript的漂亮的代码片段
- JS如何判断json是否为空
- XStream使用方法总结附实例代码
- SQL2008中 阻止保存要求重新创建表的更改 的解决方法
- jQuery实现鼠标滑过遮罩并高亮显示效果
- java中的文件操作总结(干货)
- asp.net Coolite 学习交流
- C++ 中RTTI的使用方法详解
- vue 插件的方法代码详解