当前注册人数24488人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB   站内搜索 BBS讨论社区 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到跟多的建议

ASP.NET网站端口扫描源代码

port scan with asp.net

2007年12月09日
C#, Windows, .NET 2.0, ASP.NET, IIS 6, VS2005, Dev
本程序是一个ASP.NET程序,通过这个网页,你可以对任何一个主机或者网站(域名)进行端口扫描,发现对方主机打开了什么样的端口,是什么样的服务运行在该端口上。程序采用了多线程机制,同时对多个端口进行探测。

源代码及技术文章下载(请点击下面的原文链接下载)


源码图片
请点击链接查看大图
关键内容

试探端口的方法:

public void portAc(object portNoObj)
{
    int portNo = (int)portNoObj;
    TcpClient TcpScan = new TcpClient();
    try
    {
        // Try to connect

        TcpScan.Connect(ipAdres, portNo);

        if (!TcpScan.Connected) return;
        // If there's no exception, we can say the port is open

        log += "Port " + portNo + " open\r\n";

        //NOTE: We may include more finger tips to here

        switch (portNo)
        {
            case 80: http = true; break;
        }

        try
        {
            DataRow dr = dt.NewRow();
            dr[0] = "http://www.portsdb.org/bin/portsdb.cgi?portnumber=" + 
                     portNo + "&protocol=ANY&String=";
            dt.Rows.Add(dr);
        } // Ends Try

        catch (Exception Err)
        {
            throw Err;
        }
    }
    catch
    {
        // An exception occured, thus the port is probably closed

    }
}
从本站下载附件及源代码(1个附件,已经成功下载44次)

最值得关注的外文源代码

Web Conference
Converting ASP.NET site into a SharePoint site
Troubleshooting Partial Rendering Errors in ATLAS and ASP.NET 2.0
Sample Application to Integrate Silverlight and ASP.NET AJAX
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
所有评论

xzx258  2008年12月25日
还不错 试了下
wjq  2008年10月30日
看了一下,感觉还行
fengjun7719  2008年10月25日
呵和~!
fengjun7719  2008年10月25日
喜欢~!试试去~!
liyachi  2008年10月24日
不错
aking  2008年10月09日
ASP.NET网站端口扫描源代码
leiryhp  2008年08月30日
ASP.NET网站端口扫描源代码
leiryhp  2008年08月29日
ASP.NET网站端口扫描源代码
CopyRight (C) codesoso.com 2007-2008 All Rights Reserved   免责声明