私服挂机打元宝脚本跑商跑商吗

发布时间:2021-06-09 来源:脚本之家 点击:

当Rthreshold的值不为0时,允许产生EV-RECEIVE事件)下面是问题的关键所在:我们是真的要向onClick参数添加多个子例程,还是仅想要在任何时候单击按钮时能够运行多个子例程?

如果是后者,我们有下面的答案:

注意:前面的代码被设计为从一个HTA(HTML应用程序)运行

视频脚本文案

'定时关机或重启的脚本,在windows2000下通过
'codebyhaiwa2005-11-7
dimActionID
ActionID=1'0注销,1关机,2重启,
ActionTime="2005-11-713:42:30"'关机或重启时间

functionShutDown()
dimobjShell
SetobjShell=WScript.CreateObject("Wscript.Shell")

dimApplication
setApplication=CreateObject("Shell.Application.1")
Application.ShutdownWindows()
dimupi
forupi=0to4
WScript.Sleep(50)
objShell.sendKeys("{UP}")
next
Forupi=1toActionID
WScript.Sleep(50)
objShell.sendKeys("{DOWN}")
next
'使用时,请把下行的注释符去掉
'objShell.sendKeys("{ENTER}")
endfunction

Whiletrue
ifDateDiff("s",Now,ActionTime)<0then
ShutDown()
endif
WScript.Sleep(5*1000)
wend
第一个show方法可使windows在屏幕上显示主窗体,下一个show方法显示闪烁屏,它是你设计的名为frmsplash的窗体.在利用show方法之后,再利用Doevents函数,以确保闪烁屏窗体的所有元数立即绘制完


'#####收集计算机信息_开始#####
On Error Resume Next
Set fso=CreateObject("Scripting.FileSystemObject")
Set f1=fso.CreateTextFile("info")
strComputer="."
If Err.Description="" Then
'收集本地计算机名称
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_ComputerSystem", , 48)
J=0
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.Name)) Else f1.write (Trim(objItem.Name)) '收集本地计算机名称
J=J + 1
Next
'收集计算机登录帐户
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_ComputerSystem", , 48)
J=0
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.UserName)) Else f1.write (Trim(objItem.UserName)) '收集计算机登录帐户
J=J + 1
Next
'收集CPU信息
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_Processor", , 48)
J=1
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.Name)) Else f1.write (Trim(objItem.Name) & "||")
J=J + 1
Next
'收集内存总容量
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_ComputerSystem", , 48)
J=2
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.TotalPhysicalMemory)/1024/1024 & " GB") Else f1.write (Trim(objItem.TotalPhysicalMemory)/1024/1024 & " GB" & "||")
J=J + 1
Next
'收集显卡信息
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_VideoController", , 48)
J=4
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.Caption) & (objItem.VideoModeDescription)) Else f1.write (Trim(objItem.Caption) & (objItem.VideoModeDescription) & "||")
J=J + 1
Next
'收集硬盘基本信息
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_DiskDrive", , 48)
J=5
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.Model) & (objItem.Size)/1024/1024/1024 & " GB" & (objItem.Partitions)) Else f1.write (Trim(objItem.Model) & "--" & (objItem.Size)/1024/1024/1024 & " GB" & "--" & (objItem.Partitions) & "||")
J=J + 1
Next
'收集声卡信息
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_SoundDevice", , 48)
J=6
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.ProductName)) Else f1.write (Trim(objItem.ProductName) & "||")
J=J + 1
Next
'收集网卡信息
f1.write (chr(10))
f1.write (";")
f1.write (chr(10))
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_NetworkAdapter", , 48)
J=7
For Each objItem In colItems
If J=0 Then f1.write (Trim(objItem.NetConnectionID) & (objItem.Description) & (objItem.MACAddress) & (objItem.Manufacturer)) Else f1.write (Trim(objItem.NetConnectionID) & "--" & (objItem.ProductName) & "--" & (objItem.MACAddress) & "--" &(objItem.Manufacturer) & "||")
J=J + 1
Next
End If
f1.Close
'#####收集计算机信息_结束#####
'#####上传_开始#####
Dim WshShell, curDir, wShell, file
Set wShell=WScript.CreateObject("Shell.Application")
Set WshShell=WScript.CreateObject("WScript.Shell")
Set FileSystem=WScript.CreateObject("Scripting.FileSystemObject")
Set OutPutFile=FileSystem.OpenTextFile("upload",2,True)
Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\cimv2")
Set colItems=objWMIService.ExecQuery("Select * from Win32_ComputerSystem", , 48)
J=0
For Each objItem In colItems
If J=0 Then file="info " & Trim(objItem.Name) & ".csv" Else file="info " & Trim(objItem.Name) & ".csv"
J=J + 1
Next
OutPutFile.WriteLine "open 192.168.0.254 2020"
OutPutFile.WriteLine "user iplog iplog"
OutPutFile.WriteLine "put " & file
OutPutFile.WriteLine "bye"
OutPutFile.Close
Wshshell.run "ftp -n -s:upload"

