protected Url(SerializationInfo info,StreamingContext context) { this.uri = info.GetValue("uri", typeof(Uri)) as Uri; this.uriEscape = info.GetBoolean("escape"); this.checkSum = info.GetUInt32("checkSum"); this.hostCheckSum = info.GetUInt32("hostCheckSum"); this.checkSumAlgorith = info.GetValue("checkSumAlgorith", typeof(IUrlCheckSum)) as IUrlCheckSum; this.httpMethod = info.GetString("httpMethod"); this.appendParams = info.GetValue("appendParams", typeof(NameValueCollection)) as NameValueCollection; this.ignoreParams = info.GetValue("ignoreParams", typeof(NameValueCollection)) as NameValueCollection; this.maxTryTimes = info.GetInt32("maxTryTimes"); this.hasTriedTimes = info.GetInt32("hasTriedTimes"); this.hasError = info.GetBoolean("hasError"); this.errorMsg = info.GetString("errorMsg"); this.contentHandlers = info.GetValue("contentHandlers", typeof(ContentHandlerCollection)) as ContentHandlerCollection; this.text = info.GetString("text"); this.domainSuffixProvider = info.GetValue("domainSuffixProvider", typeof(IDomainSuffixPrivoder)) as IDomainSuffixPrivoder; this.allowExtractUrl = info.GetBoolean("allowExtractUrl"); }
/// <summary> /// 构造函数 /// </summary> private Url() { this.uri = null; this.uriEscape = true; this.checkSum = UInt32.MinValue; this.hostCheckSum = UInt32.MinValue; this.checkSumAlgorith = new GeneralUrlCheckSum(true); this.httpMethod = "GET"; this.appendParams = null; this.maxTryTimes = 1; this.hasTriedTimes = 0; this.hasError = false; this.errorMsg = ""; this.text = ""; this.contentHandlers = new ContentHandlerCollection(); this.domain = null; this.domainSuffixProvider = Core.DomainSuffixProvider.Default; this.allowExtractUrl = true; }