|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
我们可以在Asp.Net中通过使用Sockets Class 来对InterNet 上的主机进行远程的控制和探测(不要搞破坏呀!) 下面的例子中豆腐给大家提供一个例子,可以对 指定的主机进行 探测:)功能类似 追捕。 <%@ Import Namespace="System.Net" %> <% @Import Namespace="System.Net.Sockets" %> <%@ Import Namespace="System.IO" %> <script language="C#" runat=server> protected void Page_Load(Object Src, EventArgs E){ TCPClient tcpc = new TCPClient(); String host="host"; showmsg.Text=TcpConnect(tcpc,host,25); //SMTP 端口 /* showmsg.Text=TcpConnect(tcpc,host,80); //WWW 端口 showmsg.Text=TcpConnect(tcpc,host,21); //FTP 端口 showmsg.Text=TcpConnect(tcpc,host,110); //Pop 端口 showmsg.Text=TcpConnect(tcpc,host,1080); //Socket5 端口 代理服务器使用的端口 showmsg.Text=TcpConnect(tcpc,host,53); //DNS 端口 */ } String TcpConnect(TCPClient tcpc,String host,int port){ StreamReader sr ; String strRet="123"; if(0 == tcpc.Connect(host,port)){ //联结服务器成功 sr = new StreamReader(tcpc.GetStream(), Encoding.Default); strRet=sr.ReadLine(); } return strRet; } </script> <html> <head> <title>网络追捕</title> <link rel="stylesheet" type="text/css" href="/doufu.css"> </head> <body> <asp:Label id=showmsg runat=server /> </body> </html> 返回类别: 教程 上一教程: ASP漏洞集-用ASP实现网页保密的两种方式 下一教程: 用ASP实现开关IIS不重启电脑 您可以阅读与"网上追捕(很多实用的PORT)"相关的教程: · ASP编程中异常实用的例子 · 一个实用的FSO-实时统计在线人数 · 一套相称实用的加解密字符串的函数 · ASP中实用的广告交替组件 · 5个实用的ASP网站功能(GIB5) |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |