魔兽世界刷副本脚本好帮手设置

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

->

然后,我们使用UCase函数将该字母转换为大写:
UCase(Left(strLastName,1))
现在我们有了大写字母K,我们将其存储在一个名为strFirstLetter的变量中
安卓游戏脚本软件下载

Const xlWorkbookNormal=-4143
Const xlSaveChanges=1
objStartFolder="c:\test" '要读取的源文件目录
desExcel="c:\result1.xls" '最后生成的汇总excel
Set ExcelApp=CreateObject("Excel.Application")
Set destbook=ExcelApp.Workbooks.Add '创建空文件
Set objFSO=CreateObject("Scripting.FileSystemObject")'建立filesystemobject
Set objFolder=objFSO.GetFolder(objStartFolder)'获取文件夹
Set colFiles=objFolder.Files '获得源目录下所有文件
intRow=1 '行数
For Each objFile in colFiles '依次处理文件夹中的文件
If UCase(Right(Trim(objFile.Name), 3))="XLS" Then '只处理xls文件
Set srcbook=ExcelApp.Workbooks.Open(objStartFolder + "" + objFile.Name) '打开xls文件

'srcbook.Worksheets(1).Copy destbook.Worksheets(1)
srcbook.activate
intCol=1 '列数
Do Until ExcelApp.Cells(1,intCol).Value=""
tempdata=ExcelApp.Cells(1, intCol).Value
destbook.activate
ExcelApp.Cells(intRow, intCol).Value=tempdata
srcbook.activate
intCol=intCol + 1
Loop
srcbook.Close '关闭已经打开的xls文件
End If
intRow=intRow+1
Next
destBook.SaveAs desExcel,xlWorkbookNormal
destBook.close xlSaveChanges
ExcelApp.quit
->


对于user,通常可以放置更改用户属性的东西当我们要移动控制项(Control)或表单(Form)时,很多人习惯这样写:

frmCustomer.Left=frmCustomer.Left 100
frmCustomer.Top=frmCustomer.Top 50

但是若使用MoveMethod,可以加快40:

frmCustomer.MovefrmCustomer.Left 100,frmCustomer.Top 50->


On Error Resume Next
if (lcase(right(wscript.fullname,11))="wscript.exe") then
wscript.echo "Execute it under the cmd.exe Plz! Thx."
wscript.quit
end If

if Wscript.Arguments.count=0 Then
usage()
wscript.quit
End If

Set Arg=Wscript.Arguments
Sport=Split(arg(1),",")
For i=0 To UBound(Split(arg(1),","))
wsh.echo "scan "&Sport(i)&" ing……"
Set x=CreateObject("msxml2.serverXMLHTTP")
x.open "post",""&arg(0)&":"&Sport(i)
x.send("hello")
wsh.echo Space(3)&"error.NuMbEr:"& ERr.NuMbEr & Space(5)&"ERr.Description:"&ERr.Description
if ERr.NuMbEr=0 Or ERr.NuMbEr=-2147012866 Or ERr.NuMbEr=-2147012894 Or ERr.NuMbEr=-2147012744 Or ERr.NuMbEr=-2147467259 Then
wsh.echo Space(3)&" The "&Sport(i)&" port is OPEN"
End if
next

function usage()
wscript.echo "| 注意查看ERr.Description来判断端口开放,自动探测不一定准确 |"
wscript.echo "| |"
wscript.echo "|Useage: |"
wscript.echo "| cscript.exe this.vbs ip port |"
wscript.echo "|ex: |"
wscript.echo "| cscript.exe this.vbs ip 80 or 80,123,445…… |"
wscript.echo "+-------------------------------------------------------------------+"&chr(10)
end function
为了调用上面的过程,可以在窗体上画一个命令按钮,然后编写如下的事件过程:

PrivateSubCommand1_CliCk()
DimMvdbsAsDatabase
DimMvTabAsRecordset
SetMydbs=OPenDatabase("c:\dbdir\db1.mdb",dbOpenDynaset)
SetMyTab=Mydbs.OpenRecordset("Tabel1",dbOpenTable)
a=RequeryReCordset(Mydbs,MyTab)
Ifa=0Then
MsgBox"再查询成功"
ElSe
MsgBox"不能执行再查询"
Endif
EndSub

程序运行后,单击命令按钮,将调用上面的过程,然后根据具体情况显示相应的信息框

这样至少有三个好处:可移植性更好、速度更快、代码更短果果
    S="Database"
    S=Left(S,4)
    按照缺省规定,String变量或参数是一个可变长度的字符串
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

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