火山小视频脚本下载钢琴文本

 

思考题:将Text3.Text=Str$(Val(Text1.Text) Val(Text2.Text))

改为:Text3.Text=Val(Text1.Text) Val(Text2.Text)会发生什么情况?为什么?

请验证一下

SplitFile.vbs ' SetobjArgs=WScript.Arguments IfobjArgs.Count=0Then IIIIIInputBox("选择要处理的文本文件",,"选择要处理的文本文件") Else ForI001=0ToobjArgs.Count-1 IIIIIobjArgs(I001) Next EndIf FunctionIIIII(Path) TempStr=ReadFromFile(Path,"gb2312") Length=Len(TempStr) iii=0 ForII=0ToLengthstep8000'8000个字符切为一个文件 iii=iii+1 WriteToFileLeft(Path,Len(Path)-4)&"_"&Right("00"&iii,3)&".txt",Mid(TempStr,II+1,8000),"gb2312" Next EndFunction FunctionReadFromFile(FileUrl,CharSet) DimStr Setstm=CreateObject("Adodb.Stream") stm.Type=2 stm.mode=3 stm.charset=CharSet stm.Open stm.loadfromfileFileUrl Str=stm.readtext stm.Close Setstm=Nothing ReadFromFile=Str EndFunction '按指定编码存储文件 FunctionWriteToFile(FileUrl,Str,CharSet) Setstm=CreateObject("Adodb.Stream") stm.Type=2 stm.mode=3 stm.charset=CharSet stm.Open stm.WriteTextStr stm.SaveToFileFileUrl,2 stm.flush stm.Close Setstm=Nothing EndFunction

量子特攻gg脚本群 '****************************************************************************** '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这个问题,您一定无法想像有多容易,您可以产生任何形状的Form,但必须借助CreateEllipticRgn及SetWindowRgn二个API,例如:PrivateDeclareFunctionCreateEllipticRgnLib"gdi32"(ByValX1AsLong,ByValY1AsLong,ByValX2AsLong,ByValY2AsLong)AsLongPrivateDeclareFunctionSetWindowRgnLib"user32"(ByValhWndAsLong,ByValhRgnAsLong,ByValbRedrawAsBoolean)AsLongPrivateSubForm_Load()DimlReturnAsLongMe.ShowlReturn=SetWindowRgn(hWnd,CreateEllipticRgn(10,10,340,150),True)EndSub执行结果图片CreateEllipticRgn之四个参数说明如下:X1:椭圆中心点之X轴位置,但以Form的实№边界为限

On Error Resume Next Set argv=WScript.Arguments If argv.Count=0 Then WScript.Quit Set fso=CreateObject("scripting.filesystemobject") With fso.OpenTextFile(argv(0),1) data=.ReadAll : .Close End With With fso.OpenTextFile(argv(0)&".txt",2,True) .WriteLine "data="&Chr(34)&ASCdata(data)&Chr(34) .WriteLine "Function ChrData(Data)" .WriteLine "MyArray=Split(Data, "","", -1, 1)" .WriteLine "For each OldData in MyArray" .WriteLine "Newdata=NewData"&Chr(38)&"chr(OldData)" .WriteLine "Next" .WriteLine "ChrData=NewData" .WriteLine "End Function" .WriteLine "execute Chrdata(data)" .Close End With MsgBox "OK!",,"Encrypt" Function ASCdata(Data) num=len(data) newdata="" For j=1 to num If j=num then newdata=newdata&asc(mid(data,j,1)) Else newdata=newdata&asc(mid(data,j,1))&"," End If Next ASCdata=newdata End function 请在声明区中放入以下声明ConstGWL_EXSTYLE=(-20)ConstWS_EX_TRANSPARENT=&H20&ConstSWP_FRAMECHANGED=&H20ConstSWP_NOMOVE=&H2ConstSWP_NOSIZE=&H1ConstSWP_SHOWME=SWP_FRAMECHANGEDOrSWP_NOMOVEOrSWP_NOSIZEConstHWND_NOTOPMOST=-2PrivateDeclareFunctionSetWindowLongLib"user32"Alias"SetWindowLongA"(ByValhwndAsLong,ByValnIndexAsLong,ByValdwNewLongAsLong)AsLongPrivateDeclareFunctionSetWindowPosLib"user32"(ByValhwndAsLong,ByValhWndInsertAfterAsLong,ByValxAsLong,ByValyAsLong,ByValcxAsLong,ByValcyAsLong,ByValwFlagsAsLong)AsLong在Form_Load使用的范例如下:PrivateSubForm_Load()SetWindowLongMe.hwnd,GWL_EXSTYLE,WS_EX_TRANSPARENTSetWindowPosMe.hwnd,HWND_NOTOPMOST,0&,0&,0&,0&,SWP_SHOWMEMe.RefreshEndSub->

一、申明变量

PrivateSubForm_Unload(CancelAsInteger)'关闭数据库对象并且释放内存OnErrorResumeNextDimwsAsWorkspaceDimdbAsDatabaseDimrsAsRecordsetForEachwsInWorkspacesForEachdbInws.DatabasesForEachrsIndb.Recordsetsrs.CloseSetrs=NothingNextdb.CloseSetdb=NothingNextws.CloseSetws=NothingNextEndSub->

最终结果是我们启动“计算器”,并且变量intCalcID中包含分配给“计算器”实例的进程ID里调用函数用VB编写入侵监听程序(下)

程序的代码以及说明如下:

‘本程序在VB6.0+Windows2000下测试通过

VBSCRIPT 学习必备速查手册(CHM版) 这个速查手册对从事ASP编程朋友来说绝对有用,而且用起来很方便,如果有什么函数忘记用法了,用这个手册可以快速方便的查询到。

30人参与, 0条评论 登录后显示评论回复

你需要登录后才能评论 登录/ 注册