BiliRanking.BiliInterface.GetHtml C# (CSharp) Метод

GetHtml() публичный статический Метод

public static GetHtml ( string url ) : string
url string
Результат string
        public static string GetHtml(string url)
        {
            try
            {
                WebClient myWebClient = new WebClient();
                myWebClient.Headers.Add("Cookie", "sid=arhywva7; fts=1461861233");
                myWebClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36");
                //MDZZ,mono的WebClient有bug,一转byte[]就报错
                string myData = myWebClient.DownloadString(url);

                return myData;

            }
            catch (Exception e)
            {
                Log.Error("获取失败!请检查网路设置!" + e.Message);
                return null;
                //throw new Exception("获取失败");
            }
        }