制作内幕 游戏 网站 图标 | 理论 图标在线制作 | 看图软件 访谈活动 | 教程 技术 万年历
当前位置:首页>CG 教 程>网站开发>ASP.NET>

相关文章

推荐文章

     

热门文章

网上追捕(很多实用的port)

作者:CG谷 出处: 发布时间:2006-07-11 字体: [ ]

豆腐制作 都是精品
http://www.asp888.net 豆腐技术站

我们可以在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>


↑返回顶部   打印本页   关闭窗口↓  
收藏本文到:天极网摘 新浪VIVI 和讯网摘 博彩中心 365Key网摘 poco网摘 狐摘
亿友响享Yeeyoo igooi-it网摘 5seek网摘 I2Key 我摘网摘 天下图摘 YouNote 百特门
用户名: 新注册) 密码: 匿名评论 [所有评论]
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
设计服务 | 广告投放 | 友情链接 | 关于本站 | 联系我们 | 版权声明 | 设为首页 | 加入收藏