人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁面

如何在ASP中完成PING

如何在ASP中完成PING

更新時間:2022-07-15 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):

   使用WSH調(diào)用系統(tǒng)的Ping命令,將Ping的結(jié)果重定向到一個文本文件中去,再把文本文件顯示到網(wǎng)頁中  
  具體做法如下:首先,建一個.BAT文件(例如:myPing.BAT:),這個文件要在ASP中調(diào)用,文件代碼如下:ping -a %1 > d:INetPubcgi-bin%2.txt (%1)是將來要ping的地址, (%2)是存儲ping結(jié)果的文件.以下是ASP的代碼:  
  <%Set FileSys = Server.CreateObject("Scripting.FileSystemObject")FileName = FileSys.GetTempName  
  Set WShShell = Server.CreateObject("WScript.Shell")  
  IP = "xxx.xxx.xxx.xxx" '你要ping的地址RetCode = WShShell.Run("d:Inetpubcgi-binmyPing.bat " & IP & " " & FileName, 1, True)  
  if RetCode = 0 Then'沒有錯誤elseResponse.Redirect "PingErrors.htm"end if  
  Set TextFile = FileSys.OpenTextFile("d:InetPubcgi-bin" & FileName & ".txt", 1)TextBuffer = TextFile.ReadAll  
  For i = 1 to Len(TextBuffer)  
  If Mid(TextBuffer,i,1) = chr(13) Then  
  Response.Write("<BR>")  
  else  
  Response.Write(Mid(TextBuffer,i,1))  
  end if  
  Next  
  TextFile.Close  
  FileSys.DeleteFile "d:Inetpubcgi-bin" & FileName & ".txt"  
  %>

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 库伦旗| 东乡| 泾川县| 阜阳市| 鹤庆县| 灌云县| 合江县| 丰原市| 卢龙县| 泊头市| 乌拉特后旗| 河曲县| 平乡县| 林周县| 淮滨县| 乌兰察布市| 抚远县| 迁安市| 武功县| 湖州市| 龙陵县| 荣成市| 深州市| 石首市| 康保县| 临西县| 靖江市| 灵山县| 嘉黎县| 阿克陶县| 平顶山市| 潞西市| 南木林县| 敦化市| 西贡区| 香港| 彭泽县| 来凤县| 黔江区| 孟津县| 句容市|