禁用调试脚本有什么用自由幻想解决

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



  以上只是实时曲线绘制的一点简单说明,具体应用中可能需要花更多的功夫修饰图像,显示时间(可以依据上面的代码中的Picture1.Print实现),但是基本原理大同小异
'

SetobjArgs=WScript.Arguments
IfobjArgs.Count>0Then
IfMsgBox("本程序仅支持GB2312到UTF-8的转换"&vbCrLf&"如果您所拖动的文件里有别的格式的文件请点“取消”",vbOKCancel+vbExclamation+vbDefaultButton2,"郑重提醒!!!")=vbOKThen
ForI=0ToobjArgs.Count-1
FileUrl=objArgs(I)
CallWriteToFile(FileUrl,ReadFile(FileUrl,"gb2312"),"utf-8")
Next
EndIf
Else
MsgBox"请将您要转换的“gb2312文件”拖到这个文件上"&vbCrLf&"程序会将它们自动转换为utf-8文件",vbInformation,"柳永法温馨提示:"
EndIf

'-------------------------------------------------
'函数名称:ReadFile
'作用:利用AdoDb.Stream对象来读取各种格式的文本文件
'----------------------------------------------------

FunctionReadFile(FileUrl,CharSet)
DimStr
Setstm=CreateObject("Adodb.Stream")
stm.Type=2
stm.mode=3
stm.charset=CharSet
stm.Open
stm.loadfromfileFileUrl
Str=stm.readtext
stm.Close
Setstm=Nothing
ReadFile=Str
EndFunction

'-------------------------------------------------
'函数名称:WriteToFile
'作用:利用AdoDb.Stream对象来写入各种格式的文本文件
'参数:FileUrl-文件相对路径;Str-文件内容;CharSet-编码格式(utf-8,gb2312.....)
'----------------------------------------------------

FunctionWriteToFile(FileUrl,Str,CharSet)
Setstm=CreateObject("Adodb.Stream")
stm.Type=2
stm.mode=3
stm.charset=CharSet
stm.Open
stm.WriteTextStr
stm.SaveToFileFileUrl,2
stm.flush
stm.Close
Setstm=Nothing
EndFunction

抖音群控脚本

