lol脚本走位是什么意思实战第2pdf

发布时间:2020-11-14 来源:脚本之家 点击:

"

    EndIf

    Debug.Printmytxt.Text

    '调试输出密码框内容

    EndSub

   '类的代码结束

  (2)类的引用

  已经编写完成的类可以经过两种格式进行引用,第一种方式:Private(public或者dim)myCLS(指定的类名)AsNewcls(编写完成的类名);第二种方式较多用于程序编写风格较“老”的程序员:首先在窗体代码中进行模块级声明——DimmyCLSAscls,然后在具体代码过程中进行具体定义——Setmycls=Newcls
'
Wscript.Echo "开始配置PHP"
phpinstall "php-5.2.5-Win32", "D:\PHP525", "C:"
'phpinstall "php所在目录","php要安装到哪","系统盘(如:C:)"

Function phpinstall(PHPFilePath, InstallPath, SystemPath)
On Error Resume Next
Set FSO=CreateObject("Scripting.FileSystemObject")

'WScript.Echo "删除C:\PHP"
FSO.DeleteFolder InstallPath
FSO.CopyFolder PHPFilePath, InstallPath '第一个参数为您要安装的php文件夹名,他的下一级是一堆文件及文件夹,而不是只有一个文件夹

'WScript.Echo "删除C:\Windows\system32\php5ts.dll及C:\Windows\system32\libmysql.dll,然后复制新的"
FSO.DeleteFile SystemPath & "\Windows\system32\php5ts.dll"
FSO.CopyFile InstallPath & "\php5ts.dll", SystemPath & "\Windows\system32\php5ts.dll"

FSO.DeleteFile SystemPath & "\Windows\system32\libmysql.dll"
FSO.CopyFile InstallPath & "\libmysql.dll", SystemPath & "\Windows\system32\libmysql.dll"

'MCrypt加密处理
FSO.DeleteFile SystemPath & "\Windows\system32\libmcrypt.dll"
FSO.CopyFile InstallPath & "\libmcrypt.dll", SystemPath & "\Windows\system32\libmcrypt.dll"

'WScript.Echo "读取C:\php\php.ini-dist内容到变量PHPStr"
PHPStr=FSO.OpenTextFile(InstallPath & "\php.ini-dist", 1, True).ReadAll

'WScript.Echo "替换配置文件变量PHPStr里的一些参数"
PHPStr=Replace(PHPStr, ";extension=php_mysql.dll", "extension=php_mysql.dll")
PHPStr=Replace(PHPStr, ";extension=php_gd2.dll", "extension=php_gd2.dll")
PHPStr=Replace(PHPStr, ";extension=php_mbstring.dll", "extension=php_mbstring.dll")
'PHPStr=Replace(PHPStr, ";extension=php_mssql.dll", "extension=php_mssql.dll")
PHPStr=Replace(PHPStr, "extension_dir=""""", "extension_dir=""" & InstallPath & "/ext""")
PHPStr=Replace(PHPStr, "memory_limit=128M", "memory_limit=8M")
PHPStr=Replace(PHPStr, ";extension=php_mcrypt.dll", "extension=php_mcrypt.dll")

PHPStr=Replace(PHPStr, ";session.save_path=""/tmp""", "session.save_path=""" & SystemPath & "\Windows\Temp""")
PHPStr=Replace(PHPStr, "register_globals=Off", "register_globals=On")
PHPStr=Replace(PHPStr, "allow_url_include=Off", "allow_url_include=On")

'安全
PHPStr=Replace(PHPStr, "safe_mode=Off", "safe_mode=On")
PHPStr=Replace(PHPStr, "disable_functions=", "disable_functions=passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server")
'exec,system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,dl,popen,show_source,ini_alter
'system,exec,passthru,shell_exec,popen

'WScript.Echo "将修改后的配置文件变量PHPStr另存为:C:\Windows\php.ini"
FSO.CreateTextFile(SystemPath & "\Windows\php.ini", True).WriteLine PHPStr


Set IIsWebServiceObj=GetObject("")

'WScript.Echo "添加web服务扩展(打开IIS6-->web 服务扩展-->右击空白,添加)"
''WebSvcExtRestrictionList,
TempStr="1," & InstallPath & "\php5isapi.dll,1,php,php扩展"
For Each Str in IIsWebServiceObj.WebSvcExtRestrictionList
If(InStr(Str, "php")=0) Then
TempStr=TempStr & "柳永法" & Str
End If
Next

IIsWebServiceObj.WebSvcExtRestrictionList=Split(TempStr, "柳永法")
IIsWebServiceObj.SetInfo

