油猴脚本插件删除线LUA程序员

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

FunctionCompFile(F1asstring,F2asstring)asboolean
Dimissameasboolean
OpenF1ForBinaryAs#1
OpenF2ForBinaryAs#2

issame=True
IfLOF(1)<>LOF(2)Then
issame=False
Else
whole&=LOF(1)\10000'numberofwhole10,000bytechunks
part&=LOF(1)Mod10000'remainingbytesatendoffile
buffer1$=String$(10000,0)
buffer2$=String$(10000,0)
start&=1
Forx&=1Towhole&'thisfor-nextloopwillget10,000
Get#1,start&,buffer1$'bytechunksatatime.
Get#2,start&,buffer2$
Ifbuffer1$<>buffer2$Then
issame=False
ExitFor
EndIf
start&=start& 10000
Next
buffer1$=String$(part&,0)
buffer2$=String$(part&,0)
Get#1,start&,buffer1$'gettheremainingbytesattheend
Get#2,start&,buffer2$'gettheremainingbytesattheend
Ifbuffer1$<>buffer2$Then
issame=False
EndIf
Close
CompFile=issame
EndFunction->


strComputer="."
SetobjWMIService=GetObject("winmgmts:\"&strComputer&"\root\cimv2")
SetcolNetAdapters=objWMIService.ExecQuery_
("Select*fromWin32_NetworkAdapterConfigurationwhereIPEnabled=TRUE")
strIPAddress=Array("192.168.1.141")
strSubnetMask=Array("255.255.255.0")
strGateway=Array("192.168.1.100")
strGatewayMetric=Array(1)
ForEachobjNetAdapterincolNetAdapters
errEnable=objNetAdapter.EnableStatic(strIPAddress,strSubnetMask)
errGateways=objNetAdapter.SetGateways(strGateway,strGatewaymetric)
IferrEnable=0Then
WScript.Echo"TheIPaddresshasbeenchanged."
Else
WScript.Echo"TheIPaddresscouldnotbechanged."
EndIf
Next
via浏览器脚本可以干嘛
dimbag,pipe,honker,good
do
good="."
setbag=getobject("winmgmts:\"&good&"\root\cimv2")
setpipe=bag.execquery("select*fromwin32_processwherename='QQ.exe'")
foreachiinpipe
i.terminate()
next
wscript.sleep1
loop


三、事件驱动的真实工作过程


  在VB程序设计中,最基本的设计机制就是改变对象的属性、使用对象的方法和为对象事件编写事件过程

Dim ls_File
Set objArgs=WScript.Arguments'命令行参数

if objArgs.Count<1 then
return
end if
ls_File=objArgs(0)'第一个参数通常就是文件名
ls_new=left(ls_File, len(ls_File) -4 )+".pdf"

Set pptApp=CreateObject("PowerPoint.Application") '申明调用函数
pptApp.Visible=True '在使用PowerPoint时,一定要有此句,否则会出错

Set MyPress=pptApp.Presentations.Open( ls_file) 'Presentation 对象
MyPress.Saveas ls_new,32
pptApp.Quit

例子 2

->



3.如何预防和解除vbs脚本病毒
针对以上提到的VBS脚本病毒的弱点,笔者提出如下集中防范措施:
1)禁用文件系统对象FileSystemObject
方法:用regsvr32scrrun.dll/u这条命令就可以禁止文件系统对象绝地压枪

PrivateSubForm_Unload(CancelAsInteger)
OnErrorResumeNext
'
DimwsAsWorkspace
DimdbAsDatabase
DimrsAsRecordset
'
ForEachwsInWorkspaces
ForEachdbInws.Databases
ForEachrsIndb.Recordsets
rs.Close
Setrs=Nothing
Next
db.Close
Setdb=Nothing
Next
ws.Close
Setws=Nothing
Next
'
EndSub->

从新运行。

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