39 lines
9.4 KiB
HTML
39 lines
9.4 KiB
HTML
<div id="sina_keyword_ad_area2" class="articalContent ">
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">一、弹出窗口</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">1、msg命令</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">msg %username% "Hello!"</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">2、mshta程序</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(1)利用vbsript的msgbox函数</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">mshta vbscript:msgbox("Hello!",64,"窗口 ")(window.close)</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(2)利用vbscript的popup方法</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">mshta vbscript:CreateObject("Wscript.Shell").popup("Hello ",7," 窗口",64)(window.close)</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(3)利用javascript的alert方法</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">mshta javascript:window.alert("Hello ");window.close()</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(4)利用javascript的popup方法</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">mshta "javascript:new ActiveXObject('WScript.Shell').popup('Hello!',7,'窗口',64);window.close();"</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(5)javascript的confirm方法</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">mshta javascript:confirm("ha");window.close()</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(6)javascript的execScript方法-- alert</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">mshta vbscript:window.execScript("alert('hello world!');","javascript")</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(7)javascript的execScript方法-- msgBox</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">mshta javascript:window.execScript("msgBox('hello world!'):window.close","vbs")</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(8)javascript的execute方法</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">mshta vbscript:execute("msgbox ""one BOX"":msgbox ""two BOX"":window.close")</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">二、播放声音</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">1. mshta程序</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">mshta vbscript:createobject("sapi.spvoice").speak("我是人!")(window.close)</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;"> </p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">三、几点注意</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">1 、ping -n 1 127.1>nul</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(1)ping是测试网络连接性的网络命令,参数"-n 1"表示只发送一次ICMPS数据包来测试网络的连接性。</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(2)127.1表示本机保留IP地址,实际就是127.0.0.1,ping 127.1就表示ping 127.0.0.1,可以测试网卡及TCP/IP协议是否正常安装及工作。</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(3)">nul"表示把命令产生的屏幕显示信息重定向(>)到空设备(nul),这样在屏幕上就没有显示ping命令的执行结果了。>nul 是屏蔽标准输出在屏幕上的显示,2>nul 是屏蔽出错显示,“>nul 2>nul ”是无论对错,都屏蔽屏幕显示。</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">在批处理中一般用来延时用,这也根本不是一个计时的命令,没法"显示计时",只是运行这条命令大约要1秒钟而已.. 可以简化写成ping -n 2 127.1 >nul,还有两个0命令运行时会自动补上. >nul是不显示ping命令执行结果信息. /n后面定义发送数据包的数量,发送2个包约用时1秒,不过这个时间不大精确.. 127.0.0.1是一个本机ip,不管是否有连网,只要电脑上有网卡这个ip就存在,常有人用这个ping命令来测试网卡是否完好..</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">2、控制</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(1)暂停批处理:直接按键盘上的Pause键喽</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">(2)终止批处理:组合键Ctrl+C。不过,有时候它好像响应的不太积极啊…</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">四、 用户交互</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">1. color命令:设置窗口背景色和字体颜色,用color/?查看</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">2. mode命令:设置窗口大小"MODE CON [COLS=c] [LINES=n]",cols即宽度,lines即高度。</p>
|
||
<p style="margin: 0px 0px 5px; padding: 0px; border: 0px; list-style: none; word-wrap: normal; word-break: normal; color: #494949; font-family: simsun; background-color: #ffffff;">3. msg命令:GUI交互窗口,详细内容参见msg /?。</p>
|
||
</div> |