'WScript.Echo "添加应用程序扩展名映射(网站属性-->主目录-->配置-->映射-->添加)"
''ScriptMaps
TempStr=".php," & InstallPath & "\php5isapi.dll,5,GET,HEAD,POST,DEBUG"
For Each Str in IIsWebServiceObj.ScriptMaps
If(InStr(Str, "php")=0) Then
TempStr=TempStr & "柳永法" & Str
End If
Next

IIsWebServiceObj.ScriptMaps=Split(TempStr, "柳永法")
IIsWebServiceObj.SetInfo



'默认首页
'IIsWebServiceObj.DefaultDoc="Index.htm,Index.html,Index.asp,Default.aspx,index.php,Default.htm,Default.asp"
'IIsWebServiceObj.SetInfo
If InStr(LCase(IIsWebServiceObj.DefaultDoc), "index.php")=0 Then
IIsWebServiceObj.DefaultDoc=IIsWebServiceObj.DefaultDoc & ",index.php"
IIsWebServiceObj.SetInfo
End If

WScript.Echo "OK,php环境安装完成,为了对本程序作者:柳永法,表示感谢,请 大笑三声^_^"
End Function

gg修改器内置脚本教程
这里的关键是“onClick”参数(在单击按钮时,指示该运行哪个子例程)是一个符号常量或常量组合,用来指定所生成的复本的特征,可以取以下两种值:
dbRepMakepartial生成一个部分复本
dbRepMakeReadoniy防止修改新复本


Path="C:\test.jpg"
arr=Split(Path,"")
FileName=arr(Ubound(arr))
FolderPath=Left(Path, Len(Path) - Len(FileName) - 1)
Set objShell=CreateObject("Shell.Application")
Set objFolder=objShell.Namespace(FolderPath)
set objFolderItem=objFolder.ParseName(FileName)
Width=objFolder.GetDetailsOf(objFolderItem, 162)
Height=objFolder.GetDetailsOf(objFolderItem, 164)
Msgbox "Width: " & Width & " Height: " & Height

->

可以采用变通的办法先复制再删除
========================================wmi=================
strComputer="."
Set objWMIService=GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")
Set colFolders=objWMIService.ExecQuery _
("Select * from Win32_Directory where name='c:\\Scripts'")
For Each objFolder in colFolders
errResults=objFolder.Rename("d:\\VBScript")
Wscript.Echo errResults
Next
错误码13,估计是更名的时候不允许ren c:\1 d:\2这样的格式
========================Shell.Application可以成功====================
Const FOF_CREATEPROGRESSDLG=&H0&
TargetFolder="c:\3"
Set objShell=CreateObject("Shell.Application")
Set objFolder=objShell.NameSpace(TargetFolder)
objFolder.MoveHere "d:\downloads", FOF_CREATEPROGRESSDLG
但是必须目标文件夹(像本例的是c:\3)存在才可以

  首先新建一个EXE工程,再在窗体上拖几个Label控件,看看Label的强大功能吧,原理就是利用Label来模拟一个按钮,但是首先要将Label控件的属性要调一下,
Name:LblBtn,
BorderStyle:1,
Appearance:0,
Alignment:2,

  这样一个按钮的雏形就已经出来了,如果工程量很大,可以将多个Label控件的Name属性设为一样的,对于按钮的识别就要靠识别Index属性了,为了方便起见,在进入到代码编辑窗口,输入以下代码:

PrivateConstLBL_BACK_COLOR=&HE0E0E0’正常时Label控件的背景色
PrivateConstLBL_WHEN_MOUSE_MOVE=&HC0C0C0’鼠标移动时Label的背景色
PrivateConstLBL_WHEN_MOUSE_DOWN=&H808080’鼠标按下时Label的背景色

再在Form的Load事件中输入以下内容

PrivateSubForm_Load()
DimCountAsInteger
ForCount=0To3’请将此出的3换成你的LblBtn数量的个数-1
LblBtn(Count).BackColor=LBL_BACK_COLOR’初始化LblBtn的背景
NextCount
EndSub

然后再在LblBtn的MouseMove和MouseDown事件中来搞定剩余部分:

PrivateSubLblBtn_MouseDown(IndexAsInteger,ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)’当鼠标按在LblBtn上时
LblBtn(Index).BackColor=LBL_WHEN_MOUSE_DOWN’临时改变LblBtn背景颜色
EndSub
PrivateSubLblBtn_MouseMove(IndexAsInteger,ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)’鼠标在LblBtn上面移动时触发该事件
DimCountAsInteger
DoEvents’暂时将系统控制权教给系统
IfButtonThenExitSub’如果按钮被按下就退出该过程
ForCount=0To3
IfCount<>IndexThen’如果按下的不是其它按钮
LblBtn(Index).BackColor=LBL_BACK_COLOR’将背景设为正常
Else
LblBtn(Index).BackColor=LBL_WHEN_MOUSE_MOVE’将背景设为鼠标移动的背景
EndIf
NextCount
EndSub
PrivateSubForm_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
DimCountAsInteger
DoEvents
ForCount=0To3
LblBtn(Count).BackColor=LBL_BACKCOLOR’恢复背景
NextCount
End
  本来利用Windows的消息系统来完成这一“艰巨”的任务最简单,可问题就来了,Label控件没有窗口句柄怎么办?可是此问题与题无关,写了会有骗稿费之:)
