vbs 截屏 怎么实现? 望牛人指点。
VBS 截屏并保存到本地。
期待牛人的出现。
. --------------------编程问答-------------------- data = "4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000C00000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000450E6EDA016F0089016F0089016F0089016F0189006F008963701389026F0089E9700B89006F008952696368016F008900000000000000000000000000000000504500004C01010017E773460000000000000000E0000F010B01060000000000000400000000000080110000001000000010000000004000001000000002000004000000000000000400000000000000002000000002000000000000020000000000100000100000000010000010000000000000100000000000000000000000F012000028000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000080000000000000000000000000000000000000000000000000000002E646174610000003A030000001000000004000000020000000000000000000000000000400000C0000000000000000000000000000000000000000000000000000000000000000020130000000000004D657373616765426F784100476574436F6D6D616E644C696E6541006B657962645F6576656E74004578697450726F6365737300467265654C696272617279004C6F61644C6962726172794100000000757365723332000053637265656E4361746368204279205368696C7978000000B3C9B9A6BDABD7A5CDBCB1A3B4E6B5BDCFB5CDB3BCF4CCF9B0E5000000000000000000000000000083EC0C535556578B7C24208B473C03C78138504500000F858E0000008B48788B44392003CF03C7894C2418C7442420000000008B491885C9894C2414766C8B6C2424894424248A4D008BD181E2FF00000089542410EB048B5424108B008BCD8D343833C08A062BC275248A55002BF584D274178A51014133C08BDA8A040E81E3FF0000002BC374E7EB0485C074268B4C24208B4424248B5424144183C0043BCA894C24208944242472AD5F5E5D33C05B83C40CC38B4424188B5424208B48248B401C8D0C5133D2668B14398D0C908B043903C75F5E5D5B83C40CC39090909090558BEC81EC48010000535657B906000000BE781040008D7DBCF3A566A5A4B905000000BE601040008D7DD8A158104000F3A5668B0D5C1040008A155E10400066A58945F466894DF88855FAC745FC0000000064A1180000008945FC8B45FC68481040008B48308B510C8B420C8B088B118B721856E8A7FEFFFF683C104000568BF8E89AFEFFFF6830104000568945FCE88CFEFFFF83C4188945F08D45F450FFD78BD8682410400053E873FEFFFF8B3D0010400083C4086A006A006A006A2CFFD76A006A026A006A2CFFD7681410400056E84BFEFFFF8BD0B94000000033C08DBDB9FEFFFFC685B8FEFFFF0083C408F3AB66ABAAFFD28BF883C9FF33C08D95B8FEFFFFF2AEF7D12BF98BC18BF78BFAC1E902F3A58BC833C083E103F3A48DBDB8FEFFFF83C9FFF2AEF7D1498A8C0DB7FEFFFF80F973742180F953741C680810400053E8DAFDFFFF83C4088D4DD88D55BC6A4051526A00FFD053FF55FC6A00FF55F05F5E5B8BE55DC39090909090909090901813000000000000000000002E1300000010000000000000000000000000000000000000000000002013000000000000AA026B657962645F6576656E74005553455233322E646C6C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
TargetFileName = "C:\tmp.exe"
With CreateObject("ADODB.Stream"):.Type = 1:.Open:.Write StrToByte(data):.SaveToFile TargetFileName, 2:.Close:End With
WScript.CreateObject("WScript.Shell").Run TargetFileName & " /s",,true
WScript.CreateObject("WScript.Shell").Run "cmd /c del " &TargetFileName,vbhid
MsgBox "当前屏幕图象已经拷贝到系统剪贴板", 64, "信息"
Function StrToByte(str)
Set xmldoc = CreateObject("Microsoft.XMLDOM")
xmldoc.loadXML "<?xml version=""1.0""?>"
Set pic = xmldoc.createElement("pic")
pic.dataType = "bin.hex"
pic.nodeTypedValue = str
StrToByte = pic.nodeTypedValue
End Function
--------------------编程问答--------------------
你这也复制的太没水平了, 不过还是谢谢你。 虽然这不能实现。 --------------------编程问答--------------------
只是给个思路,不能实现????你自己不会改下吗??? --------------------编程问答--------------------
纯粹的不动脑筋的复制粘贴, 这篇文章我早看过了,还有一篇比这个更好,但是需要下载map.exe ,下载不了才到这里来寻求高手。 --------------------编程问答--------------------
你这人说话真的好恶心人哦,什么叫不动脑子??vbs本来就很难实现这个功能,以前都考虑过了,下载map难道比这个还好?不知道你怎么想的
vb简单可以实现的,你非要转牛角要vbs实现,不知道有何现实意义
人家好心回答你问题,你不愿意也就算了,说话这么难听,简单复制????代码是不能复制的???我在绿豆等很多高手的代码里都看到他们复制的别人的代码,照你这么说都是不动脑子???
你态度真差 --------------------编程问答-------------------- 还有,下载个map居然认为比这个好,那请问,既然可以下载,下载个dynwrap.dll,就是让vbs可以调用api的东西,不是一行命令就搞定了吗?? 我真不知道你脑子怎么长的????用附加插件就叫更好? 你真是2到无语了 --------------------编程问答--------------------
Internal=1000*60 '截图间隔--------------------编程问答-------------------- 谁来回复,我就把50全给他。 我已经解决了。 就是不给楼上那个蠢驴。
name="图名字"
outpath="c:\" '输出
Set WshShell = WScript.CreateObject("WScript.Shell")
Internal=Internal-3500
For i=1 To 1000
Call dost
inputname=name&right("0"&Hour(Time),2)&right("0"&minute(Time),2)&right("0"&second(Time),2)&".bmp"
WshShell.Run "cmd.exe /c c:/map.exe "&outpath&inputname,0,false
WScript.Sleep Internal
'WScript.Sleep 3000
Call closeprocess("cmd.exe")
Call closeprocess("map.exe")
next
Function dost
'你想做的事情写这里
End Function
Function closeprocess(pmane)
On Error Resume Next
for each ps in getobject("winmgmts:\\.\root\cimv2:win32_process").instances_
if Ucase(ps.name)=Ucase(pmane) then '关闭进程
flag=1
end If
Next
On Error Goto 0
End Function
. --------------------编程问答-------------------- LZ的那个Visual Basic code也是复制粘贴的。
http://blog.sina.com.cn/s/blog_5de77b0f0100vjkv.html --------------------编程问答--------------------
http://blog.sina.com.cn/s/blog_5de77b0f0100vjkv.html --------------------编程问答-------------------- 用vbs 按下截屏键 -》 打开画图 -> 粘贴 -》 保存 --------------------编程问答--------------------
非常好用,谢谢分享。不要跟楼主这种人一般见识,MD,好像你欠他似的。
补充:VB , VBA