日期:2011-07-07  浏览次数:20537 次

代码

using System;
using System.Xml;
using System.Text;
using System.Text.RegularExpressions;
using System.Net;
using System.IO;
 
namespace blogdata.nms_common
{
       ///<summary>
       ///定义获得数据流接口
       ///</summary>
       public interface IRequestable
       {
              Stream GetStream(string requestUrl);
       }
       ///<summary>
       /// Http 的摘要说明
       ///</summary>
       public class Http : IRequestable
       {
              ///<summary>
              ///设置请求的延时时间,以秒为单位
              ///</summary>
              private int mTimeOut = 1;
              ///<summary>
              /// ̉异常错误信息
              ///</summary>
              public string errorMessage;
              public string ErrorMessage
              {
                     get {return this.errorMessage;}
              }
              ///<summary>
              ///构造函数
              ///</summary>
              public Http(int timeOut)
              {
                     this.mTimeOut = timeOut * 1000;   
              }
              ///<summary>
              ///用方法隐藏成员
              ///</summary>
              ///<param name="timeOut"></param>
              ///<returns></returns>
              public static Http GetIntance(int timeOut)
              {
                     return new Http(timeOut);
         &