• 获取url的字符串数据


      public string GetHttpData(string sUrl)
            {
                string sRslt = null;
                WebResponse oWebRps = null;
                WebRequest oWebRqst = WebRequest.Create(sUrl);
                oWebRqst.Timeout = 50000;
                try
                {
                    oWebRps = oWebRqst.GetResponse();
                }          
            
                finally
                {
                    if (oWebRps != null)
                    {
                        StreamReader oStreamRd = new StreamReader(oWebRps.GetResponseStream(), System.Text.Encoding.GetEncoding("utf-8"));
                        sRslt = oStreamRd.ReadToEnd();
                        oStreamRd.Close();
                        oWebRps.Close();
                    }
                }
                return sRslt;
            }
  • 相关阅读:
    0430
    hlg1306再遇攻击--射线法判断点是否在多边形内部
    hlg1429凸多边形 二分+叉积
    计算几何
    像个孩子一样
    i am so happy
    hdu3371Connect the Cities---最小生成树kruskal
    hlg1339Touring DIJ+堆优化
    hdu3790最短路问题
    Lucky Goddess
  • 原文地址:https://www.cnblogs.com/bestsaler/p/1835829.html
Copyright © 2020-2023  润新知