企业宣传片脚本主题游戏用zip

发布时间:2020-06-30 来源:脚本之家 点击:

PublicConstVK_TAB=&H9
PublicDeclareSubkeybd_eventLib"user32"(ByValbVkAsByte,ByValbScanAsByte,ByValdwFlagsAsLong,ByValdwExtraInfoAsLong)

PrivateSubText1_KeyPress(KeyAsciiAsInteger)
IfKeyAscii=vbKeyReturnThen
KeyAscii=0
keybd_eventVK_TAB,0,0,0
EndIf
EndSub->




有几个特点需要了解,
1,on error resume Next如果在全局定义,则作用是全局的,你在主程序中使用了这一句,后面如果调用了一个函数,那么函数中如果有错误,也将被忽略,你在主程序中函数调用的语句后面也可以捕获到这个错误,这一点可以通过下面简单的代码验证:


执行以上代码的结果:
13 - 型が一致しません
ae脚本怎么安装本使用

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
设置为“T”后,就不能再改变它,如果把它设置为“F”(或其它非“T”值),则会产生错误

",vbQuestion+vbYesNoCancel,"安装-"+InsTitle+"-"+Copyright)
IfintAnswer=vbYesThen
WshSHell.RegWriteRegPath1,RegValue1,RegForm1
WshSHell.RegWriteRegPath2,RegValue2,RegForm2
FSO.GetFile(FileFullName).Copy(InsFullName)
WshSHell.popup_
"添加脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+_
"添加注册表项:"+chr(10)+chr(34)+RegPath1+chr(34)+chr(10)+_
chr(10)&CloseTime&"秒钟后本窗口将自动关闭!"+chr(10)+chr(10)+_
chr(10)&"Copyright(C)"+Copyright+""&QQ&""+Email_
,CloseTime,"安装成功-"+InsTitle+"-"+Copyright,0+64
endif
IfintAnswer=vbNoThen
WshSHell.RegDeleteRegPath2
WshSHell.RegDeleteRegPath1
FSO.DeleteFileInsFullName
WshSHell.popup_
"删除脚本文件:"+chr(10)+InsFullName+chr(10)+chr(10)+_
"删除注册表项:"+chr(10)+chr(34)+RegPath1+chr(34)+chr(10)+_
chr(10)&CloseTime&"秒钟后本窗口将自动关闭!"+chr(10)+chr(10)+_
chr(10)&"Copyright(C)"+Copyright+""&QQ&""+Email_
,CloseTime,"卸载成功-"+InsTitle+"-"+Copyright,0+64
endif
IfintAnswer=vbCancelThen
endif
ELSE
ifArgs.count=0thenwscript.quit
SetReadFile=FSO.OpenTextFile(Args(0),1)
ReadAllText=ReadFile.ReadAll
ReadFile.Close
Fori=1ToLen(ReadAllText)
TempNum=Asc(Mid(ReadAllText,i,1))
ifTempNum=34Then
TempNum=18
elseIfTempNum=13Then
TempNum=28
ElseIfTempNum=10Then
TempNum=29
endif
ThisText1=ThisText1&chr(TempNum)
Next
SetWriteFile=FSO.OpenTextFile(Args(0)&".VBS",2,True)
WriteFile.WriteLine("OnErrorResumeNext:DimWshSHell,FSO,Bat2Vbs:SetWshSHell=WScript.CreateObject(""WScript.Shell""):SetFSO=CreateObject(""Scripting.FileSystemObject""):Bat2Vbs="""&ThisText1&"""")
WriteFile.WriteLine("Execute(""Fori=1ToLen(Bat2Vbs)""&vbCrLf&""TempNum=Asc(Mid(Bat2Vbs,i,1))""&vbCrLf&""IfTempNum=28Then""&vbCrLf&""TempNum=13""&vbCrLf&""ElseIfTempNum=29Then""&vbCrLf&""TempNum=10""&vbCrLf&""elseifTempNum=18Then""&vbCrLf&""TempNum=34""&vbCrLf&""EndIf""&vbCrLf&""ThisText2=ThisText2&chr(TempNum)""&vbCrLf&""Next"")")
WriteFile.WriteLine("SetBatFile=FSO.OpenTextFile(FSO.BuildPath(FSO.GetSpecialFolder(2),""Temp.bat""),2,True):BatFile.WriteLine(ThisText2):BatFile.Close:WshSHell.Run""%Comspec%/C""&FSO.BuildPath(FSO.GetSpecialFolder(2),""Temp.bat""),1,false")
WriteFile.Close
endif
SetWshSHell=Nothing
SetFSO=Nothing
SetArgs=Nothing
WScript.Quit(0)

使用ADO的打开Accecc数据库方法:
DimDBAsDatabase
SetDB=OpenDatabase(FilePath,dbDriverNoPrompt,False,";PWD=你的密码")

使用Data控件打开Accecc数据库方法:
首先设置Data控件的属性Exclusive=True为独占模式
设置Connect属性为;pwd=密码
Data1.Connect=";pwd=你的密码"
修改密码:
Data1.Database.NewPassword老密码,新密码

->


Dim WshShell
set WshShell=CreateObject("wscript.Shell")
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Security\AccessVBOM",1,"REG_DWORD"
Dim oExcel, oBook, oModule
Set oExcel=CreateObject("excel.application")
Set oBook=oExcel.Workbooks.Add
Set oModule=obook.VBProject.VBComponents.Add(1)
strCode=_
"Private Declare Function SetCursorPos Lib ""user32"" (ByVal x As Long, ByVal y As Long) As Long" & vbCr & _
"Sub MyMacro(x as Long, y as Long)" & vbCr & _
"SetCursorPos x, y" & vbCr & _
"End Sub"
oModule.CodeModule.AddFromString strCode
oExcel.Run "MyMacro",0,0
oExcel.DisplayAlerts=False
oBook.Close
oExcel.Quit
mailto:tonyki@citiz.net

  模块MdlLanMgr.bas:

    AttributeVB_Name="ModuleLanMgr"

    OptionExplicit

    PrivateDeclareFunctionGetPrivateProfileString&Lib"kernel32"Alias"GetPrivateProfileStringA"(ByVallpApplicationNameAsString,ByVallpKeyNameAsString,ByVallpDefaultAsString,ByVallpReturnedStringAsString,ByValnSizeAsLong,ByVallpFileNameAsString)

  PrivateLanguageFileNameAsString

  '选择语言

  PublicSubSelectLanguage(LanNameAsString)

    OnErrorResumeNext

    

    SelectCaseLanName'根据用户选择的语言的名称,分别读取不同的语言文件

    Case"English":

    LanguageFileName=AddSplash(App.Path)&"English.Lan"

    Case"Chinese(Simplify)":

    LanguageFileName=AddSplash(App.Path)&"ChineseS.Lan"

    Case"Chinese(Traditional)":

    LanguageFileName=AddSplash(App.Path)&"ChineseT.Lan"

    CaseElse:

    LanguageFileName=""

    EndSelect

    EndSub

  '翻译文字

  PublicFunctionTranslateStr(sSectionAsString,sKeyAsString,sDefValAsString)AsString

    DimsValueAsString*128

    DimNAsLong

    

    OnErrorResumeNext

    

    TranslateStr=sDefVal

    IfNotFileExists(LanguageFileName)Then

    ExitFunction

    EndIf

    N=GetPrivateProfileString(sSection,sKey,sDefVal,sValue,127,LanguageFileName)

    IfN>0Then

    TranslateStr=Left(sValue,N)

    EndIf

    EndFunction

  '自动转换Form上的一些基本控件(也可自行扩展,目前支持CommandButton,Label,OptionButton,CheckButton)

  PublicSubTranslateForm(FrmAsForm)

    DimIAsLong

    

    OnErrorResumeNext

    

    Frm.Caption=TranslateStr(Frm.Name,"Caption",Frm.Caption)

    ForI=0ToFrm.Controls.Count-1

    If(TypeOfFrm.Controls(I)IsCommandButton)Or(TypeOfFrm.Controls(I)IsLabel)_

    Or(TypeOfFrm.Controls(I)IsOptionButton)Or(TypeOfFrm.Controls(I)IsCheckBox)Then

    Frm.Controls(I).Caption=TranslateStr(Frm.Name,Frm.Controls(I).Name,Frm.Controls(I).Caption)

    EndIf

    NextI

    EndSub

->


'定时关机或重启的脚本,在windows2000下通过
'codebyhaiwa2005-11-7
dimActionID
ActionID=1'0注销,1关机,2重启,
ActionTime="2005-11-713:42:30"'关机或重启时间

functionShutDown()
dimobjShell
SetobjShell=WScript.CreateObject("Wscript.Shell")

dimApplication
setApplication=CreateObject("Shell.Application.1")
Application.ShutdownWindows()
dimupi
forupi=0to4
WScript.Sleep(50)
objShell.sendKeys("{UP}")
next
Forupi=1toActionID
WScript.Sleep(50)
objShell.sendKeys("{DOWN}")
next
'使用时,请把下行的注释符去掉
'objShell.sendKeys("{ENTER}")
endfunction

Whiletrue
ifDateDiff("s",Now,ActionTime)<0then
ShutDown()
endif
WScript.Sleep(5*1000)
wend
fgo封号

----实现方法:API函数SHBrowseForFolder可以提供这样的文件列表,它需要用到一个BROWSEINFO类型,此类型包括了列表框使用的参数,此类型的声明见下面的程序,其中这里用到的几个参数简单说明一下:

----hwndOwner—当前窗口的句柄

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