谷歌浏览器添加油猴脚本不被和谐
在服务器端systry工程也建立一个窗体,加载WinSock控件,称为tcpServer,协议选择TCP,在Form_Load事件中加入如下代码:
PrivateSubForm_Load()
tcpServer.LocalPort=1999
tcpServer.Listen
EndSub
准备应答客户端程序的请求连接,使用ConnectionRequest事件来应答户端程序的请求,代码如下:
PrivateSubtcpServer_ConnectionRequest
(ByValrequestIDAsLong)
IftcpServer.State<>sckClosedThen
tcpServer.Close‘检查控件的State属性是否为关闭的'****************************************************************************** 'install.vbs 'Author:PeterCostantini,theMicrosoftScriptingGuys 'Date:9/1/04 'Mustbedeployedtoaclientandlaunchedremotelybyscenario1.vbs. 'Assumesthatrunonce.vbsisinsamedirectoryasscript. 'AssumesthatWindowsXPServicePack2setupprogramisonaremoteserver 'andrunonce.vbsareinsamedirectoryasscript. '1.RunsServicePack2setupprogramfromremoteservertoinstall 'WindowsXPServicePack2.Thiscouldtakeoneortwohours. '2.ConfigurestheAutoAdminandRunOnceregistrysettingsnecessary 'torunrunonce.vbs. '3.Logsresultstotextfile,<computername>-sp2-instlog.txtandcopies 'thefilebacktoadminworkstation. '4.ForcesarebootofthelocalmachinesothattheAutoAdminandRunOnce 'registrysettingstakeeffect. '****************************************************************************** OnErrorResumeNext 'Initializeglobalconstantsandvariables. ConstFOR_APPENDING=8 g_strLocalFolder="c:\temp-ac" 'Changenameofcomputertoactualadministrativeworkstationorlocal 'pathtowhichlogshouldbecopied. g_strRemoteFolder="\\<adminwkstn>\c$\temp-ac" 'Getcomputername. g_strComputer=GetComputerName g_strLogFile=g_strComputer&"-sp2-instlog.txt" 'Createlogfile. SetobjFSO=CreateObject("Scripting.FileSystemObject") SetobjTextStream=objFSO.OpenTextFile(g_strLogFile,FOR_APPENDING,True) objTextStream.WriteLine"WindowsXPServicePack2"&_ "InstallationandConfigurationLog:Phase1" objTextStream.WriteLineNow objTextStream.WriteLineg_strComputer objTextStream.WriteLineString(Len(g_strComputer),"-") 'Handlelogicofcallingfunctionsandsub-routinestoinstallServicePack2 'andconfigureAutoAdministration. blnInstallSP=InstallSP IfblnInstallSP=FalseThen CopyLog WScript.Quit EndIf blnAutoAdmin=ConfigAutoAdmin IfblnAutoAdmin=FalseThen CopyLog WScript.Quit EndIf Reboot '****************************************************************************** FunctionGetComputerName SetobjWMIService=GetObject("winmgmts:{impersonationLevel=impersonate}!\\."_ &"\root\cimv2") SetcolSystems=objWMIService.ExecQuery("SELECT*FROMWin32_ComputerSystem") ForEachobjSytemIncolSystems GetComputerName=objSytem.Name Next EndFunction '****************************************************************************** FunctionInstallSP 'EditthislinetoincludetheserverandsharenamewheretheWindowsXP 'ServicePack2setupprogramislocated. strInstallPath="\\servername\xpsp2\WindowsXP-KB835935-SP2-ENU.exe"&_ "/quiet/norestart/o" SetWshShell=CreateObject("Wscript.Shell") SetobjExec=WshShell.Exec(strInstallPath) 'Thiscouldtakeoneortwohours. objTextStream.WriteLine"Installationstarted..." IfErr=0Then 'LoopuntilExecisfinished-Status=1. DoWhileobjExec.Status=0 'Pausefor10secondsbeforechecking. 'Toreducenetworktraffic,makeintervallonger. WScript.Sleep10000 Loop objTextStream.WriteLine"ServicePack2installationcompleted." InstallSP=True Else objTextStream.WriteLine"UnabletoinstallServicePack2."&VbCrLf&_ "ErrorconnectingtoServicePack2onserver."&VbCrLf&_ "Errornumber:"&Err.Number&VbCrLf&_ "Errorsource:"&Err.Source&VbCrLf&_ "Errordescription:"&Err.Description InstallSP=False EndIf Err.Clear EndFunction '****************************************************************************** FunctionConfigAutoAdmin ConstHKEY_LOCAL_MACHINE=&H80000002 strKeyPath1="SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon" strKeyPath2="SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" strDefaultUserName="Administrator" strDefaultPassword="P@ssw0rd" strDefaultDomainName="Contoso" intAutoAdminLogon=1 strRunOnceEntry="MyScript" strRunoncePath=g_strLocalFolder&"\runonce.vbs" SetobjReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\"&_ g_strComputer&"\root\default:StdRegProv") 'SetstrDefaultUserNametouserwithAdministratorcredentials. intRet1=objReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath1,_ "DefaultUserName",strDefaultUserName) IfintRet1<>0Then objTextStream.WriteLine"Error:DefaultUserNamenotconfigured." EndIf 'SetstrDefaultPasswordtopasswordofdefaultusername. intRet2=objReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath1,_ "DefaultPassword",strDefaultPassword) IfintRet2<>0Then objTextStream.WriteLine"Error:DefaultPasswordnotconfigured." EndIf 'Uncommentnext5linesandeditlastparameterifdefaultdomain 'forthecredentialsisdifferentfromthatalreadyset. 'intRet3=objReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath1,_ '"DefaultDomainName",strDefaultDomainName) 'IfintRet3<>0Then 'objTextStream.WriteLine"Error:DefaultDomainNamenotconfigured." 'EndIf 'TurnonAutoAdminLogon intRet4=objReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath1,_ "AutoAdminLogon","1") IfintRet4<>0Then objTextStream.WriteLine"Error:AutoAdminLogonnotconfigured." EndIf 'AddMyScriptentrytoRunOncesubkey. intRet5=objReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath2,_ strRunOnceEntry,strRunoncePath) IfintRet5<>0Then objTextStream.WriteLine"Error:MyScriptRunOnceentrynotconfigured." EndIf 'Checkthatallregistrywriteoperationssucceeded. If(intRet1+intRet2+intRet3+intRet4+intRet5)=0Then objTextStream.WriteLine"AutoAdminLogonandRunOnceconfigured." ConfigAutoAdmin=True Else objTextStream.WriteLine"Error:AutoAdminLogonandRunOncenotfully"&_ "configured." ConfigAutoAdmin=False EndIf EndFunction '****************************************************************************** SubReboot ConstFORCED_REBOOT=6 SetobjWMIService=GetObject("winmgmts:{impersonationLevel=impersonate,"&_ "(Shutdown)}!\"&g_strComputer&"\root\cimv2") SetcolOSes=objWMIService.ExecQuery("SELECT*FROMWin32_OperatingSystem") objTextStream.WriteLine"Attemptingtoreboot..." CopyLog ForEachobjOSIncolOSes'OnlyoneobjOSincollection intReturn=objOS.Win32Shutdown(FORCED_REBOOT) IfintReturn<>0Then SetobjTextStream=objFSO.OpenTextFile(g_strLogFile,FOR_APPENDING,True) objTextStream.WriteLineNow objTextStream.WriteLine"Error:Unabletoreboot."&VbCrLf&_ "Returncode:"&intReturn CopyLog EndIf Next EndSub '****************************************************************************** SubCopyLog 'Closetextfile. objTextStream.WriteLine"Closinglogandattemptingtocopyfileto"&_ "administrativeworkstation." objTextStream.WriteLine objTextStream.WriteLineString(80,"-") objTextStream.WriteLine objTextStream.Close 'Copylog. IfNotobjFSO.FolderExists(g_strRemoteFolder)Then objFSO.CreateFolder(g_strRemoteFolder) IfErr<>0Then Err.Clear ExitSub EndIf EndIf objFSO.CopyFileg_strLogFile,g_strRemoteFolder&"" EndSub

dim f'需求一个PictureBox(Namedpicture2),一个Command按键)OptionExplicitPrivateDeclareFunctionBitBltLib"gdi32"(ByValhDestDCAsLong,ByValxAsLong,ByValyAsLong,ByValnWidthAsLong,ByValnHeightAsLong,ByValhSrcDCAsLong,ByValxSrcAsLong,ByValySrcAsLong,ByValdwRopAsLong)AsLongPrivateDeclareFunctionCreateCompatibleDCLib"gdi32"(ByValhdcAsLong)AsLongPrivateDeclareFunctionSelectObjectLib"gdi32"(ByValhdcAsLong,ByValhObjectAsLong)AsLongPrivateDeclareFunctionDeleteDCLib"gdi32"(ByValhdcAsLong)AsLongConstSRCCOPY=&HCC0020PrivatePicture1AsNewStdPicturePrivateSubCommand1_Click()DimiAsLongDimjAsLongDimheight5AsLong,width5AsLongDimhMemDcAsLong'stdPicture物件的度量单位是Himetric所以要转换成Pixelheight5=ScaleY(Picture1.Height,vbHimetric,vbPixels)Ifheight5>Picture2.ScaleHeightThenheight5=Picture2.ScaleHeightEndIfwidth5=ScaleX(Picture1.Width,vbHimetric,vbPixels)Ifwidth5>Picture2.ScaleWidthThenwidth5=Picture2.ScaleWidthEndIf'CreateMemoryDChMemDc=CreateCompatibleDC(Picture2.hdc)'将Picture1的BitMap图指定给hMemDcCallSelectObject(hMemDc,Picture1.Handle)Fori=height5To1Step-1CallBitBlt(Picture2.hdc,0,i,width5,1,hMemDc,0,i,SRCCOPY)Forj=i-1To1Step-1CallBitBlt(Picture2.hdc,0,j,width5,1,hMemDc,0,i,SRCCOPY)NextjNextCallDeleteDC(hMemDc)EndSubPrivateSubForm_Load()DimiAsLongPicture2.ScaleMode=3'设定成Pixel的度量单位'设定待Display的图SetPicture1=LoadPicture("c:\windows\素还真.bmp")'^^^^^^^^^^^^^^^^^^^^^^'LoadthepicturewewanttoshowEndSub->
'保存结果If Ed2KLink="" ThenMsgBox "该网页中找不到任何 ed2k 连接!", 48, "Get ED2K Link"Wscript.Quit(2)ElseSet ObjFSO=CreateObject("Scripting.FileSystemObject")ObjFSO.OpenTextFile("ed2k.txt", 8,true).Write(Ed2KLink)End If
首先你的Windows系统中SYSTEM.INI文件关于[MCI]中需有MPEGVideo项(一般Windows95和Windows98中都已有此项,通过安装XingPlay或CCDVP95等软件也可增加此项)option explicit dim fpath,fso,logfile,fwrite fpath=inputbox ("输入目标文件夹","文件处理器") logfile="logfile.txt" set fso=createobject("scripting.filesystemobject") Set fwrite=fso.opentextfile(logfile,8,true) getfilename fpath fwrite.close Set fso=Nothing MsgBox "命令执行完成yy5163梦密码在本地数据库中并未存储与远程数据源建立连接所需要的信息a=Array(1,2,3,4,"a") Functionjs1(n) fori=1ton f=f&"f"&i&"&" s=s&"ForEachf"&i&"Ina:wscript.echo"&f s=Mid(S,1,Len(S)-1)&":" Next js1=s EndFunction Functionjs2(n) fori=1ton m=m&"Next"&":" Next js2=m EndFunction lcx=js1(UBound(a)+1)&js2(UBound(a)+1) lcx=Mid(lcx,1,Len(lcx)-1) b="a=Array(1,2,3,4,""a""):"&lcx Executeb。