|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
问题是他们究竟是喜欢他们是使用软件时,速度快还是速度慢好.(当然在3秒以内).无论是他们输入资料时,查找资料时,分析资料时.AttributesProperty
Setsorreturnstheattributesoffilesorfolders.Read/writeorread-only,dependingontheattribute.
object.Attributes[=newattributes]
Arguments
object
Required.AlwaysthenameofaFileorFolderobject.
newattributes
Optional.Ifprovided,newattributesisthenewvaluefortheattributesofthespecifiedobject.
Settings
Thenewattributesargumentcanhaveanyofthefollowingvaluesoranylogicalcombinationofthefollowingvalues:
ConstantValueDescription
Normal0Normalfile.Noattributesareset.
ReadOnly1Read-onlyfile.Attributeisread/write.
Hidden2Hiddenfile.Attributeisread/write.
System4Systemfile.Attributeisread/write.
Directory16Folderordirectory.Attributeisread-only.
Archive32Filehaschangedsincelastbackup.Attributeisread/write.
Alias1024Linkorshortcut.Attributeisread-only.
Compressed2048Compressedfile.Attributeisread-only.
Remarks
Attemptstochangeanyoftheread-onlyattributes(Alias,Compressed,orDirectory)areignored.
Whensettingattributes,itisgenerallyagoodideatofirstreadthecurrentattributes,thenchangetheindividualattributesasdesired,andfinallywritetheattributesback.
ThefollowingcodeillustratestheuseoftheAttributespropertywithafile:
FunctionToggleArchiveBit(filespec)
Dimfso,f
Setfso=CreateObject("Scripting.FileSystemObject")
Setf=fso.GetFile(filespec)
Iff.attributesand32Then
f.attributes=f.attributes-32
ToggleArchiveBit="Archivebitiscleared."
Else
f.attributes=f.attributes+32
ToggleArchiveBit="Archivebitisset."
EndIf
EndFunction
缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。 |
|