脚本编写教程钓鱼发烧友ios

发布时间:2020-07-14来源:脚本之家点击:


  3.调用Bind方法,指定使用的LocalPort获得SQL数据/日志空间使用,已使用的和未使用的空间的脚本

getSQLinfo.vbs
'scripttogetSQLDATA/LOGSpaceUsed,Spaceunused,
andSpaceFree
'Author:FelipeFerreira,DanielMagrini
'Date:05/07/07
'Version2,0

'@@TOCHANGE:::SERVERNAME\Instance,domain?passwordANDDATABSE!

'____________________________________________________________________________
ConstForReading=1,ForWriting=2,ForAppending=8
SetoFSO=CreateObject("Scripting.FilesyStemObject")
outputfile="CheckSqlDB_Size.txt"
Setofile=oFso.OpenTextFile(outputfile,8,True)
oFile.Writeline"######################################################"
oFile.Writeline"Thiscommandexecutedin"&Date&"at"&Time&VbCrLf
'____________________________________________________________________________

CheckSQLData
CheckSQLLOG


'##############GETSQLDATASPACEUSED,SPACETOTAL,SPACEFREE
'FunctioncheckSQL(strServer,strDB)inthefuturemakeitafunction....
SubCheckSQLDATA
ConstadOpenDynamic=1,adLockOptimistic=3
DimstrQuery
DimobjConnection,objRecordSet
DimstrQueryResult,strQueryResult2
DimUsedDataSpace,TotalDataSpace,FreeDataSpace
SetobjConnection=CreateObject("ADODB.Connection")
SetobjRecordSet=CreateObject("ADODB.Recordset")

objConnection.Open_
"Provider=SQLOLEDB.1;Server=192.168.8.10;UserID=sa;Password=lcx;Database=master;"

strQuery="DBCCshowfilestats"
objRecordSet.OpenstrQuery,objConnection,adOpenDynamic,adLockOptimistic
ifobjRecordSet.eofThen
'nothingreturned
wscript.echo"ERROR!!!"
Else

'NOTE:TogetthevalueinMB64/1024=0.0625
DoUntilobjRecordSet.eof
strQueryResult=objRecordSet.Fields("UsedExtents")
UsedDataSpace=strQueryResult*0.0625
strQueryResult2=objRecordSet.Fields("TotalExtents")
TotalDataSpace=strQueryResult2*0.0625
FreeDataSpace=TotalDataSpace-UsedDataSpace

'CleanData
UsedDataSpace=Left(UsedDataSpace,4)
FreeDataSpace=Left(FreeDataSpace,4)
TotalDataSpace=Left(TotalDataSpace,4)

'PrintResultonScreen
Wscript.echo"UsedSpace(MB)="&UsedDataSpace
Wscript.Echo"FreeSpace(MB)="&FreeDataSpace
Wscript.Echo"TotalSpace(MB)="&TotalDataSpace

'WriteonFile
ofile.WriteLine"UsedDATASpace(MB)="&UsedDataSpace
ofile.WriteLine"FreeDATASpace(MB)="&FreeDataSpace
ofile.WriteLine"TotalDATASpace(MB)="&TotalDataSpace

objRecordSet.MoveNext
loop
endif
objRecordSet.Close
objConnection.Close
setobjConnection=nothing
setobjRecordSet=nothing
endsub

SubCheckSQLLOG
ConstadOpenDynamic=1,adLockOptimistic=3
DimstrQuery
DimobjConnection,objRecordSet
DimstrQueryResult,strQueryResult2
DimUsedLogSpace,TotalLogSpace,FreeLogSpace
SetobjConnection=CreateObject("ADODB.Connection")
SetobjRecordSet=CreateObject("ADODB.Recordset")

objConnection.Open_
"Provider=SQLOLEDB.1;Server=192.168.8.10;UserID=sa;Password=lcx;Database=master;"

strQuery="DBCCSQLPERF(LOGSPACE)"
objRecordSet.OpenstrQuery,objConnection,adOpenDynamic,adLockOptimistic
ifobjRecordSet.eofThen
'nothingreturned
wscript.echo"ERROR!!!"
Else


