濮阳杆衣贸易有限公司

主頁 > 知識(shí)庫 > 解決iis7.5服務(wù)器上.net 獲取不到https頁面的信息

解決iis7.5服務(wù)器上.net 獲取不到https頁面的信息

熱門標(biāo)簽:電銷語音機(jī)器人型號(hào)參數(shù) 百度地圖怎樣做地圖標(biāo)注 昆明語音電銷機(jī)器人價(jià)格 征途美甲店地圖標(biāo)注 騰訊地圖標(biāo)注手機(jī) 400電話如何申請(qǐng)取消 太原400電話上門辦理 浦發(fā)電話機(jī)器人提醒還款 柳州電銷機(jī)器人公司

我的獲取頁面需要cookie,不需要的可以去掉;

GET的方法:

復(fù)制代碼 代碼如下:

/// summary>
        /// 獲取URL訪問的HTML內(nèi)容 獲取https 頁面的
        /// /summary>
        /// param name="Url">URL地址/param>
        /// returns>HTML內(nèi)容/returns>
        public static string GetWebContent(string Url, CookieContainer cookieContainer)
        {
            string strResult = "";
            try
            {
                ServicePointManager.Expect100Continue = true;
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Url);
                request.CookieContainer = cookieContainer;
                request.Timeout = 30000;
                request.Headers.Set("Pragma", "no-cache");

                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                Stream streamReceive = response.GetResponseStream();

                Encoding encoding = Encoding.GetEncoding("utf-8");
                StreamReader streamReader = new StreamReader(streamReceive, encoding);
                strResult = streamReader.ReadToEnd();
            }
            catch
            {

            }
            return strResult;
        }

 POST的方法:

復(fù)制代碼 代碼如下:

/// summary>
        /// post提交數(shù)據(jù)到https
        /// /summary>
        /// param name="posturl">/param>
        /// param name="postdata">/param>
        /// param name="header">/param>
        /// param name="cookieContainer">/param>
        /// returns>/returns>
        public static string SetPostHtml(string posturl, string postdata, HttpHeader header, CookieContainer cookieContainer)
        {
            string restr = "";
            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
            HttpWebRequest request = null;
            HttpWebResponse response = null;
            request = (HttpWebRequest)WebRequest.Create(posturl);
            request.CookieContainer = cookieContainer;
            request.Method = header.method;
            request.Referer = header.Referer;
            request.ContentType = header.contentType;
            byte[] postdatabyte = Encoding.UTF8.GetBytes(postdata);
            request.ContentLength = postdatabyte.Length;
            request.AllowAutoRedirect = false;
            request.KeepAlive = true;
            //提交請(qǐng)求
            Stream stream;
            stream = request.GetRequestStream();
            stream.Write(postdatabyte, 0, postdatabyte.Length);
            stream.Close();
            //接收響應(yīng)
            response = (HttpWebResponse)request.GetResponse();
            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
            {
                restr = reader.ReadToEnd().ToString();
            }
            return restr;
        }

您可能感興趣的文章:
  • IIS 7中如何實(shí)現(xiàn)http重定向https
  • win2003 IIS 6.0實(shí)現(xiàn)全站https訪問的配置方法
  • 有了SSL證書,如何在IIS環(huán)境下部署https
  • startssl申請(qǐng)SSL證書 并且配置 iis 啟用https協(xié)議
  • win2000服務(wù)器在IIS中使用SSL配置HTTPS網(wǎng)站
  • win2003架設(shè)證書服務(wù)器及讓IIS6啟用HTTPS服務(wù)
  • IIS7.0 Windows Server 2008 R2 下配置證書服務(wù)器和HTTPS方式訪問網(wǎng)站的教程圖文詳解
  • IIS7/IIS7.5 URL 重寫 HTTP 重定向到 HTTPS的方法
  • IIS7下配置SSL的方法分析
  • World Wide Web Publishing 服務(wù)嘗試刪除 IIS 所有的 SSL 配置數(shù)據(jù)失敗的幾種方法
  • 在IIS6上開啟https服務(wù)方法分享

標(biāo)簽:新疆 江蘇 陽泉 白山 張家界 天門 蘭州 德陽

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《解決iis7.5服務(wù)器上.net 獲取不到https頁面的信息》,本文關(guān)鍵詞  解決,iis7.5,服務(wù)器,上,.net,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《解決iis7.5服務(wù)器上.net 獲取不到https頁面的信息》相關(guān)的同類信息!
  • 本頁收集關(guān)于解決iis7.5服務(wù)器上.net 獲取不到https頁面的信息的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    佛坪县| 福贡县| 台山市| 东阿县| 抚顺市| 汉沽区| 景宁| 信宜市| 木兰县| 靖州| 常山县| 且末县| 海伦市| 和静县| 静乐县| 宁津县| 宜川县| 池州市| 恩平市| 福泉市| 堆龙德庆县| 秭归县| 沛县| 铜山县| 伊金霍洛旗| 金山区| 泗阳县| 郸城县| 黄骅市| 阳山县| 涡阳县| 朔州市| 泸定县| 将乐县| 丽江市| 台安县| 金川县| 青浦区| 泗洪县| 阿尔山市| 益阳市|