惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Recent Announcements
Recent Announcements
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Azure Blog
Microsoft Azure Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
The Last Watchdog
The Last Watchdog
AI
AI
Webroot Blog
Webroot Blog
aimingoo的专栏
aimingoo的专栏
Hacker News: Ask HN
Hacker News: Ask HN
B
Blog RSS Feed
小众软件
小众软件
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
W
WeLiveSecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Troy Hunt's Blog
云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Vercel News
Vercel News
Y
Y Combinator Blog
P
Proofpoint News Feed
V2EX - 技术
V2EX - 技术
AWS News Blog
AWS News Blog
F
Fortinet All Blogs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
A
Arctic Wolf
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
V2EX
MongoDB | Blog
MongoDB | Blog
SecWiki News
SecWiki News
The Register - Security
The Register - Security
博客园_首页
T
Threat Research - Cisco Blogs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recorded Future
Recorded Future
V
Vulnerabilities – Threatpost
I
InfoQ
雷峰网
雷峰网
C
Check Point Blog

博客园 - 好窝

SQL Server 日期和时间函数 面试谈离职 技巧很重要 服务器应用程序不可用 刷新框架网页七种方法 asp套打位置 三层结构 RecordSet中的open完全的语法 域名删除时间及whois状态说明 把书看薄,再看厚 ContentType类型 使用Request.Servervariables("HTTP_USER_AGENT")取值 HTTP_X_FORWARDED_FOR & REMOTE_ADDR HTTP 头已经写入到客户浏览器。任何HTTP 头的修改必须在写入页内容之前。 使用获取url中的文件名和传过来的值 Response.ContentType Response.AddHeader使用实例收集 怎么重启IIS 笔记本键盘设置 安装SQL2000时提示错误:以前的某个程序安装己在安装计算机上创建挂起的文件操作
Scripting.FileSystemObject 的文件复制,删除,移动操作 - 好窝 - 博客园
好窝 · 2008-07-15 · via 博客园 - 好窝

<%
'创建一个FileSystemObject的事例
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
'创建一个要进行操作的文件
Set MyFile=MyFileObject.CreateTextFile("c:\test.txt")
MyFile.WriteLine("Hello")
MyFile.Close
'复制文件操作
MyFileObject.CopyFile "c:\test.txt" "c:\test2.txt"
'移动文件操作
MyFileObject.MoveFile "c:\test.txt" "c:\test3.txt"
'删除这些文件
MyFileObject.DeleteFile "c:\test.txt"
MyFileObject.DeleteFile "c:\test3.txt"
%>
除了使用FileSystemObject对象的方法来进行这种操作以外,你还可以使用FILE对象。下面是File对象相关操作的同等方法:
·Copy newcopy,[Overwrite]。这种方法给当前文件创建一个拷贝,当可选的 OverWrite参数为TRUE时,如果存在同名的目的文件,则进行覆盖。
·Move newcopy.这个方法用来移动当前文件,同时当前文件跟随到新的名称。
·Delete。删除当前文件。
在你使用这些方法之前,你必须创建File对象的一个事例,这样的事例创建是在FileSystemObject对象中使用GetFile()方法来完成的,下面这个脚本就是利用File对象进行各种操作的一个示例:
<%
'建一个FileSystemObject对象的事例
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
'创建一个要进行操作的文件
Set MyFile=MyFileObject.CreateTextFile("c:\test.txt")
MyFile.WriteLine("Hello")
MyFile.Close
'创建一个File对象的事例
Set afile=MyFileObject.GetFile("c:\test.txt")
'复制文件
Afile.copy "c:\test2.txt"
'移动文件
Afile.Move "c:\test3.txt"
'删除文件
afile.Delete
%>