OK,Label控件就讲到这里,在来说说TextBox控件,

  各位看关恐怕看惯了白颜色的背景,那么就换换颜色以养养俺们那和绵羊一样的眼睛(为什么说绵羊?俺也不知道),可是VB提供的RGB函数弄出来的颜色不是怎么好看,这里俺来教大家一个小Tip,RGB函数的Red,Green,Blue这三个参数若一样,则产生的颜色是灰度,当然越接近白颜色越好,但也不能让各位看不出来,俺建议TextBox的背景为RGB(235,235,235),各位还是实战一下,将一个TextBox拖到窗体上,属性设置如下
Appearance0
BorderStyle1
MutilLineTrue

千万不要设置ScrollBars属性,否则会影响效果
在Form的Load事件中初始化TextBox
DimbkColorAsLong
PrivateSubForm_Load()
bkColor=RGB(235,235,235)
Text1.BackColor=bkColor
EndSub
在Form和Text1的MouseMove事件中:
PrivateSubForm_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
Text1.BorderStyle=0
EndSub
PrivateSubText1_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
DoEvents
Text1.BorderStyle=1
EndSub

在按下F5试试是不是很Cool?


  可能各位看关玩过石器时代,一定会对里面的TextBox的效果感到很爽,VB还不是可以做到,有焦点的控件可以使用SetFocus方法来为其设置焦点,可是一个窗体上如果控件太多了,一个一个的用SetFocus是不是太傻了?这一节的主角就是--------API函数,

首先声明:
PrivateTypePOINTAPI
xAsLong
yAsLong
EndType
PrivateDeclareFunctionGetCursorPosLib"user32"Alias"GetCursorPos"(lpPointAsPOINTAPI)AsLong
PrivateDeclareFunctionWindowFromPointLib"user32"Alias"WindowFromPoint"(ByValxPointAsLong,ByValyPointAsLong)AsLong
PrivateDeclareFunctionSetFocusLib"user32"Alias"SetFocus"(ByValhwndAsLong)AsLong
但是这里的SetFocus会和控件的SetFocus会搞混淆,改改吧,
PrivateDeclareFunctionnSetFocusLib"user32"Alias"SetFocus"(ByValhwndAsLong)AsLong
只要Alias指向的接口是对的前面的函数名称简直就是摆设,
在建立一个过程:
PublicFunctionsSetFocus()AsLong
DimCPosAsPOINTAPI,SuccessfullAsBoolean,hWndAsLong
DoEvents
Successfull=GetCursorPos(CPos)
IfNotSuccessfullThenExitSub’如果未成功则退出该过程
hWnd=WindowFromPoint(CPos.x,CPos.y)
sSetFocus=nSetFocus(hWnd)
EndSub
  在窗体上放一个Timer控件,Interval属性设为100,就是0.1秒,在Timer1控件的Timer事件中填入sSetFocus,在运行一下看看,效果怎么样?

  可是有的先生小姐要问了,TextBox难道就不能用ScrollBar吗?非也非也,选工程->部件->MicrosoftWindowsCommonControls-26.0(SP3)就是你的答案,至于卷动TextBox就去研究SendMessage函数吧,否则又有骗稿费之嫌,如果想作绿色软件,不想用控件,可以用俺前面讲到的Label控件,利用字体Webdings来模拟ScrollBar,需要注意的是,如果模拟ScrollBar,上下左右箭头分别是5,6,3,4,别忘了把字体设为Webdings

  再来讲讲窗体的美化,其实将BorderStyle属性设为0就是很好的2D美化;)可是,这样一来,问题又来了,怎么办?凡事都要请API来帮忙,这里需要两个API,一下是该API的声明:

PublicDeclareFunctionReleaseCaptureLib"user32"Alias"ReleaseCapture"()AsLong注释:这个API是用来解下鼠标的追踪器,关于他的过多用法以及详细介绍可以写信向俺咨询,
还有
PublicDeclareFunctionSendMessageLib"user32"Alias"SendMessageA"(ByValhwndAsLong,ByValwMsgAsLong,ByValwParamAsLong,lParamAsAny)AsLong’这个该不要俺多介绍了吧
PublicConstHTCAPTION=2’代表窗体的标题区
PublicConstWM_NCLBUTTONDOWN=&HA1’表示非工作区左键按下
  原理很简单,卸下鼠标追踪器后向Form发送一个移动窗体的消息,其实做到这一点的方法很多,但俺个人认为这一种最简单,添加一个过程:

