netconfig.asp

来自「集合了学习asp的100个实例」· ASP 代码 · 共 34 行

ASP
34
字号
<%@ 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>



 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?