📄 4-12.asp
字号:
<html>
<head>
<title>文件处理实例</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
'创建一个FileSystemObject对象实例
Set TestFileObject=Server.CreateObject("Scripting.FileSystemObject")
if TestFileObject.FileExists("E:\MasterASP\chap4\1.txt") then '如果文件存在
Set exitfile=TestFileObject.GetFile("E:\MasterASP\chap4\1.txt")
'复制文件
exitfile.copy "E:\MasterASP\chap4\2.txt"
'移动文件
exitfile.Move "e:\2.txt"
'删除文件
exitfile.Delete
Response.write("1.txt被删除,同时被复制成 2.txt,2.txt被移动到e盘根目录下")
else
Response.write("文件不存在!")
end if
%>
</head>
<body>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -