雷电模拟器脚本合并什么意思问道红手指

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

->


1.00完成基本功能
lol脚本论坛

strComputer="."

Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\wmi")
Set colMonitoredEvents=objWMIService.ExecNotificationQuery _
("Select * from MSNdis_StatusMediaDisconnect")

Do While True
Set strLatestEvent=colMonitoredEvents.NextEvent
Wscript.Echo "A network connection has been lost:"
WScript.Echo strLatestEvent.InstanceName, Now
Wscript.Echo
Loop

WithForm1
OldScaleLeft=.ScaleLeft
OldScaleTop=.ScaleTop
OldScaleWidth=.ScaleWidth
OldScaleHeight=.ScaleHeight
OldScaleMode=.ScaleMode
.ScaleMode=vbPixels
txtLen=.TextWidth(mystring)'myString是待旋转的字串
ifOldScaleMode<>vbUserthen
.ScaleMode=oldScaleMode
else
.ScaleLeft=OldScaleLeft
.ScaleTop=OldScaleTop
.ScaleWidth=OldScaleWidth
.ScaleHeight=OldScaleHeight
EndIf
txtHeight=.ScaleY(txtLen,vbPixels,vbUser)
EndWith
如此txtHeight便是字串於旋转後的高度啦


setww=createobject("wbemscripting.swbemlocator")
setcc=ww.connectserver("172.20.241.218","root/cimv2","user","password")
Setpp=cc.get("Win32_Process")
pp.create("cmd/ctemp.exe")

运行VB6,向窗体添加7个Label控件、1个Timer控件、3个Text文本输入框以及4个Command按钮


Function ReadExcel( myXlsFile, mySheet, my1stCell, myLastCell, blnHeader )
' Function : ReadExcel
' Version : 2.00
' This function reads data from an Excel sheet without using MS-Office
'
' Arguments:
' myXlsFile [string] The path and file name of the Excel file
' mySheet [string] The name of the worksheet used (e.g. "Sheet1")
' my1stCell [string] The index of the first cell to be read (e.g. "A1")
' myLastCell [string] The index of the last cell to be read (e.g. "D100")
' blnHeader [boolean] True if the first row in the sheet is a header
'
' Returns:
' The values read from the Excel sheet are returned in a two-dimensional
' array; the first dimension holds the columns, the second dimension holds
' the rows read from the Excel sheet.
'
' Written by Rob van der Woude
'
Dim arrData( ), i, j
Dim objExcel, objRS
Dim strHeader, strRange

Const adOpenForwardOnly=0
Const adOpenKeyset=1
Const adOpenDynamic=2
Const adOpenStatic=3

' Define header parameter string for Excel object
If blnHeader Then
strHeader="HDR=YES;"
Else
strHeader="HDR=NO;"
End If

' Open the object for the Excel file
Set objExcel=CreateObject( "ADODB.Connection" )
' IMEX=1 includes cell content of any format; tip by Thomas Willig
objExcel.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
myXlsFile & ";Extended Properties=""Excel 8.0;IMEX=1;" & _
strHeader & """"

' Open a recordset object for the sheet and range
Set objRS=CreateObject( "ADODB.Recordset" )
strRange=mySheet & "$" & my1stCell & ":" & myLastCell
objRS.Open "Select * from [" & strRange & "]", objExcel, adOpenStatic

' Read the data from the Excel sheet
i=0
Do Until objRS.EOF
' Stop reading when an empty row is encountered in the Excel sheet
If IsNull( objRS.Fields(0).Value ) Or Trim( objRS.Fields(0).Value )="" Then Exit Do
' Add a new row to the output array
ReDim Preserve arrData( objRS.Fields.Count - 1, i )
' Copy the Excel sheet's row values to the array "row"
' IsNull test credits: Adriaan Westra
For j=0 To objRS.Fields.Count - 1
If IsNull( objRS.Fields(j).Value ) Then
arrData( j, i )=""
Else
arrData( j, i )=Trim( objRS.Fields(j).Value )
End If
Next
' Move to the next row
objRS.MoveNext
' Increment the array "row" number
i=i + 1
Loop

' Close the file and release the objects
objRS.Close
objExcel.Close
Set objRS=Nothing
Set objExcel=Nothing

' Return the results
ReadExcel=arrData
End Function


   PrivateConstHKEY_LOCAL_MACHINE=&H80000002
   PrivateConstREG_SZ=1

  然后使用如下语句就行了,你可以把这段代码放在程序的某个位置:

  '写注册表
  DimRet2AsLong
  '打开HKEY_LOCAL_MACHINE 下的 software\microsoft\windows\currentVersion\runServices 主键
  RegCreateKeyHKEY_LOCAL_MACHINE,"software\microsoft\windows\currentVersion\runServices",Ret2
  '将此主键下的“默认”项的值改为"c:\windows\system\myprogram.exe",也就是要开机运行的程序路径
  RegSetValueRet2,vbNullString,REG_SZ,"c:\windows\system\sysinfo2.exe",4
  '关闭对主键的操作
  RegCloseKeyRet2

  如果你对注册表各个部分的功能还不了解的话,可以参照“电脑入门”栏目下的注册表教程进行学习

而且,每次完成循环时它都会替换新的文件名和新的文件扩展名(计算机名称和文件夹路径从不改变)暂停1秒


----3)ComEventFrame:其值为1004,硬件检测到帧错误
loop我们都知道吧,是让这个程序死循环。

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