欧美特黄不卡,涩涩视频在线,成人国产精品一区二区网站,亚洲一区二区三区欧美

當前位置:雨林木風下載站 > 技術開發教程 > 詳細頁面

用ASP做的DNS LOOKUP程序

用ASP做的DNS LOOKUP程序

更新時間:2022-05-08 文章作者:未知 信息來源:網絡 閱讀次數:

文章轉譯自ASP101

運行環境,NT(SERVER、WORKSTATION)、W2K

服務器上需要安裝WSH2.0或者更高版本

如果您的系統目前沒有安裝WSH2.0,您可以從以下這個地址去下載它

http://www.microsoft.com/msdownload/vbscript/scripting.asp

里面包含了WSH2.0

下面是源代碼

<%@ Language="VBScript" %>
<% Option Explicit %>
<%
If Request.Form("frmHost") = "" Then
    '設置初始值
    strIP = Request.ServerVariables("REMOTE_ADDR")
Else
    strIP = Request.Form("frmHost")
End If
%>
<html>
<head>
    <title>DNS Lookup [v 1.0]</title>
</head>
<body bgcolor="#FFFFFF">

<form Method="POST" Name="frmRDNS">
    <label for="frmHost"><u>Host:</u></label>
    <input type="text" name="frmHost" ID="frmHost"
        value="<%= strIP  %>">
    <input type="button" name="btnSubmit" ID="btnSubmit"
        value="Lookup" onClick="document.frmRDNS.submit()">
</form>

<font face="arial" size="2" color="#003366">
<%
rMethod = uCase(Request.ServerVariables("REQUEST_METHOD"))
If rMethod = "POST" Then
    ' Lookup Host
    strReturn = nsLookup(strIP)
    If strReturn <> "" Then
        Response.Write strReturn
    Else
        ' A Lame Host is any Valid Host that DNS Cannot Resolve
        ' See InterNic for Details
        Response.Write "<b>Lame Host - Could Not Resolve DNS For " _
            & strIP & "</b><br>"
    End If
End If

Function NSlookup(strHost)
    'Create Shell Object
    Set oShell = Server.CreateObject("Wscript.Shell")
    'Run NSLookup via Command Prompt
    'Dump Results into a temp text file
    oShell.Run "%ComSpec% /c nslookup " & strHost _
        & "> C:\" & strHost & ".txt", 0, True

    'Open the temp Text File and Read out the Data
    Set oFS = Server.CreateObject("Scripting.FileSystemObject")
    Set oTF = oFS.OpenTextFile("C:\" & strHost & ".txt")

    tempData = Null
    Data = Null
    i = 0
    Do While Not oTF.AtEndOfStream
        Data = Trim(oTF.Readline)
            If i > 2 Then ' Don't want to display local DNS Info.
                tempData = tempData & Data & "<BR>"
            End If
        i = (i + 1)
    Loop

    'Close it
    oTF.Close
    'Delete It
    oFS.DeleteFile "C:\" & strHost & ".txt"

    Set oFS = Nothing
    nsLookup = tempData
End Function
%>
</font>

</body>
</html>

代碼很簡單,我不多說了,如果您對WSH有什么疑問的話,請去下載WSH的電子文檔中文版本的,CHINAASP下載區就有的吧

希望能對你有所幫助。

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

本類教程下載

系統下載排行

主站蜘蛛池模板: 丹寨县| 建阳市| 德州市| 常州市| 胶州市| 林周县| 祁东县| 华安县| 思茅市| 枣庄市| 无锡市| 丹巴县| 饶平县| 雷波县| 江永县| 芜湖市| 分宜县| 上饶县| 鄂托克前旗| 沽源县| 林州市| 丰县| 邹平县| 普兰店市| 盐亭县| 抚远县| 饶平县| 石棉县| 云霄县| 南华县| 大埔区| 梨树县| 文成县| 宿迁市| 东乡县| 健康| 吕梁市| 马边| 马尔康县| 威远县| 靖江市|