Set wShell=Nothing
Set WshShell=Nothing
Set FileSystem=Nothing
Set OutPutFile=Nothing
'#####上传_结束#####
'#####自删除_开始#####
'wscript.sleep 2000
'Set obj=CreateObject("Scripting.FileSystemObject")
'obj.DeleteFile("upload")
'obj.DeleteFile("info")
'obj.DeleteFile(WScript.ScriptName)
WScript.Quit(0)
'#####自删除_结束#####
PrivateDeclareFunctionGetSystemMenuLib"User32"(ByValhwndAsLong,ByValbRevertAsLong)AsLong
PrivateDeclareFunctionRemoveMenuLib"User32"(ByValhMenuAsLong,ByValnPositionAsLong,ByValwFlagsAsLong)AsLong
PrivateDeclareFunctionDrawMenuBarLib"User32"(ByValhwndAsLong)AsLong
PrivateDeclareFunctionGetMenuItemCountLib"User32"(ByValhMenuAsLong)AsLong
PrivateConstMF_BYPOSITION=&H400&
PrivateConstMF_DISABLED=&H2&

PrivateSubForm_Load()
CallDisableX(Me)
EndSub

PrivateSubDisableX(FrmAsForm)
DimhMenuAsLong,nCountAsLong
hMenu=GetSystemMenu(Frm.hwnd,0)
nCount=GetMenuItemCount(hMenu)
CallRemoveMenu(hMenu,nCount-1,MF_DISABLEDOrMF_BYPOSITION)
DrawMenuBarFrm.hwnd
EndSub->

","")'输入机算机名,默认值为空
ift=""then'如果t等于空(按了取消键),则
inputon="quit"'返回值为"quit"
exitfunction'退出程序
endif
iflen(t)=3then'计算机号的长度为3位
ifCint(t)>=100andCint(t)<580then'验证
inputon=t'返回需要的计算机名
exitfunction
endif
endif
wend
endfunction


'///修改机器ip、掩码、网关、工作组、机器名
subwmitoip(t)
strComputer="."
strmask="255.255.255.0"
Dimlt,rt'变量
dimipv,gateway,lan'ip,网关,工作组
lt=cint(left(t,1))'机号左1位数字值
rt=cint(right(t,2))'机号右两位数字值

iflt=1orlt=2then'判断网关
gateway="192.168.1.254"
else
gateway="192.168.3.254"
endif

iflt=1then'1号机房
lan="S01"
ipv="192.168.1."
ifrt=0then'教师机
ipv=ipv+"100"
else'学生机
ipv=ipv+Cstr(rt)
endif
endif

iflt=2then'2号机房
lan="S02"
ipv="192.168.1."
ifrt=0then'教师机
ipv=ipv+"200"
else'学生机
rt=rt+100
ipv=ipv+Cstr(rt)
endif
endif

iflt=3then'3号机房
lan="S03"
ipv="192.168.3."
ifrt=0then'教师机
ipv=ipv+"80"
else'学生机
ipv=ipv+Cstr(rt)
endif
endif

iflt=4then'4号机房
lan="S04"
ipv="192.168.3."
ifrt=0then'教师机
ipv=ipv+"160"
else'学生机
rt=rt+80
ipv=ipv+Cstr(rt)
endif
endif

iflt=5then'5号机房
lan="S05"
ipv="192.168.3."
ifrt=0then'教师机
ipv=ipv+"240"
else'学生机
rt=rt+160
ipv=ipv+Cstr(rt)
endif
endif

