联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
set shl=createobject("wscript.shell") set spv=createobject("sapi.spvoice") Set ie= createobject("InternetExplorer.Application") set fso=createobject("scripting.filesystemobject") function readfile(txtfile) set f=fso.opentextfile(txtfile,1) ie.Navigate "about:blank" ie.ToolBar= 0 ie.StatusBar= 0 ie.Left= 100 ie.Top= 100 ie.Width= 800 ie.Height= 300 ie.Visible= 1 ie.Document.Title="Reading---"&txtfile wscript.sleep 421 shl.appactivate "Reading---" do until f.AtEndOfStream toread=f.readline line2="<font color=#0044aa size=16>"&toread&"</font>" ie.Document.Body.InnerHTML=line1&line2 spv.speak(toread) loop f.close end function line1="<center><B>现在<a href=http://182484135.qzone.qq.com>据说是李先生</a>正在为你朗读</B><center><BR><BR>" if wscript.arguments.count<1 then toread=inputbox("使用方法"&chr(13)&chr(13)&"1 直接把一个文本文件拖动到本程序上"&chr(13)&"2 在此处输入一个英文句子"&chr(13)&"3 不输入任何字符则会读取剪贴板内容","Input") if not toread="" then spv.speak(toread) else ie.navigate "about:blank" ie.visible=False tmpfile=fso.getspecialfolder(2)&"\clipbrd.txt" set f=fso.opentextfile(tmpfile,2,true) str=ie.document.parentwindow.clipboarddata.getdata("text") f.Write str f.close wscript.sleep 1000 readfile(tmpfile) Set f=fso.getfile(tmpfile) f.delete end if else readfile(wscript.arguments(0)) end if
附件 1: ReadEnglishText.rar (2009-1-12 19:47, 948 bytes,下载次数: 25)
Originally posted by HAT at 2009-1-12 09:22 PM: 让XP语音阅读你的文本文件 http://www.cn-dos.net/forum/viewthread.php?tid=24016 通过右键朗读IE里的选定文本 http://www.cn-dos.net/forum/viewthread.php?tid=2 ...