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脚本
- js变换显示图片的实例
- C#实现windows form拷贝内容到剪贴板的方法
- Ubuntu10下如何搭建MySQL Proxy读写分离探讨
- JavaScript 密码强度判断代码
- 解决python3 urllib中urlopen报错的问题
- IOS中safari下的select下拉菜单文字过长不换行的解决方法
- CHM电子书木马制作攻略教程
- jquery选择器中的空格与大于号>、加号+与波浪号~的区别介绍
- 将备份的SQLServer数据库转换为SQLite数据库操作方法
- Mysql数据库名和表名在不同系统下的大小写敏感问题
- 不到30行JS代码实现Excel表格的方法
- 学习php设计模式 php实现访问者模式(Visitor)
- Java实现的文件过滤代码分享(按后辍过滤)
- python传递参数方式小结
- Thinkphp连表查询及数据导出方法示例
- C#数据结构之顺序表(SeqList)实例详解
- C# winfrom实现读取修改xml
- 一贴学会PHP 新手入门教程
- php 在线打包_支持子目录