自己c#写的程序:豆瓣电台桌面 可歌曲下载,歌词同步,历史记录,红心列表管理
http://vdisk.悲剧。。。没法上图???
看这个哇。。。
http://ww4.
http://
比官方的多了歌词同步显示,歌曲下载,红心频道,历史记录等
第一次写一个比较完整的程序。。。
如果大家有兴趣我
程序代码:
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using using System.Web; using System.Collections; using System.Web.Script.Serialization; using System.Diagnostics; using System.Threading; using using System.Text; namespace Post数据流到HTTP地址 { static class Program { public static string ck; public static Cookie co; public static CookieContainer cc = new CookieContainer(); /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var LoginForm = new Form1(); if (LoginForm.ShowDialog() == DialogResult.OK) //在FORM1的78行定义了 this.DialogResult = System.Windows.Forms.DialogResult.OK; { Application.Run(new Form2(LoginForm.认证信息实例)); } } //生成数字随机数 public static string random_10(int length) { string result = ""; System.Random random = new Random(); for (int i = 0; i < length; i++) { result += random.Next(10).ToString(); } return result; } public static string HttpGet(string 请求url) { string 序列; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(请求url); request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"; request.CookieContainer = cc; //request.Timeout = 5000; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.UTF8); 序列 = sr.ReadToEnd(); sr.Close(); return 序列; } public class play_record { public string liked { get; set; } public string banned { get; set; } public string played { get; set; } } public class user_info { public string ck { get; set; } public string name { get; set; } public string url { get; set; } public string third_party_info { get; set; } public play_record play_record { get; set; } public string is_dj { get; set; } public string id { get; set; } } public class 验证信息 { public string err_msg { get;set; } public user_info user_info{ get; set; } public string r { get; set; } } public class songs { public string channel { get; set; } public string picture { get; set; } public string albumtitle { get; set; } public string album { get; set; } public string company { get; set; } public string rating_avg { get; set; } public string public_time { get; set; } public string ssid { get; set; } public string like { get; set; } public string artist { get; set; } public string url { get; set; } public string subtype { get; set; } public string title { get; set; } public string length { get; set; } public string sid { get; set; } public string aid { get; set; } } public class 豆瓣电台类 { public string r { get; set; } public List<songs> song { get; set; } } public class channel { public string name { get; set; } public string seq_id { get; set; } public string abbr_en { get; set; } public string channel_id { get; set; } public string name_en { get; set; } } public class 豆瓣频道类 { public List<channel> channels { get; set; } //和JSON一致 }就把源码也放出来