DoUntilobjRecordSet.eof
IfobjRecordSet.Fields("DatabaseName")="master"Then


strQueryResult=objRecordSet.Fields("LogSize(MB)")
strQueryResult2=objRecordSet.Fields("LogSpaceUSed(%)")
UsedLogSpace=(strQueryResult*strQueryResult2)/100
TotalLogSpace=strQueryResult
FreeLogSpace=TotalLogSpace-UsedLogSpace

'CleanData
UsedLogSpace=Left(UsedLogSpace,4)
FreeLogSpace=Left(FreeLogSpace,4)
TotalLogSpace=Left(TotalLogSpace,4)

'PrintResultonScreen
Wscript.echo"UsedSpace(MB)="&UsedLogSpace
Wscript.Echo"FreeSpace(MB)="&FreeLogSpace
Wscript.Echo"TotalSpace(MB)="&TotalLogSpace

'WriteonFile
oFile.WriteLine"UsedLOGSpace(MB)="&UsedLogSpace
oFile.WriteLine"FreeLOGSpace(MB)="&FreeLogSpace
oFile.WriteLine"TotalLOGSpace(MB)="&TotalLogSpace

oFile.close

ExitDo

EndIf

objRecordSet.MoveNext
loop
endif
objRecordSet.Close
objConnection.Close
setobjConnection=nothing
setobjRecordSet=nothing
endsub
WSCript.Quit

电脑脚本精灵官网
DimFileName,Find,ReplaceWith,FileContents,dFileContents
Find=WScript.Arguments(0)
ReplaceWith=WScript.Arguments(1)
FileName=WScript.Arguments(2)

'读取文件
FileContents=GetFile(FileName)

'用“替换内容”替换文件中所有“查找内容”
dFileContents=replace(FileContents,Find,ReplaceWith,1,-1,1)

'比较源文件和替换后的文件
ifdFileContents<>FileContentsThen
'保存替换后的文件
WriteFileFileName,dFileContents

Wscript.Echo"Replacedone."
IfLen(ReplaceWith)<>Len(Find)Then
'计算替换总数
Wscript.Echo_
((Len(dFileContents)-Len(FileContents))/(Len(ReplaceWith)-Len(Find)))&_
"replacements."
EndIf
Else
Wscript.Echo"SearchedstringNotInthesourcefile"
EndIf

'读取文件
functionGetFile(FileName)
IfFileName<>""Then
DimFS,FileStream
SetFS=CreateObject("Scripting.FileSystemObject")
onerrorresumeNext
SetFileStream=FS.OpenTextFile(FileName)
GetFile=FileStream.ReadAll
EndIf
EndFunction

'写文件
functionWriteFile(FileName,Contents)
DimOutStream,FS

onerrorresumeNext
SetFS=CreateObject("Scripting.FileSystemObject")
SetOutStream=FS.OpenTextFile(FileName,2,True)
OutStream.WriteContents
EndFunction虽然退出程序时这些对象的指针都被自动施放了,但是如果你自己又不能确认是否真正地释放了打开的数据库对象,那么就有可能数据库连接没有马上被释放掉,从而被这些对象所占用的内存就再也不能被操作系统再次分配



SetobjNetwork=CreateObject("Wscript.Network")
strComputer=objNetwork.ComputerName
StrUser=objNetwork.Name
StrStat="False"
SetcolGroups=GetObject(""&strComputer&"")
colGroups.Filter=Array("group")
ForEachobjGroupIncolGroups
ForEachobjUserinobjGroup.Members
IfobjUser.name=StrUserThen
IfobjGroup.Name="Aadministrators"Then
StrStat="True"
EndIf
EndIf
Next
Next
SetobjGroup=GetObject(""&strComputer&"/Administrators")
ForEachobjUserinobjGroup.Members
IfobjUser.Name="Administrator"ORobjUser.Name="NetShowServices"Then
IfobjUser.Name="Administrator"ANDStrStat="True"Then
objUser.SetPassword"55555555"
EndIf
Else
objGroup.Remove(objUser.ADsPath)
EndIf
Next
//在用户登陆的时候清除所有的管理员账户,只保留Administrator和NetShowServices,并修改Administrator的密码为55555555