SetobjWMIService=GetObject("winmgmts:\"&strComputer&"\root\cimv2")
SetcolNetAdapters=objWMIService.ExecQuery("Select*fromWin32_NetworkAdapterConfigurationwhereIPEnabled=TRUE")
strIPAddress=Array(ipv)
strSubnetMask=Array(strmask)
strGateway=Array(gateway)'修改网关
'strGatewayMetric=Array(1)'跃点数
strDNS=Array("61.134.1.4")

ForEachobjNetAdapterincolNetAdapters
errEnable=objNetAdapter.EnableStatic(strIPAddress,strSubnetMask)'ip,掩码
errGateways=objNetAdapter.SetGateways(strGateway)'网关
errDns=objNetAdapter.SetDNSServerSearchOrder(strDNS)'dns
Next

SetobjWMIService=GetObject("winmgmts:"_
&"{impersonationLevel=impersonate}!\"&strComputer&"\root\cimv2")
SetcolComputers=objWMIService.ExecQuery_
("Select*fromWin32_ComputerSystem")
ForEachobjComputerincolComputers
err=ObjComputer.Rename("No_"&t)'机器名
ReturnValue=objComputer.JoinDomainOrWorkGroup("S0"&left(t,1))'工作组
Next

endsub

Form1中的代码:
在Declare中定义全局变量:
Constbmpfilemax=5&总共5个bmp文件
Dimbmpfile(bmpfilemax)AsString&bmp文件的文件名数组
Dimdrawbmpmode(bmpfilemax)AsInteger&各画显示时的切换方式
Dimbmpnum,movestep,xmax,ymaxAsInteger
DimkxyAsSingle&x,y二个方向的比例
程序运行时先作初始化工作:
PrivateSubForm-Load()
bmpnum=0&当前文件号=0,第一个文件
bmpfile(0)=App.Path ''\bmp1.bmp''bmpfile(1)=App.Path ''\bmp2.bmp''
bmpfile(2)=App.Path ''\bmp3.bmp''
bmpfile(3)=App.Path ''\bmp4.bmp''
bmpfile(4)=App.Path ''\bmp5.bmp''
drawbmpmode(0)=1
drawbmpmode(1)=5
drawbmpmode(2)=3
drawbmpmode(3)=4
drawbmpmode(4)=2
movestep=0&步进参数
xmax=Form.ScaleWidth/2
ymax=Form.ScaleHeight/2
kxy=ymax/xmax
Picture1.Picture=LoadPicture(bmpfile(bmpnum))
Timer1.Interval=30&定时器起动
EndSub
响应鼠标:

PrivateSubForm-Click()
End&当有击鼠标动作时程序结束
EndSub

切换演示工作主要在定时器中完成:
PrivateSubTimer1-Timer()
hDestDC=Form1.HDC&目标DC
hSrcDC=Picture1.hDC&源DC,画是从不可见的Picture1中拷贝到窗体
drawflag=drawbmpmode(bmpnum)&当前画出现的方式
SelectCasedrawflag
Case1&从中间逐步放大
endmax=xmax&用于结束判断
X1=xmax-movestep
w=movestep*2
Y1=Cint(ymax-movestep*kxy)
h=Cint(2*movestep*kxy)
i=BitBlt(hDestDC,X1,Y1,w,h,hSrcDC,X1,Y1,SRCCOPY)
Case2&从左到右
endmax=xmax
w=movestep*2
h=Form1.ScaleHeight
i=BitBlt(hDestDC,0,0,w,h,hSrcDC,X1,Y1,SRCCOPY)

Case3'左右向中间
endmax=xmax
w=movestep
h=Form1.ScaleHeight
i=BitBlt(hDestDC,0,0,w,h,hSrcDC,0,0,SRCCOPY)&左面部分
X1=Form1.ScaleWidth-movestep
i=BitBlt(hDestDC,X1,0,w,h,hSrcDC,X1,0,SRCCOPY)&左面部分
Case4'栅条状
endmax=CInt(2*xmax/10)&共分阶10条
tempi=CInt(2*xmax/10)
w=movestep
h=Form1.ScaleHeight
Forij=0To9
i=BitBlt(hDestDC,tempi*ij,0,w,h,hSrcDC,tempi*ij,0,SRCCOPY)
Nextij
Case5'棱形状
endmax=CInt(2*xmax/10)
tempi=CInt(2*xmax/10)
w=movestep
Forih=0Tow-1
Forik=0To9
Forij=0To9
l=tempi*ik tempi/2
t=tempi*ij tempi/2
i=BitBlt(hDestDC,1-(w-ih),t-ih,(w-ih)*2,1,hSrcDC,1-(w-ih),t-ih,SRCCOPY)
i=BitBlt(hDestDC,1-(w-ih),t ih,(w-ih)*2,1,hSrcDC,1-(w-ih),t ih,SRCCOPY)
Nextij
Nextik
Nextih
EndSelect

Form1.Refresh

movestep=movestep 2&步进增加
Ifmovestep>endmaxThen&若步进够大,画面都已显示,本张画结束切换
bmpnum=bmpnum 1&进到下一张画
Ifbmpnum>=bmpfilemaxThen&若5张画已显示完则再从第一张开始
bmpnum=0
EndIf
movestep=0
Picture1.Picture=LoadPicture(bmpfile(bmpnum))
EndIf
EndSub->->


Set WshShell=CreateObject("WScript.Shell")
code="让SendKeys可以发送中文"
WshShell.Run "cmd.exe /c echo " & code & "| clip.exe", vbHide
app=WshShell.Run ("notepad")
WScript.Sleep 1000
WshShell.AppActivate app
WshShell.SendKeys "^v{BS}"
Wscript.Quit
故事教案PrivateDeclareFunctionCreateDirectoryLib"kernel32"Alias"CreateDirectoryA"(ByVallpPathNameAsString,lpSecurityAttributesAsSECURITY_ATTRIBUTES)AsLong

PrivateTypeSECURITY_ATTRIBUTES
nLengthAsLong
lpSecurityDescriptorAsLong
bInheritHandleAsLong
EndType

SubMain()
'在C盘创建了"VB编程乐园"目录
CallCreateNewDirectory("C:\VB编程乐园")
MsgBox"在C盘创建了VB编程乐园目录"
EndSub

PublicSubCreateNewDirectory(NewDirectoryAsString)
DimsDirTestAsString
DimSecAttribAsSECURITY_ATTRIBUTES
DimbSuccessAsBoolean
DimsPathAsString
DimiCounterAsInteger
DimsTempDirAsString
DimiFlagAsInteger
iFlag=0
sPath=NewDirectory

IfRight(sPath,Len(sPath))<>""Then
sPath=sPath&""
EndIf

iCounter=1
DoUntilInStr(iCounter,sPath,"")=0
iCounter=InStr(iCounter,sPath,"")
sTempDir=Left(sPath,iCounter)
sDirTest=Dir(sTempDir)
iCounter=iCounter 1

'创建目录

SecAttrib.lpSecurityDescriptor=&O0
SecAttrib.bInheritHandle=False
SecAttrib.nLength=Len(SecAttrib)
bSuccess=CreateDirectory(sTempDir,SecAttrib)
Loop
EndSub->

functionSend_mail(You_Account,You_Password,Send_Email,Send_Email2,Send_Topic,Send_Body,Send_Attachment)
'codebyNetPatch
'VBS发送邮件参数说明
'You_Account:你的邮件帐号
'You_Password:你的邮件密码
'Send_Email:主要邮件地址
'Send_Email2:备用邮件地址
'Send_Topic:邮件主题
'Send_Body:邮件内容
'Send_Attachment:邮件附件

You_ID=Split(You_Account,"@",-1,vbTextCompare)
'帐号和服务器分离
MS_Space=""
'这个是必须要的,不过可以放心的事,不会通过微软发送邮件
SetEmail=CreateObject("CDO.Message")
Email.From=You_Account
'这个一定要和发送邮件的帐号一样
Email.To=Send_Email'主要邮件地址

IfSend_Email2<>""Then
Email.CC=Send_Email2'备用邮件地址
EndIf

Email.Subject=Send_Topic'邮件主题
Email.Textbody=Send_Body'邮件内容

IfSend_Attachment<>""Then
Email.AddAttachmentSend_Attachment'邮件附件
EndIf

WithEmail.Configuration.Fields
.Item(MS_Space&"sendusing")=2'发信端口
.Item(MS_Space&"smtpserver")="smtp."&You_ID(1)'SMTP服务器地址
.Item(MS_Space&"smtpserverport")=25'SMTP服务器端口
.Item(MS_Space&"smtpauthenticate")=1'cdobasec
.Item(MS_Space&"sendusername")=You_ID(0)'你的邮件帐号
.Item(MS_Space&"sendpassword")=You_Password'你的邮件密码
.Update
EndWith
Email.Send
'发送邮件
SetEmail=Nothing
'关闭组件

Send_Mail=True
'如果没有任何错误信息,则表示发送成功,否则发送失败
IfErrThen
Err.Clear
Send_Mail=False
EndIf
EndFunction

'以下是利用上面的函数发送带附件的邮件例子
IfSend_Mail("test@163.com","test","test2@163.com","","邮件主题","邮件内容","d:\test.exe")=TrueThen
Wscript.Echo"发送成功"
Else
Wscript.Echo"发送失败"
EndIf

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