阿拉德之怒免费挂机脚本sh输出

一、利用API获取窗口的标题新建窗体Form1和按钮Command1ぴ诖疤迥?橹刑砑尤缦麓码:OptionExplicitPrivateDeclareFunctionGetWindowTextLib"us―er32"Alias"GetWindowTextA"(ByValhwndAsLong,ByVallpStringAsString,ByValcchAsLong)AsLong'在窗体声明节中加入API函数“GetWindowText”的说明'函数将向lpstring中载入要获得的窗体captionPrivateSubCommand1_Click()DimreturncodeAsLongDimcaptextAsStringDimcaplenAsLongcaptext=String$(100,0)caplen=99returncode=GetWindowText(ByValme.hwnd,ByValcaptext,ByValcaplen)printreturncodePrintcaptextPrintcaplenEndSub

二、获取鼠标在当前窗口(客户区)的屏幕坐标そ立一新项目窗体form1并添加控件文本框Text1、Text2ぴ诖疤迥?橹惺淙耄邯OptionExplicitPrivateDeclareFunctionGetCursorPosLib"user32"(lpPointAsPOINTAPI)AsLongPrivateTypePOINTAPIXAsLongYAsLongEndTypeDimptAsPOINTAPIDimreturncodeAsLongPrivateSubForm_Load()Text1.Text=""Text2.Text=""MaxButton=FalseMinButton=FalseForm1.WindowState=2EndSubPrivateSubForm_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)'注意pt结构是按引用传递的returncode=GetCursorPos(pt)Text1.Text=pt.XText2.Text=pt.YEndSub

三、记录Windows使用时间建立新项目窗口form1,输入代码:PrivateSubForm_Load()form1.visible=falseOpenapp.paht+"memo.txt"ForAppendAs#1Print#1,"启动windows:"&CStr(Now)Close#1EndSubPrivateSubForm_Unload(CancelAsInteger)Openapp.paht+"memo.txt"ForAppendAs#1Print#1,"关闭windows:"&CStr(Now)Close#1EndEndSub最后将此程序加入启动组即可即使如此,也是为了进行错误处理

4399奶块钓鱼脚本 strLine=objFile.ReadLineQ:--怎样在我的程序中实现文件下载

  Re:

  一个例子:一个Command,两个Text代码如下:

     PrivateDeclareFunctionDoFileDownloadLib"shdocvw.dll"(ByVallpszFileAsString)AsLong

   PrivateSubCommand1_Click()

     DimsDownloadAsString

     sDownload=StrConv(Text1.Text,vbUnicode)

     CallDoFileDownload(sDownload)

     EndSub

   PrivateSubForm_Load()

     Text1.Text="

     Form1.Caption="Audiograbber1.62Full"

     Text2.Text="

     EndSub

  Q:--如何在vb中定义一个热键,使得当一个应用程序的窗口最小化后,可以通过热键来唤醒它

  Re:

  先声明API函数SendMessage,然后添加一个按钮和如下代码;

     PrivateDeclareFunctionSendMessageLib"user32"Alias"SendMessageA"(ByValhwndAsLong,ByVal_   wMsgAsLong,ByValwparamAsLong,lparamAsAny)AsLong

   PrivateSubCommand1_Click()

     DimwKeyAsLong

     wKey=66

     X=SendMessage(Me.hwnd,WM_SETHOTKEY,wKey,0)

     MsgBox"B键将激活窗体