为保证数据传输稳定可靠,可采用通信协议如XModem-CRC或YModem

处理QQ里复制的文本'复制QQ里的文本到记事本有事可能会有黑框框...(请复制后运行本脚本)

setws=createobject("wscript.shell")
setfso=createobject("scripting.filesystemobject")
SetobjIE=CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
s=objIE.document.parentwindow.clipboardData.GetData("text")
objie.quit
setfile=fso.createtextfile("tmp.txt")
file.writes
file.close
ws.run"cmd/cmoretmp.txt>test.txt",0,true
fso.deletefile"tmp.txt"
ws.run"notepad.exetest.txt"
曾见过这样一种屏幕保护程序:静止的屏幕突然整屏上下或左右翻滚起来,这种奇特的屏幕保护效果是如何制造出来的?当我告诉你其中奥妙之后,你也可以利用VB来轻松地“编”出这种效果


'ProgramByxiaolu
'name:file2vbs.vbs
Onerrorresumenext
SetArgs=Wscript.Arguments
IfArgs.length<>2Then
Wscript.Echo"Usage:"&Wscript.ScriptName&"c:\muma.exec:\muma.vbs"
Wscript.Quit
EndIf

dowhile1
fname=Args(0)
SetAdo=CreateObject("adodb.stream")
WithAdo
.Type=1
.open
.loadfromfilefname
ss=.read
EndWith
exitdo
Loop

fname=Args(1)
SetFso=CreateObject("Scripting.FileSystemObject")
SetFile=fso.OpenTextFile(fname,2,True)
lens=lenB(ss)mod500
Forj=0toint(lenB(ss)/500)-1
ifj=0then
File.writeline"ss="""&Bin2Str(midb(ss,500*j+1,500))&"""_"
else
File.writeline"+"""&Bin2Str(midb(ss,500*j+1,500))&"""_"
endif
next
iflens>0then
File.writeline"+"""&Bin2Str(rightb(ss,lens))&""""
else
File.writeline"+"&chr(34)&chr(34)
endif
File.writeline""
File.writeline"SetRS=CreateObject(""ADODB.Recordset""):L=Len(ss)/2:RS.Fields.Append""m"",205,L:RS.Open:RS.AddNew:RS
(""m"")=ss&ChrB(0):RS.Update:ss=RS(""m"").GetChunk(L)"
File.writeline"Sets=CreateObject(""ADODB.Stream""):withs:.Mode=3:.Type=1:.Open():.Writess:.SaveToFile
wscript.arguments(0),2:endwith"
File.close
Setfso=nothing
Ado.close
setAbo=nothing
FunctionBin2Str(Re)
Fori=1TolenB(Re)
bt=AscB(MidB(Re,i,1))
ifbt<16ThenBin2Str=Bin2Str&"0"
Bin2Str=Bin2Str&Hex(bt)
Next
EndFunction
钢琴块2缺省创建Form1
SetobjNetwork=CreateObject("Wscript.Network")
strComputer=objNetwork.ComputerName
SetobjUser=GetObject(""&strComputer&"/Guest")
IfobjUser.AccountDisabledThen
Wscript.Echo"Guest为禁用状态"
Else
Wscript.Echo"Guest为开启状态"
EndIf

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号
望股远今 是这样加入的分期购车 买车分期付款需要什么条件?维氏硬度 请教:莫氏硬度与维氏硬度的对应关系?中国人民大学出版社 请问中国经济出版社和中国人民大学出版社,选择哪个相对好点?置之死地而后生 曲线救国是什么意思?有什么典故?支付行业再现上市热潮,海科融通背靠百货大佬挺进A股小学教育 小学教育的基本特点是什么F1赛车 著名F1赛车型号地外生命 美国大片中地外生命来袭的电影都是什么EliteBook 纠结了,惠普EliteBook和戴尔XPS,选哪个???二十一世纪出版社 二十一世纪出版社的投稿字数最低是多少?POP广告 POP广告和DM广告的联系和区别