示例#1
0
        public void Download()
        {
            var response = webResponse.GetResponse();

            if (response is IJsonToXmlTranslatedResponse)
            {
                Xml = (response as IJsonToXmlTranslatedResponse).Xml;
            }
        }
示例#2
0
        public void Download()
        {
            var response = webResponse.GetResponse();

            if (response is IHtmlDocTranslatedResponse)
            {
                var htmlDocTransleted = (response as IHtmlDocTranslatedResponse);
                ProcessDetials(htmlDocTransleted);
            }
        }
示例#3
0
文件: WebHandler.cs 项目: KavTV/H2
        public string GetWebContent(IRequest <WebRequest, string> request, IWebResponse <WebResponse, WebRequest> response, string website)
        {
            //Prints out the status of the website
            WebRequest  webRequest  = request.MakeRequest(website);
            WebResponse webResponse = response.GetResponse(webRequest);

            Console.WriteLine(((HttpWebResponse)webResponse).StatusDescription);
            string responseHtml;

            using (StreamReader responseStream = new StreamReader(webResponse.GetResponseStream()))
            {
                responseHtml = responseStream.ReadToEnd().Trim();
            }
            return(responseHtml);
        }