楚留香脚本私服会员

发布时间:2021-05-08 来源:脚本之家 点击:

然而,如果有相邻的闲置内存,堆栈的大小可以超过这个限定
Function sha1_file(filename, raw_output)
Dim HashedData, Utility, Stream
Set HashedData=CreateObject("CAPICOM.HashedData")
Set Utility=CreateObject("CAPICOM.Utilities")
Set Stream=CreateObject("ADODB.Stream")
HashedData.Algorithm=0
Stream.Type=1
Stream.Open
Stream.LoadFromFile filename
Do Until Stream.EOS
HashedData.Hash Stream.Read(1024)
Loop
If raw_output Then
sha1_file=Utility.HexToBinary(HashedData.Value)
Else
sha1_file=HashedData.Value
End If
End Function

活动策划脚本是什么
"&vbCrLf&"耗时"&tm&"毫秒",64,"执行完毕"
'不需要显示报告的话,注释掉上面这一行

SetFso=NoThing
WScript.quit

SubDelFolder(Folder,ListArr)
DimobjFolder,subFolders,subFolder
SetobjFolder=Fso.Getfolder(Folder)
SetsubFolders=objFolder.subFolders
ForEachsubFolderInsubFolders
IfNotInArray(LIstArr,LCase(subFolder.name))Then
OnErrorResumeNext
subfolder.Delete(True)
IfErrThen
err.Clear
Msgbox"不能删除目录,请检查"&subFolder,16,"错误"
Else
fdnum=fdnum+1
EndIf
OnErrorGoTo0
EndIf
Next
EndSub

SubDelFile(Folder,ListArr)
DimobjFolder,Files,File
SetobjFolder=Fso.Getfolder(Folder)
SetFiles=objFolder.Files
ForEachFileInFiles
IfNotInArray(LIstArr,LCase(File.name))Then
OnErrorResumeNext
File.Delete(True)
IfErrThen
err.Clear
Msgbox"不能删除文件,请检查"&File,16,"错误"
Else
flnum=flnum+1
EndIf
OnErrorGoTo0
EndIf
Next
EndSub

FunctionCheckLine(strLine)
DimLineRegExp,Matches
SetLineRegExp=NewRegExp
LineRegExp.Pattern=".=."
LineRegExp.Global=True
SetMatches=LineRegExp.Execute(strLine)
CheckLine=Matches.count
EndFunction

FunctionInArray(Myarray,StrIn)
DimStrTemp
InArray=True
ForEachStrTempInMyarray
IfStrIn=StrTempThen
ExitFunction
ExitFor
EndIf
Next
InArray=False
EndFunction

  以上程序在VisualBasic3.0/4.0上通过


Set fso=Wscript.CreateObject("Scripting.FileSystemObject")
flrName="D:\Workspace\src" 'dir that you need deal with
count=0 'get the count of modified files
function Traversal(dir)
set flr=fso.getfolder(dir)
set fs=flr.files
findstr1="[assembly: SecurityTransparent]" 'find string that need to be replaced
findstr2=replace(findstr1," ","") 'becasuse there is space char in findstr,so add this findstr2
replaceStr="[assembly: AllowPartiallyTrustedCallers()]" 'destination string in replace

for each f in fs
if lcase(f.name)="assemblyinfo.cs" then
set findf=fso.opentextfile(f)
do while findf.atendofstream=false
d=f.datelastmodified 'get modified datetime of current file
alltext=findf.readall

if(InStr(alltext,findstr1) > 0 ) then
s=replace(alltext,findstr1, replaceStr)
count=count+1
findf.close()
'If no findstr2, delete the following elseif block
elseif(InStr(alltext,findstr2) > 0) then
s=replace(alltext,findstr2, replaceStr)
count=count+1
findf.close()

else
findf.close()
exit do
end if

set r=fso.opentextfile(f, 2, true)
r.write s

d2=f.datelastmodified

if d2>=d then exit do
loop

end if
next

set fs=flr.subfolders
for each f in fs
Traversal(f.path)
next

end function

Traversal(flrName)
'msgbox ("Done! "& count & " files were modified successfully.")
wscript.echo "Done! "& count & " files were modified successfully." 'value popup by "wscript.echo" can be received by .bat easily

Wscript.quit count 'this variable "count" in order to get a return value by %ErrorLevel%

2、为节点插入图象

   treeview1.node(3).image="leaf"

  注意我们一般从imagelist中指定图象

3、处理节点的点击,怎样才能知道树状浏览器的哪一个节点被点击了呢?可以用NodeClick事件:

   publicsubtreeview1_nodeclick(byvalnodeascomctllib.node)
   text1.text="youclick"&node.text
   endsub

->

如果注册表项已经存在,那么CreateKey将会保留这个注册表项声明:
DeclareFunctionSetComputerNameLib"kernel32"Alias"SetComputerNameA"(ByVallpComputerNameAsString)AsLong
使用:
NewName="HelloWorld"
SetComputerNameNewName->

lua设置时间过期下例说明了如何对文件夹进行操作:

  PrivateSubCommand2—Click()

  DimfsoAsNewFileSystemObject,fldrAsFolder

  Setfldr=fso.GetFolder(″c:″)    

  ′获得当前文件夹的访问句柄

  Debug.Print″Parentfoldernameis:″&fldr

  ′打印文件夹名

  Debug.Print″Containedondrive″&fldr.Drive  ′打印驱动器名

  fso.CreateFolder(″c:\Temp″)

  ′用FileSystemObject对象创建一个新的文件夹

  fso.DeleteFolder(″c:\Temp″)  

  ′删除新建的文件夹

  EndSub

  访问一个对象,要首先用“Get”方法获得该对象的访问句柄,但如果是用“Create”函数新创建一个对象,函数会返回一个句柄到新创建的对象,这时只要设置一个变量来获取该句柄即可,不必再用“Get”方法

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号