⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 page.cs

📁 最好用的站点内容管理系统 全部源代码都有
💻 CS
字号:
//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace NetCMS.Content.Collect
{
     public class Page
     {
        protected string _Url = "";
         protected string _Encode = "utf-8";
        protected string _Doc = "";
        protected string _Error = "";
        public Page(string url)
        {
            _Url = url;
        }
        public Page(string url,string encode)
        {
            _Url = url;
            _Encode = encode;
        }
        public bool Fetch()
        {
            bool flag = false;
            try
            {
                Uri url = new Uri(_Url);
                _Doc = Utility.GetPageContent(url, _Encode);
                flag = true;
            }
            catch(UriFormatException e)
            {
                _Error = e.ToString();
            }
            catch (System.Net.WebException e)
            {
                _Error = e.ToString();
            }
            catch (Exception e)
            {
                _Error = e.ToString();
            }
            return flag;
        }
        public string LastError
        {
            get { return _Error; }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -