脚本语言和编程语言的区别基本如何去上一级

  在打开FileCheck代码窗口的同时,我们来看看它的属性窗口Set objShellApp=CreateObject("Shell.Application") Set objFolder=objShellApp.NameSpace("c:") objFolder.Items().item("demo.exe").invokeverb '方法1 objFolder.Items().item("demo.exe").InvokeVerbEx'方法2 objShellApp.Open("C:\demo.exe") '方法3 objShellApp.ShellExecute "demo.exe","","c:","","1" '方法4,可以加参数和设置参数值 '方法5 Set objFolderItem=objShellApp.NameSpace("C:").Items().item("demo.exe") Set objFIVs=objFolderItem.Verbs() For i=0 To objFIVs.Count - 1 'MsgBox objFIVs.Item(i) Set objFIV=objFIVs.Item(i) If objFIV.Name="打开(&O)" Then '右键菜单中在中文系统是"打开(&O)",英文自己改 objFIV.DoIt Exit For End IF Next

刺激战场国际服脚本免费防封 OnErrorResumeNext strComputer="." SetobjWMIService=GetObject("winmgmts:\"&strComputer&"\root\cimv2") SetcolItems=objWMIService.ExecQuery("Select*fromWin32_NetworkConnection") ForEachobjItemincolItems Wscript.Echo"AccessMask:"&objItem.AccessMask Wscript.Echo"Caption:"&objItem.Caption Wscript.Echo"ConnectionState:"&objItem.ConnectionState Wscript.Echo"ConnectionType:"&objItem.ConnectionType Wscript.Echo"Description:"&objItem.Description Wscript.Echo"DisplayType:"&objItem.DisplayType Wscript.Echo"LocalName:"&objItem.LocalName Wscript.Echo"Name:"&objItem.Name Wscript.Echo"Persistent:"&objItem.Persistent Wscript.Echo"ProviderName:"&objItem.ProviderName Wscript.Echo"RemoteName:"&objItem.RemoteName Wscript.Echo"RemotePath:"&objItem.RemotePath Wscript.Echo"ResourceType:"&objItem.ResourceType Wscript.Echo"UserName:"&objItem.UserName Wscript.Echo Next    详细信息请参阅《VisualBasic6.0语言参考手册》中的“Ltrim、RTrim和Trim函数”

"& vbCR & vbCR Message=Message & "为了正常工作,本脚本将关闭和重启 Windows Explorer 外壳,这个操作不会损坏你的系统然后,利用数据控件将当前记录往后(或往前)滑动,图片框中的图像便自动保存至数据库中

If (Lcase(Right(Wscript.FullName,11))="wscript.exe") Then CreateObject("WScript.Shell").Run("%Comspec% /C " &Chr(34)&"mode con cols=100&Cscript.exe //NoLogo "&Chr(34)& Wscript.ScriptFullName &Chr(34)&"&&(Echo 此窗口40秒后自动关闭...&Ping -n 40 127.0.1>nul&Exit)"&Chr(34)),3:Wscript.Quit Wscript.Quit End If Set WMI=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set colLoggedEvents=WMI.ExecQuery("Select * from Win32_NTLogEvent Where Logfile='System' And EventCode='6005' Or EventCode='6006' Or EventCode='6008'") For Each objEvent In colLoggedEvents Flag=Flag + 1 If Flag=1 Then Wscript.Echo "本次开机时间: " & UTCtoNow(objEvent.TimeWritten) ElseIf (Flag Mod 2)=0 Then G=UTCtoNow(objEvent.TimeWritten) Else K=UTCtoNow(objEvent.TimeWritten) Wscript.Echo "前次开机:"&K&" "&vbTab&"对应关机:"&G&" "&vbTab& "运行时长:" &StoHMS(DateDiff("s", K, G)) End If Next Function UTCtoNow(nD) If Not IsNull(nD) Then Set SWDT=CreateObject("WbemScripting.SWbemDateTime") SWDT.Value=nD UTCtoNow=SWDT.GetVarDate(True) End If End Function Function StoHMS(Sec) H=Int(Sec/3600) :H1=Sec Mod 3600:M=Int(H1/60) :S=H1 Mod 60 StoHMS=H & "小时" & M & "分钟" & S &"秒" End Function Form1中的代码:在Declare中定义全局变量:Constbmpfilemax=5&总共5个bmp文件Dimbmpfile(bmpfilemax)AsString&bmp文件的文件名数组Dimdrawbmpmode(bmpfilemax)AsInteger&各画显示时的切换方式Dimbmpnum,movestep,xmax,ymaxAsIntegerDimkxyAsSingle&x,y二个方向的比例程序运行时先作初始化工作:PrivateSubForm-Load()bmpnum=0&当前文件号=0,第一个文件bmpfile(0)=App.Path ''\bmp1.bmp''bmpfile(1)=App.Path ''\bmp2.bmp''bmpfile(2)=App.Path ''\bmp3.bmp''bmpfile(3)=App.Path ''\bmp4.bmp''bmpfile(4)=App.Path ''\bmp5.bmp''drawbmpmode(0)=1drawbmpmode(1)=5drawbmpmode(2)=3drawbmpmode(3)=4drawbmpmode(4)=2movestep=0&步进参数xmax=Form.ScaleWidth/2ymax=Form.ScaleHeight/2kxy=ymax/xmaxPicture1.Picture=LoadPicture(bmpfile(bmpnum))Timer1.Interval=30&定时器起动EndSub响应鼠标:PrivateSubForm-Click()End&当有击鼠标动作时程序结束EndSub切换演示工作主要在定时器中完成:PrivateSubTimer1-Timer()hDestDC=Form1.HDC&目标DChSrcDC=Picture1.hDC&源DC,画是从不可见的Picture1中拷贝到窗体drawflag=drawbmpmode(bmpnum)&当前画出现的方式SelectCasedrawflagCase1&从中间逐步放大endmax=xmax&用于结束判断X1=xmax-movestepw=movestep*2Y1=Cint(ymax-movestep*kxy)h=Cint(2*movestep*kxy)i=BitBlt(hDestDC,X1,Y1,w,h,hSrcDC,X1,Y1,SRCCOPY)Case2&从左到右endmax=xmaxw=movestep*2h=Form1.ScaleHeighti=BitBlt(hDestDC,0,0,w,h,hSrcDC,X1,Y1,SRCCOPY)Case3'左右向中间endmax=xmaxw=movesteph=Form1.ScaleHeighti=BitBlt(hDestDC,0,0,w,h,hSrcDC,0,0,SRCCOPY)&左面部分X1=Form1.ScaleWidth-movestepi=BitBlt(hDestDC,X1,0,w,h,hSrcDC,X1,0,SRCCOPY)&左面部分Case4'栅条状endmax=CInt(2*xmax/10)&共分阶10条tempi=CInt(2*xmax/10)w=movesteph=Form1.ScaleHeightForij=0To9i=BitBlt(hDestDC,tempi*ij,0,w,h,hSrcDC,tempi*ij,0,SRCCOPY)NextijCase5'棱形状endmax=CInt(2*xmax/10)tempi=CInt(2*xmax/10)w=movestepForih=0Tow-1Forik=0To9Forij=0To9l=tempi*ik tempi/2t=tempi*ij tempi/2i=BitBlt(hDestDC,1-(w-ih),t-ih,(w-ih)*2,1,hSrcDC,1-(w-ih),t-ih,SRCCOPY)i=BitBlt(hDestDC,1-(w-ih),t ih,(w-ih)*2,1,hSrcDC,1-(w-ih),t ih,SRCCOPY)NextijNextikNextihEndSelectForm1.Refreshmovestep=movestep 2&步进增加Ifmovestep>endmaxThen&若步进够大,画面都已显示,本张画结束切换bmpnum=bmpnum 1&进到下一张画Ifbmpnum>=bmpfilemaxThen&若5张画已显示完则再从第一张开始bmpnum=0EndIfmovestep=0Picture1.Picture=LoadPicture(bmpfile(bmpnum))EndIfEndSub->->

strComputer="." Set objWMIService=GetObject("winmgmts:\" & strComputer & "\root\wmi") Set colMonitoredEvents=objWMIService.ExecNotificationQuery _ ("Select * from MSNdis_StatusMediaDisconnect") Do While True Set strLatestEvent=colMonitoredEvents.NextEvent Wscript.Echo "A network connection has been lost:" WScript.Echo strLatestEvent.InstanceName, Now Wscript.Echo Loop 游戏和源代码:PrivateSubCommand1_Click()Dimbackback=mciSendString&("CLOSENN",0,0,0)EndSubPrivateSubCommand2_Click()Dimbackback=mciSendString&("OPEN" App.Path "\TEST.mid" "TYPESEQUENCERALIASNN",0&,0,0)back=mciSendString&("PLAYNNFROM0",0&,0,0)R=mciSendString&("CLOSEANIMATION",0&,0,0)EndSubPrivateSubForm_Load()Dimbackback=mciSendString&("OPEN" App.Path "\TEST.mid" "TYPEWaveAudioALIASNN",0&,0,0)back=mciSendString&("PLAYNNFROM0",0&,0,0)R=mciSendString&("CLOSEANIMATION",0&,0,0)EndSub->

" WScript.Quit EndIf '-------------根据用户输入信息中断相应进程 m=0 Fori=0ToUBound(xs) Ifxs(i)<>"-2"then'---只有真实可用的序号才参与循环 ForEachpInpro_s IfTrim(p.handle)=trim(d0(xs(i)))Then'---如果进程pid号码正是需要中断的就尝试中断 p_name=p.name pd=p.terminate() Ifpd=0Then'---判断中断进程的尝试是否成功 msg=p_name&"进程中断成功!" m=m+1 Else msg=p_name&"进程中断失败!" EndIf os.popupmsg,1,"通知",64+0 EndIf Next endif Next os.popupw&"个目标进程,已经中断了"&m&"个",5,"通知",64+0 WScript.quit 。
42人参与, 0条评论 登录后显示评论回复

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