当前位置:编程学习 > asp >>

ASP查看网络设置代码实例

答案:

<%@ Language="VBScript" %>
<% Option Explicit %>
<html>
<head>
    <title>查看网络设置</title>
</head>
<body bgcolor="#FFFFFF">
<%
    dim strHost
    dim oShell,oFS,oTF
    dim i,Data,tempData
    strHost="ipconfig"
    Set oShell = Server.CreateObject("Wscript.Shell")
    oShell.Run "%ComSpec% /c ipconfig > C:\" & strHost & ".txt", 0, True
    Set oFS = Server.CreateObject("Scripting.FileSystemObject")
    Set oTF = oFS.OpenTextFile("C:\" & strHost & ".txt")
    Do While Not oTF.AtEndOfStream
        Data = Trim(oTF.Readline)
            If i > 2 Then
                tempData = tempData & Data & "<BR>"
            End If
        i = (i + 1)
    Loop
    response.write tempData
    oTF.Close
    oFS.DeleteFile "C:\" & strHost & ".txt"
    Set oFS = Nothing
%>
</font>
</body>
</html>


 

上一个:ASP面向对象日历实例
下一个:ASP字符串加密解密代码实例

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,