首页 相关文章 在ASP中执行Ping命令并且返回结果

在ASP中执行Ping命令并且返回结果

  在Win2000系统中,可以通过Wscript.Shell对象的Exec方法执行命令,

  简单的代码如下:

  % Response.Buffer = true %
  %
   url = "www.topronet.com"
  
   Set objWShell = CreateObject("WScript.Shell")
   Set objCmd = objWShell.Exec("ping " & url)
   strPResult = objCmd.StdOut.Readall()
   set objCmd = nothing: Set objWShell = nothing
  
   strStatus = "离线"
   if InStr(strPResult,"TTL=")0 then strStatus = "在线"
  
   response.write url & " 状态为: " & strStatus
   response.write ".br" & ...[ 查看全文 ]

2016-02-19 标签:

在ASP中执行Ping命令并且返回结果的相关文章

手机页面
收藏网站 回到头部