温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:NETCMSv1.5(Build0509)完整源码版
当前文件路径:NetCMSv15/NetCMS.Content/Collect/Page.cs

1//====================================================== 2
//== (c)2008 aspxcms inc by NeTCMS v1.0 == 3
//== Forum:bbs.aspxcms.com == 4
//== Website:www.aspxcms.com == 5
//====================================================== 6
using System; 7
using System.Collections.Generic; 8
using System.Text; 9
using System.Text.RegularExpressions; 10
11
namespace NetCMS.Content.Collect 12
{ 13
public class Page 14
{ 15
protected string _Url = ""; 16
protected string _Encode = "utf-8"; 17
protected string _Doc = ""; 18
protected string _Error = ""; 19
public Page(string url) 20
{ 21
_Url = url; 22
} 23
public Page(string url,string encode) 24
{ 25
_Url = url; 26
_Encode = encode; 27
} 28
public bool Fetch() 29
{ 30
bool flag = false; 31
try 32
{ 33
Uri url = new Uri(_Url); 34
_Doc = Utility.GetPageContent(url, _Encode); 35
flag = true; 36
} 37
catch(UriFormatException e) 38
{ 39
_Error = e.ToString(); 40
} 41
catch (System.Net.WebException e) 42
{ 43
_Error = e.ToString(); 44
} 45
catch (Exception e) 46
{ 47
_Error = e.ToString(); 48
} 49
return flag; 50
} 51
public string LastError 52
{ 53
get { return _Error; } 54
} 55
} 56
} 57





}
}