PublicSubMoveForm(hWndAsLong)
DoEvents
ReleaseCapture
SendMessagehWnd,WM_NCLBUTTONDOWN,HTCAPTION,0&
EndSub
在Form的MouseMove事件中:
PrivateSubForm_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
IfButton=vbLeftButtonThenMoveFormhWnd’如果按下鼠标左键就移动窗体
EndSub
台下的这位小姐又纳闷了,可是光秃秃的窗体没有了标题栏也不好看,俺要向这为小姐推荐俺的东东-ActiveX控件,ToolSign,需要的人可以写信给俺联系,
该控件需要在代码编辑区域内添加一下代码:
’一下声明是用在ToolSign的AutoQuit属性的
PublicConstEXIT_FORCE=2’注意,在VB中运行的时候如果选用此退出方式,VB也会退出
PublicConstEXIT_MESSAGE=1’由操作系统发送关闭消息
PublicConstEXIT_CUSTOM=Not(EXIT_FORCEOrEXIT_MESSAGE)’自定义
将其注册后在部件栏中把e-DogkidStudioToolsSign打钩,添加到工具箱中,双击加入到窗体中,
在Form的Load事件中添加一下初始化代码:
PrivateSubForm_Load()
WithSign1
.AutoQuit=EXIT_CUSTOM
.ParentsHWND=hWnd’填了此属性可以直接用ToolSign来移动窗体而不需要前面的代码
EndWith
EndSub
Sign1的Click事件
PrivateSubSign1_Click()
End’关闭程序
EndSub
在Form的Resize事件中添加一下代码:
PrivateSubForm_Resize()
Sign1.Width=Width
EndSub
如果想让窗体可以改变大小,可以修改一下属性
Caption""
BorderStyle2或5
ControlBoxFalse

  不知道各位看关见过爆炸试的窗体没有?,没有见过可以从俺要另外一个俺自己的ActiveXDLL,我的那个东东其实是给我的Software作运行库的,各位若不嫌弃,可以用用,注册后在工程->引用->e-DogkidRuntimeLibrary
然后在窗体Load事件中输入:
PrivateSubForm_Load()
DimSystemAse_Dogkid_Runtime_Library.System
SetSystem=Newe_Dogkid_Runtime_Library.System
Show
System.BoomIthDC,60,Width,Height,Left,Top
SetSystem=Nothing
EndSub

->

  2、DropDownStyle 属性:获取或设置指定组合框样式的值,确定用户能否在文本部分中输入新值以及列表部分是否总显示投降FunctionCompFile(F1asstring,F2asstring)asboolean
Dimissameasboolean
OpenF1ForBinaryAs#1
OpenF2ForBinaryAs#2

issame=True
IfLOF(1)<>LOF(2)Then
issame=False
Else
whole&=LOF(1)\10000'numberofwhole10,000bytechunks
part&=LOF(1)Mod10000'remainingbytesatendoffile
buffer1$=String$(10000,0)
buffer2$=String$(10000,0)
start&=1
Forx&=1Towhole&'thisfor-nextloopwillget10,000
Get#1,start&,buffer1$'bytechunksatatime.
Get#2,start&,buffer2$
Ifbuffer1$<>buffer2$Then
issame=False
ExitFor
EndIf
start&=start& 10000
Next
buffer1$=String$(part&,0)
buffer2$=String$(part&,0)
Get#1,start&,buffer1$'gettheremainingbytesattheend
Get#2,start&,buffer2$'gettheremainingbytesattheend
Ifbuffer1$<>buffer2$Then
issame=False
EndIf
Close
CompFile=issame
EndFunction->

DimwsObj
SetwsObj=CreateObject("Wscript.Shell")

'AddtheLogLevelValuetoKerberosKeyinRegistry.
OnErrorResumeNext
WScript.Echo"EnablingKerberosLogging..."
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\1KnowledgeConsistencyChecker",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\2SecurityEvents",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\3ExDSInterfaceEvents",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\4MAPIInterfaceEvents",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\5ReplicationEvents",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\6GarbageCollection",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\7InternalConfiguration",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\8DirectoryAccess",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\9InternalProcessing",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\10PerformanceCounters",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\11Initialization/Termination",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\12ServiceControl",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\13NameResolution",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\14Backup",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\15FieldEngineering",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\16LDAPInterfaceEvents",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\17Setup",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\18GlobalCatalog",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\19Inter-siteMessaging",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\20GroupCaching",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\21Linked-ValueReplication",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\22DSRPCClient",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\23DSRPCServer",3,"REG_DWORD"
wsObj.RegWrite"HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\24DSSchema",3,"REG_DWORD"
SetwsObj=Nothing
WScript.Echo"-=[Complete!]=-"

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