Esempio n. 1
0
        public static HttpByteInfo Allocate(string m_srcUrl, WebRequestByteEvent webRequestTextEvent, string m_savePath = "",
                                            WebRequestProcessEvent processEvent = null)
        {
            HttpByteInfo httpByteInfo = new HttpByteInfo();

            httpByteInfo.m_srcUrl            = m_srcUrl;
            httpByteInfo.webRequestByteEvent = webRequestTextEvent;
            httpByteInfo.m_savePath          = m_savePath;
            httpByteInfo.processEvent        = processEvent;
            return(httpByteInfo);
        }
Esempio n. 2
0
        public static HttpInfo AllocateInfo(string ResClass, string ABName, string m_srcUrl, string m_savePath,
                                            WebRequestProcessEvent processEvent, bool isMD5File = false, bool isHasRecog = false)
        {
            HttpInfo httpInfo = new HttpInfo();

            httpInfo.ResClass     = ResClass;
            httpInfo.ABName       = ABName;
            httpInfo.m_srcUrl     = m_srcUrl;
            httpInfo.m_savePath   = m_savePath;
            httpInfo.isMD5File    = isMD5File;
            httpInfo.isHasRecog   = isHasRecog;
            httpInfo.processEvent = processEvent;
            return(httpInfo);
        }
Esempio n. 3
0
 public void StartByteDown(string m_srcUrl, WebRequestByteEvent webRequestTextEvent, string m_savePath = "",
                           WebRequestProcessEvent processEvent = null)
 {
     if (JudgeNetworkState())
     {
         if (!URLToHttpBase.ContainsKey(m_srcUrl))
         {
             HttpByte httpTxt = new HttpByte(HttpByteInfo.Allocate(m_srcUrl, webRequestTextEvent, m_savePath, processEvent));
             AddRequest(m_srcUrl, httpTxt);
         }
     }
     else
     {
         webRequestTextEvent(default(byte[]), DownStatus.NoNetwork, "");
     }
 }
Esempio n. 4
0
        public static HttpTxtInfo Allocate(string m_srcUrl, WebRequestTextEvent webRequestTextEvent,
                                           bool returnPathOrCon = false, string m_savePath = "", WebRequestProcessEvent processEvent = null)
        {
            HttpTxtInfo httpTxtInfo = new HttpTxtInfo();

            httpTxtInfo.m_srcUrl            = m_srcUrl;
            httpTxtInfo.m_savePath          = m_savePath;
            httpTxtInfo.returnPathOrCon     = returnPathOrCon;
            httpTxtInfo.webRequestTextEvent = webRequestTextEvent;
            httpTxtInfo.processEvent        = processEvent;
            return(httpTxtInfo);
        }
Esempio n. 5
0
 /// <summary>
 /// 默认返回获取到的内容
 /// </summary>
 /// <param name="m_srcUrl"></param>
 /// <param name="webRequestTextEvent"></param>
 /// <param name="returnPathOrCon"></param>
 /// <param name="m_savePath"></param>
 /// <param name="processEvent"></param>
 public void StartDownReturnPathOrContent(string m_srcUrl, WebRequestTextEvent webRequestTextEvent,
                                          bool returnPathOrCon = false, string m_savePath = "", WebRequestProcessEvent processEvent = null)
 {
     if (JudgeNetworkState())
     {
         if (!URLToHttpBase.ContainsKey(m_srcUrl))
         {
             HttpTxt httpTxt = new HttpTxt(HttpTxtInfo.Allocate(m_srcUrl, webRequestTextEvent, returnPathOrCon, m_savePath, processEvent));
             AddRequest(m_srcUrl, httpTxt);
         }
     }
     else
     {
         webRequestTextEvent("", DownStatus.NoNetwork, "");
     }
 }