| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 读取电台组列表 |
| | | /// </summary> |
| | | /// <returns>读取到的电台组列表信息,读取不到反馈为null</returns> |
| | | public static string ReadRadioList(string url) |
| | | { |
| | | |
| | | WebClient webClient = new WebClient(); |
| | | webClient.Proxy = null; |
| | | webClient.Headers.Add("Content-type", "plain/text; charset=UTF-8"); |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | webClient.Headers.Add("Accept-Language", "zh-cn"); |
| | | } |
| | | else |
| | | { |
| | | webClient.Headers.Add("Accept-Language", "en-us"); |
| | | } |
| | | try |
| | | { |
| | | byte[] recevieBytes = webClient.DownloadData(new Uri(url)); |
| | | return System.Text.Encoding.UTF8.GetString(recevieBytes, 0, recevieBytes.Length); |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取当前播放的列表 |
| | | /// </summary> |
| | | public static string GetCurrentPlayList() |