記憶盒子

把記憶裝進(jìn)灰色的盒子,封裝起來,那年那月,重新拾起。

首頁搜索目錄
search
當(dāng)前主題: 軟件編程

asp執(zhí)行ping命令

作者:Kaka    時(shí)間:2009-9-6 22:49:2    瀏覽:    評(píng)論:0

      用asp獲取ping值,可以通過Wscript.Shell對(duì)象的Exec方法執(zhí)行命令,返回結(jié)果。

      代碼如下:

<% Response.Buffer = true %>
<%
    url = "www.baidu.com"
 
    Set objWShell = CreateObject("WScript.Shell")
    Set objCmd = objWShell.Exec("ping " & url) 
    strPResult = objCmd.StdOut.Readall()
    set objCmd = nothing: Set objWShell = nothing 
 
    response.write url
    response.write ".<br>" & replace(strPResult,vbCrLf,"<br>")
%>

       執(zhí)行結(jié)果

www.baidu.com.

Pinging www.a.shifen.com [121.14.89.14] with 32 bytes of data:

Reply from 121.14.89.14: bytes=32 time=11ms TTL=57
Reply from 121.14.89.14: bytes=32 time=12ms TTL=57
Reply from 121.14.89.14: bytes=32 time=12ms TTL=57
Reply from 121.14.89.14: bytes=32 time=12ms TTL=57
Ping statistics for 121.14.89.14:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 11ms, Maximum = 12ms, Average = 11m

x

標(biāo)簽: Asp  

※ 網(wǎng)站速度慢?試試網(wǎng)站自動(dòng)優(yōu)化工具 ※

上一篇: ibm筆記本突然連不上無線網(wǎng)絡(luò)的解決方法
下一篇: asp.net(c#)中實(shí)現(xiàn)ping功能

發(fā)表評(píng)論:

◎歡迎參與討論,請(qǐng)?jiān)谶@里發(fā)表您的看法、交流您的觀點(diǎn)。

訂閱博客                   QQ交流群(312716741)

  • 通過Google訂閱本站 通過鮮果訂閱本站 通過抓蝦訂閱本站
  • 通過QQ郵箱訂閱本站 通過Yahoo訂閱本站 通過有道訂閱本站

Search

最新評(píng)論及回復(fù)

最近留言

網(wǎng)站分類

Powered By Z-Blog 1.8 Walle Build 91204 Designed by Han'space

Copyright @2009-2024 All Rights Reserved. 粵ICP備14028160號(hào)-1

Powered By Z-Blog 1.8 Walle Build 91204
Copyright @2009-2024 All Rights Reserved.