asp怎么样设置文件为只读属性

Function LockFile(strFileName)
	set fso = CreateObject("Scripting.FileSystemObject")
	set f = fso.GetFile(strFileName) 
	if  f.attributes <> 7  then
		f.attributes = 7
	end if
End Function
Function UnLockFile(strFileName)
	set fso = CreateObject("Scripting.FileSystemObject")
	set f = fso.GetFile(strFileName) 
	if  f.attributes = 7  then
		f.attributes = 1
	end if
End Function

Leave a Reply