• 大小: 2.07MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-15
  • 语言: C#
  • 标签: C#  网络爬虫  

资源简介

C# 网络爬虫 运行情况挺好的

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NWebCrawlerLib;
using System.Diagnostics;

// 源码下载 www.51aspx.com 
namespace NWebCrawler
{
    public partial class MainForm : Form
    {
        #region Fields

        private PerformanceCounter m_cpuCounter;
        private PerformanceCounter m_ramCounter;
        private Downloader m_downloader;

        #endregion

        #region Properties

        // number of bytes downloaded
        private int nByteCount;
        private int ByteCount
        {
            get { return nByteCount; }
            set
            {
                nByteCount = value;
                this.statusStrip.Text = Commas(nByteCount / 1024 + 1) + “ KB“;
            }
        }

        // number of Uri‘s found
        private int nURLCount;
        private int URLCount
        {
            get { return nURLCount; }
            set
            {
                nURLCount = value;
                this.statusBarPanelURLs.Text = Commas(nURLCount) + “ URL found“;
            }
        }

        // available memory
        private float nFreeMemory;
        private float FreeMemory
        {
            get { return nFreeMemory; }
            set
            {
                nFreeMemory = value;
                this.statusBarPanelMem.Text = nFreeMemory + “ MB Available“;
            }
        }

        // CPU usage
        private int nCPUUsage;
        private int CPUUsage
        {
            get { return nCPUUsage; }
            set
            {
                nCPUUsage = value;
                this.statusBarPanelCPU.Text = “CPU usage “ + nCPUUsage + “%“;
            }
        }

        // number of files downloaded
        private int nFileCount;
        private int FileCount
        {
            get { return nFileCount; }
            set
            {
                nFileCount = value;
                this.statusBarPanelFiles.Text = Commas(nFileCount) + “ file(s) downloaded“;
            }
        }

        #endregion


        public MainForm()
        {
            InitializeComponent();

            m_cpuCounter = new PerformanceCounter();

            m_cpuCounter.CategoryName = “Processor“;
            m_cpuCounter.CounterName = “% Processor Time“;
            m_cpuCounter.InstanceName = “_Total“;

            m_ramCounter = new PerformanceCounter(“Memory“ “Available MBytes“);

            m_downloader = new Downloader();
            m_downloader.StatusChanged += new DownloaderStatusChangedEventHandler(DownloaderStatusChanged);
        }

        #region Helpers

        string Commas(int nNum)
        {
            string str = nNum.ToString();
            int nIndex = str.Length;
            while (nIndex > 3)
            {
                str = str

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        109  2009-12-30 17:01  NWebCrawler\Backup\NWebCrawler\config.ini

     文件       6852  2010-01-05 10:33  NWebCrawler\Backup\NWebCrawler\MainForm.cs

     文件      23228  2009-12-30 11:44  NWebCrawler\Backup\NWebCrawler\MainForm.Designer.cs

     文件      44070  2009-12-30 11:44  NWebCrawler\Backup\NWebCrawler\MainForm.resx

     文件       4349  2010-01-05 10:45  NWebCrawler\Backup\NWebCrawler\NWebCrawler.csproj

     文件        506  2009-12-26 23:11  NWebCrawler\Backup\NWebCrawler\Program.cs

     文件       1452  2009-12-26 08:57  NWebCrawler\Backup\NWebCrawler\Properties\AssemblyInfo.cs

     文件       2851  2009-12-26 08:57  NWebCrawler\Backup\NWebCrawler\Properties\Resources.Designer.cs

     文件       5612  2009-12-26 08:57  NWebCrawler\Backup\NWebCrawler\Properties\Resources.resx

     文件       1096  2009-12-26 08:57  NWebCrawler\Backup\NWebCrawler\Properties\Settings.Designer.cs

     文件        249  2009-12-26 08:57  NWebCrawler\Backup\NWebCrawler\Properties\Settings.settings

     文件       2852  2010-01-05 10:39  NWebCrawler\Backup\NWebCrawler\SettingsForm.cs

     文件      59153  2010-01-02 11:00  NWebCrawler\Backup\NWebCrawler\SettingsForm.Designer.cs

     文件       5814  2010-01-02 11:00  NWebCrawler\Backup\NWebCrawler\SettingsForm.resx

     文件       1419  2009-12-26 19:37  NWebCrawler\Backup\NWebCrawler.sln

    ..A..H.     21504  2010-01-05 10:47  NWebCrawler\Backup\NWebCrawler.suo

     文件       2764  2009-12-29 21:51  NWebCrawler\Backup\NWebCrawlerLib\Common\Logger.cs

     文件       4949  2009-12-27 12:50  NWebCrawler\Backup\NWebCrawlerLib\Common\PriorityQueue.cs

     文件        323  2009-12-30 10:59  NWebCrawler\Backup\NWebCrawlerLib\CrawleHistroyEntry.cs

     文件      11251  2010-01-04 23:54  NWebCrawler\Backup\NWebCrawlerLib\CrawlerThread.cs

     文件       5124  2010-01-04 23:50  NWebCrawler\Backup\NWebCrawlerLib\Downloader.cs

     文件       2938  2010-01-05 10:45  NWebCrawler\Backup\NWebCrawlerLib\NWebCrawlerLib.csproj

     文件       2316  2009-12-30 10:17  NWebCrawler\Backup\NWebCrawlerLib\Parser.cs

     文件       1308  2009-12-28 23:06  NWebCrawler\Backup\NWebCrawlerLib\Program.cs

     文件       1458  2009-12-26 10:19  NWebCrawler\Backup\NWebCrawlerLib\Properties\AssemblyInfo.cs

     文件       3677  2010-01-02 11:01  NWebCrawler\Backup\NWebCrawlerLib\Settings.cs

     文件       3135  2010-01-02 20:13  NWebCrawler\Backup\NWebCrawlerLib\UrlFrontierQueueManager.cs

     文件       3642  2010-01-02 20:18  NWebCrawler\Backup\NWebCrawlerLib\Utility.cs

     文件        162  2010-01-05 10:27  NWebCrawler\bin\config.ini

     文件      36654  2010-01-05 10:40  NWebCrawler\bin\download\0003be8238c8302e17c799d9f5d65876.gif

............此处省略189个文件信息

评论

共有 条评论