《拓文asp.net网站内容管理系统》官方演示站。
 设为首页  
 收藏本站
 作者:黄振安
 QQ:53854651
首 页 开源拓文.NET编程网站编程网页设计图形图像数据库软件工程留言本
    站内搜索:  
您现在的位置: 拓文网络 → .NET编程 → ASP.NET → ASP.NET追捕休整版[正文]

热 门 文 章

相 关 文 章
  • ASP.NET性能优化
  • 在.NET框架应用程序中发送电子邮件
  • .net打包自动安装数据库
  • asp.net开发wap必备:更好的匹配手机设备
  • 用ashx动态生成文件
  • windows 2003下asp.Net站点无法使用用户名+密码的方
  • ASP.NET中17种正则表达式
  • 提高ASP.Net应用程序性能的十大方法
  • 一个通过web.Mail发送邮件的类
  • 在DataGrid里面根据日期的不同显示new图标
  • ASP.NET追捕休整版
     
    [作者:不详    转贴自:不详    点击数:    更新时间:2006-3-2 15:41:04]


     private void DetectService(IPAddress theIP)
     {
     string tFtp = TcpConnect(theIP,21); //is ftp service
     string tTelnet = TcpConnect(theIP,23); //is Telnet service
     string tDns = TcpConnect(theIP,43); //is Dns service
     string tPop = TcpConnect(theIP,110); //is Pop3 service
     string tSmtp = TcpConnect(theIP,25); //is Mail smtp service
     if(tFtp!="None")strFtp = tFtp;
     if(tTelnet!="None")strTelnet = tTelnet;
     if(tDns!="None")strDns = tDns;
     if(tPop!="None")strPop = tPop;
     if(tSmtp!="None")strSmtp = tSmtp;
     
     TcpClient tcp = new TcpClient();
     tcp.Connect(theIP,80);
     int tHttpStart;
     string tHttp;
     string tMsg = "POST /index.htm HTTP/1.1\r\n" +
      "Connection: Keep-Alive\r\n\r\n";
     Stream sm = tcp.GetStream();
     sm.Write(Encoding.Default.GetBytes(tMsg.ToCharArray()),0,tMsg.Length);
     StreamReader sr = new StreamReader(tcp.GetStream(),Encoding.Default);
     while(sr.Peek()!=-1)
     {
     tHttp= sr.ReadLine();
     tHttpStart = tHttp.IndexOf("Server");
     if(tHttpStart!=-1)
     {
     strHttp = tHttp;
     break;
     }
     }
     tcp.Close();
     }
     
     private string TcpConnect(IPAddress theIP,int Port)
     {
     TcpClient tcp = new TcpClient();
     StreamReader sr;
     string result;
     try
     {
     checked
     {
     tcp.Connect(theIP,Port);
     sr = new StreamReader(tcp.GetStream().ToString(),Encoding.Default);
     resu

    lt = sr.ReadLine().ToString();
     tcp.Close();
     }
     }
     catch
     {
     result = "None";
     }
     return result;
     }
     
     private void DetectPort(IPAddress theIP)
     {
     //is
     if(strHttp.IndexOf("Microsoft")!=-1)
     {
     strSystem = "Windows";
     if(strHttp.IndexOf("IIS")!=-1)
     {
     strSystem="Windows NT/2000";
     if(strHttp.IndexOf("5.0")!=-1)
     strSystem="Windows 2000";
     else
     strSystem="Windows NT";
     }
     }
     else if(strHttp.IndexOf("Apache")!=-1)
     {
     strSystem = "Unix/Linux";
     if(strHttp.IndexOf("Unix")!=-1)
     strSystem="Unix";
     }
     else
     {
     if(TcpConnect(theIP,139)!="None")
     strSystem="Windows 98/Me";
     else if(TcpConnect(theIP,1433)!="None")
     strSystem="Windows NT/2000";
     else
     strSystem="Windows/Linux/Unix";
     }
     }
     
     private void IPListbox_SelectedIndexChanged(object sender, System.EventArgs e)
     {
     lblIpInfo.Text = IPListbox.Text.ToString()+",所在地查询未实现!";
     txtHostname.Text = IPListbox.Text.ToString();
     }
     
     private void button1_Click(object sender, System.EventArgs e)
     {
     Application.Exit();
     }
     
     private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
     {
     linkLabel1.Show();
     }
     
     
     完整的代码和编译过的程序:http://202.103.224.224/icools/bbs/non-cgi/usr/5_2.zip
     
     记得一定要装 .NET FrameworkSDK beta2
     
     我是初学者,有问题一起研究!
     
     by 萧寒雪(S.F.)



    首页 | 1 | 2 | 尾页  共 2 页
     
    winner 打印本页 关闭窗口

         文 章 评 论
    评论人 查看该文章的评论 发表时间
       笔 名* : 0 50分 60分 70分 80分 90分 100分
    评论内容 *: (最多1000字。当前字数:0)


    没有相关评论,欢迎您参与!

    - 关于本站 - 网站帮助 - 下载声明 - 友情连接 - 网站地图 -
    Copyright © 2005-2006 myTopWin.Com. All Rights Reserved . [桂ICP备06004496号]