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号的进程是否还在
随机推荐
- js实现水平滚动菜单导航
- GO语言标准错误处理机制error用法实例
- Java反射机制及Method.invoke详解
- Oracle性能究极优化
- php基于base64解码图片与加密图片还原实例
- IIS7.5调用asp页面出现800a0e7a的解决办法
- MySQL PXC构建一个新节点只需IST传输的方法(推荐)
- php开发时容易忘记的一些技术细节
- 使用php转义输出HTML到JavaScript
- DOS下的必备工具
- Python导入模块时遇到的错误分析
- iscroll碰到Select无法选择下拉刷新的解决办法
- 把网站链接卖一个好价钱: Text Link Ads 注册网赚攻略
- C#位移的介绍与例子
- 解决JavaScript实现省市联动过程中的bug
- 解决vuejs项目里css引用背景图片不能显示的问题
- Yii2框架控制器、路由、Url生成操作示例
- python查看模块,对象的函数方法
- JavaScript this在函数中的指向及实例详解
- PrintStream和PrintWriter的区别简介