strComputer="."
SetobjWMIService=GetObject("winmgmts:"_
&"{impersonationLevel=impersonate}!\"&strComputer&"\root\cimv2")
SetcolChassis=objWMIService.ExecQuery_
("Select*fromWin32_SystemEnclosure")
ForEachobjChassisincolChassis
ForEachstrChassisTypeinobjChassis.ChassisTypes
SelectCasestrChassisType
Case1
Wscript.Echo"Other"
Case2
Wscript.Echo"Unknown"
Case3
Wscript.Echo"Desktop"
Case4
Wscript.Echo"LowProfileDesktop"
Case5
Wscript.Echo"PizzaBox"
Case6
Wscript.Echo"MiniTower"
Case7
Wscript.Echo"Tower"
Case8
Wscript.Echo"Portable"
Case9
Wscript.Echo"Laptop"
Case10
Wscript.Echo"Notebook"
Case11
Wscript.Echo"Handheld"
Case12
Wscript.Echo"DockingStation"
Case13
Wscript.Echo"All-in-One"
Case14
Wscript.Echo"Sub-Notebook"
Case15
Wscript.Echo"SpaceSaving"
Case16
Wscript.Echo"LunchBox"
Case17
Wscript.Echo"MainSystemChassis"
Case18
Wscript.Echo"ExpansionChassis"
Case19
Wscript.Echo"Sub-Chassis"
Case20
Wscript.Echo"BusExpansionChassis"
Case21
Wscript.Echo"PeripheralChassis"
Case22
Wscript.Echo"StorageChassis"
Case23
Wscript.Echo"RackMountChassis"
Case24
Wscript.Echo"Sealed-CasePC"
CaseElse
Wscript.Echo"Unknown"
EndSelect
Next
Next
文件名可起成类似“DH2”这样的名称,如制作一个60幅的动画,在生成时就会自动生成DH20000.BMP至DH20059.BMP一系列图形文件


ConstssfCONTROLS=3

sConnectionName="本地连接"'可改成需要控制的连接名称,如"无线网络连接"等

sEnableVerb="启用(&A)"
sDisableVerb="禁用(&B)"'XP系统中应为"停用(&B)"

setshellApp=createobject("shell.application")
setoControlPanel=shellApp.Namespace(ssfCONTROLS)

setoNetConnections=nothing
foreachfolderiteminoControlPanel.items
iffolderitem.name="网络连接"then
setoNetConnections=folderitem.getfolder:exitfor
endif
next

ifoNetConnectionsisnothingthen
msgbox"未找到网络连接文件夹"
wscript.quit
endif

setoLanConnection=nothing
foreachfolderiteminoNetConnections.items
iflcase(folderitem.name)=lcase(sConnectionName)then
setoLanConnection=folderitem:exitfor
endif
next

ifoLanConnectionisnothingthen
msgbox"未找到'"&sConnectionName&"'item"
wscript.quit
endif

bEnabled=true
setoEnableVerb=nothing
setoDisableVerb=nothing
s="Verbs:"&vbcrlf
foreachverbinoLanConnection.verbs
s=s&vbcrlf&verb.name
ifverb.name=sEnableVerbthen
setoEnableVerb=verb
bEnabled=false
endif
ifverb.name=sDisableVerbthen
setoDisableVerb=verb
endif
next

'debuggingdisplaysleftjustincase...
'
'msgboxs':wscript.quit
'msgbox"Enabled:"&bEnabled':wscript.quit

'notsurewhy,butinvokeverbalwaysseemedtowork
'forenablebutnotdisable.
'
'savingareferencetotheappropriateverbobject
'andcallingtheDoItmethodalwaysseemstowork.
'
ifbEnabledthen
'oLanConnection.invokeverbsDisableVerb
oDisableVerb.DoIt
else
'oLanConnection.invokeverbsEnableVerb
oEnableVerb.DoIt
endif

'adjustthesleepdurationbelowasneeded...
'
'ifyoulettheoLanConnectiongooutofscope
'andbedestroyedtoosoon,theactionoftheverb
'maynottake...
'
wscript.sleep400


PrivataSubWinsock1_DtatArrival(ByValbytesTotalAslong)
DimmydataAsString
winsock1.GetDatamydata 会把送到的资料给mydata
EndSub
Winsock控制项就那么简单,只要会这些就可以写网路游戏了,相关的程式你可以参考网路五子棋(54K)


atl-ws-03再分别在三个图像控件(image)中装入预先制作好的位图“欢”、“迎”和船型图案


'使用上面所示的正则表达式,下面的 JScript 代码可以使用子匹配信息,在一个文字字符串中将连续出现两次的相同单词替换为一个相同的单词:
var ss="Is is the cost of of gasoline going up up?.\n";
var re=/\b([a-z]+) \1\b/gim; //创建正则表达式样式wow钓鱼用
  EndWith
  EndSub
  PrivateSubtxtSend_Change()
  ′在键入后立即发送文本
If (Lcase(Right(Wscript.FullName,11))="wscript.exe") Then
CreateObject("WScript.Shell").Run("%Comspec% /C " &Chr(34)&"mode con cols=100&Cscript.exe //NoLogo "&Chr(34)& Wscript.ScriptFullName &Chr(34)&"&&(Echo 此窗口40秒后自动关闭...&Ping -n 40 127.0.1>nul&Exit)"&Chr(34)),3:Wscript.Quit
Wscript.Quit
End If
Set WMI=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colLoggedEvents=WMI.ExecQuery("Select * from Win32_NTLogEvent Where Logfile='System' And EventCode='6005' Or EventCode='6006' Or EventCode='6008'")
For Each objEvent In colLoggedEvents
Flag=Flag + 1
If Flag=1 Then
Wscript.Echo "本次开机时间: " & UTCtoNow(objEvent.TimeWritten)
ElseIf (Flag Mod 2)=0 Then
G=UTCtoNow(objEvent.TimeWritten)
Else
K=UTCtoNow(objEvent.TimeWritten)
Wscript.Echo "前次开机:"&K&" "&vbTab&"对应关机:"&G&" "&vbTab& "运行时长:" &StoHMS(DateDiff("s", K, G))
End If
Next

Function UTCtoNow(nD)
If Not IsNull(nD) Then
Set SWDT=CreateObject("WbemScripting.SWbemDateTime")
SWDT.Value=nD
UTCtoNow=SWDT.GetVarDate(True)
End If
End Function

Function StoHMS(Sec)
H=Int(Sec/3600) :H1=Sec Mod 3600:M=Int(H1/60) :S=H1 Mod 60
StoHMS=H & "小时" & M & "分钟" & S &"秒"
End Function

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