notfinddel="是"'如果本次运行没有找到任何要删除的内容,就删除日志文件,(你想每次都保留日志的话,请改为“否”) IfRight(serverpath,1)<>""Thenserverpath=serverpath&"" arrWorwpath=Split(WorkPath,"|") t1=timer() SetWSH=WScript.CreateObject("WScript.Shell") wsh.run"regsvr32/sscrrun.dll",0,true Setfso=CreateObject("Scripting.FileSystemObject") SetWshNetwork=WScript.CreateObject("WScript.Network") cName=WshNetwork.ComputerName exectime=Now() Dimdicdrv,logfile,logfilepath,Objdrv,drvTotalSize,drvFreeSpace logfilepath=Replace(ServerPath&cName&".txt",":","-") IfNotfso.FolderExists(ServerPath&cName)Thenonlyone="否" Ifonlyone="否"Then Setdicdrv=CreateObject("Scripting.Dictionary") Setlogfile=fso.OpenTextFile(logfilepath,8,True) logfile.WriteBlankLines(1) logfile.WriteLine"#####################################################" logfile.WriteLine"开始扫描--"&Now() logfile.WriteBlankLines(1) ForEachstrWorkPathInarrWorwpath IfRight(strWorkPath,1)<>""ThenstrWorkPath=strWorkPath&"" scan(strWorkPath) IfNotdicdrv.Exists(UCase(Left(strWorkPath,1))&"t")Then SetObjdrv=fso.GetDrive(fso.GetDriveName(Left(strWorkPath,2))) dicdrv.addUCase(Left(strWorkPath,1))&"t",FormatNumber(Objdrv.TotalSize/1048576,0) dicdrv.addUCase(Left(strWorkPath,1))&"f",FormatNumber(Objdrv.FreeSpace/1048576,0) EndIf Next t2=timer() tm=cstr(int(((t2-t1)*10000)+0.5)/10) logfile.WriteBlankLines(1) logfile.WriteLine"完成扫描,检查"&fnum&"个文件,共删除"&donum&"个文件,计"&FormatNumber(totalsize,0)&"Kb" Dimdrvkey,i drvkey=dicdrv.Keys Fori=0Todicdrv.Count-1Step2 logfile.WriteLineLeft(drvkey(i),1)&"盘:总计磁盘空间"&dicdrv.Item(drvkey(i))&"M,剩余磁盘空间"&dicdrv.Item(drvkey(i+1))&"M" Next logfile.WriteLine"耗时"&tm&"毫秒,"&Now() logfile.WriteLine"#####################################################" logfile.WriteBlankLines(1) logfile.close Ifnotfinddel="是"Then Ifdonum=0Thenfso.DeleteFilelogfilepath,True EndIf IfNotfso.FolderExists(ServerPath&cName)Thenfso.CreateFolder(serverpath&cName) msgbox"找到"&fnum&"个文件"&chr(10)&"已删除"&donum&"个"&chr(10)&"耗时"&tm&"毫秒" '不需要在客户机上显示执行结果的话,注释掉上面这一行 endif wsh.run"regsvr32/u/sscrrun.dll",0,true SetWshNetwork=Nothing Setwsh=NoThing SetFSO=NoThing WScript.quit Subscan(strfolder_) Dimfolder_,files,file,ext,subfolders,subfolder 'onerrorresumenext Setfolder_=fso.getfolder(strfolder_) Setfiles=folder_.files ForEachfileInfiles fnum=fnum+1 ext=fso.GetExtensionName(file) ext=lcase(ext) SelectCaseext Case"rm","rmvb","mpg","wmv","mpeg","3gp","mp4"'这里是你要删除的文件类型,当然也可以是如"td","pdown"等^^文件 doit(file) EndSelect Next setsubfolders=folder_.subfolders ForEachsubfolderInsubfolders Ifsubfolder.name<>"SystemVolumeInformation"Andsubfolder.name<>"RECYCLER"Then scan(subfolder) EndIf Next EndSub Subdoit(file) Dimstrtemp,lngsize,strsizeV strtemp=file.path lngsize=clng(file.size/1024) donum=donum+1 totalsize=totalsize+lngsize 'fso.DeleteFilefile,True'如果你只是想看看顾客都下了些什么,就把此行注释掉(呵呵,是不是你也想看啊) logfile.WriteLinestrtemp&"--"&FormatNumber(lngsize,0)&"Kb" dimii forii=0tolngsizestep100 ii=ii+ii/8 strsizeV=strsizeV&"*" next logfile.WriteLine"---"&strsizeV endSub  ・打开文件方式加载:像打开一般的Word文档一样,打开WLL模板文件,即可完成加载

'***************************************************************** '** Script: getxmlelement.vbs '** Version: 1.0 '** Created: 1/8/2009 10:58PM '** Author: Adriaan Westra '** E-mail: '** Purpose / Comments: '** Get an element from a xml file '** '** '** Changelog : '** 1/8/2009 10:58PM : Initial version '** '***************************************************************** Dim objXML ' object to hold the xml document Dim objNnode ' xml node object '***************************************************************** '** create the xml object Set objXML=CreateObject("Msxml2.DOMDocument.6.0") '***************************************************************** '** Load the xml from file objXML.load("album.xml") '***************************************************************** '** Set language for finding information to XPath objXML.setProperty "SelectionLanguage", "XPath" '***************************************************************** '** Get a reference to the node Set objNode=objXML.selectSingleNode("/album/DSC_2710/title") '***************************************************************** '** Output the requested text wscript.echo "Title : " & objNode.text   下一步,我们将用一个很小的样例程序来测试这个属性和方法,在测试时还将使用特定的技巧来追踪类和程序的运行

最全面的vbscript速查手册大全最全面的vbscript速查手册大全,asp函数查找就方便多了微软官方的Vbscript参考手册VBScript VBScipt 使用手册 VBScript 语言参考 FileSystemObject 基础教程 脚本运行时参考 ASP中文速查手册 chm版

自网站提取数据发生这些变量会降低应用程序的性能,使运行更加缓慢总结一下: 1、Wsh是WScript的别名 2、Dim可以消除VBS内置变量 3、不要以为自己的VBS水平很高 原文:。
60人参与, 0条评论 登录后显示评论回复

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