?? 4-12.asp
字號:
<html>
<head>
<title>文件處理實例</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
'創(chuàng)建一個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 + -