1回顶部 引言: 调用方式: 2回顶部 namespace Test.Com { /// <summary> /// 功能:取得Internet上的URL页的源码 /// 创建:2004-03-22 /// 作者:Rexsp MSN:yubo@x263.net /// </summary> public class GetPageCode { #region 私有变量 /// <summary> /// 网页URL地址 /// </summary> private string url=null; /// <summary> /// 是否使用代码服务器:0 不使用 1 使用代理服务器 /// </summary> private int proxyState=0; /// <summary> /// 代理服务器地址 /// </summary> private string proxyAddress=null; /// <summary> /// 代理服务器端口 /// </summary> private string proxyPort=null; /// <summary> /// 代理服务器用户名 /// </summary> private string proxyAccount=null; /// <summary> /// 代理服务器密码 /// </summary> private string proxyPassword=null; /// <summary> /// 代理服务器域 /// </summary> private string proxyDomain=null; 3回顶部 /// <summary> /// 输出文件路径 /// </summary> private string outFilePath=null; /// <summary> /// 输出的字符串 /// </summary> private string outString=null; /// <summary> /// 提示信息 /// </summary> private string noteMessage; #endregion #region 公共属性 4回顶部 /// 代理服务器端口 /// </summary> public string ProxyPort { get{return proxyPort;} set{proxyPort=value;} } /// <summary> /// 代理服务器账号 /// </summary> public string ProxyAccount { get{return proxyAccount;} set{proxyAccount=value;} } /// <summary> /// 代理服务器密码 /// </summary> public string ProxyPassword { get{return proxyPassword;} set{proxyPassword=value;} } /// <summary> /// 代理服务器域 /// </summary> public string ProxyDomain { get{return proxyDomain;} set{proxyDomain=value;} } /// <summary> /// 输出文件路径 /// </summary> public string OutFilePath { get{return outFilePath;} 5回顶部 set{outFilePath=value;} } /// <summary> /// 返回的字符串 /// </summary> public string OutString { get{return outString;} } /// <summary> /// 返回提示信息 /// </summary> public string NoteMessage { get{return noteMessage;} } #endregion #region 构造函数 public GetPageCode() { } #endregion #region 公共方法 6回顶部 if(this.proxyPort==null) this.ProxyPort="80"; WebProxy myProxy=new WebProxy(); //如果输出文件路径为空,便将得到的内容赋给OutString属性 FileInfo fi = new FileInfo(this.outFilePath); } } |
闁衡偓閹増顥戦柟瀛樺姇婵拷闁哄被鍎冲﹢鍛村绩閹増顥�>>
正在阅读:从网上抓取指定URL源码的方案从网上抓取指定URL源码的方案
2004-03-25 14:32
出处:CSDN
责任编辑:linjixiong