예제 #1
0
        /// <summary>
        /// API调试台
        /// </summary>
        static async Task Main()
        {
            string i = await MusicLib.GetUrlAsync("0032UZe62rZk9K");

            Console.WriteLine(i);
            Console.ReadLine();
        }
예제 #2
0
        /// <summary>
        /// API调试台
        /// </summary>
        static async System.Threading.Tasks.Task Main()
        {
            Settings.LoadUSettings("2728578956");
            var d = TextHelper.JSON.ToJSON(await MusicLib.GetAlbumSongListByIDAsync("000d4ZXm4JElgo"));

            Console.WriteLine(d);
            Console.ReadLine();
        }
예제 #3
0
        static void Main()
        {
            var ml = new MusicLib();

            ml.mldata.Add("001mgo6u1tLENZ", "test");
            Console.WriteLine(ml.GetLyric("001mgo6u1tLENZ"));
            Console.ReadLine();
        }
예제 #4
0
        /// <summary>
        /// API调试台
        /// </summary>
        static async System.Threading.Tasks.Task Main()
        {
            Settings.LoadUSettings("2728578956");
            string id = "k00242mjco0";
            var    d  = await MusicLib.GetRadioMusicAsync("99");

            Console.WriteLine(d[0].MusicName);
            Console.ReadLine();
        }
예제 #5
0
        /// <summary>
        /// API调试台
        /// </summary>
        static async System.Threading.Tasks.Task Main()
        {
            Settings.LoadUSettings("2728578956");
            var d = await MusicLib.GetUrlAsync("004DHn5044x7Oy");

            Console.WriteLine(d);
            Process.Start(d);
            Console.ReadLine();
        }
예제 #6
0
파일: Main.cs 프로젝트: 0xblack/Lemon-App
        /// <summary>
        /// API调试台
        /// </summary>
        static async System.Threading.Tasks.Task Main()
        {
            Settings.LoadUSettings("2728578956");
            string mid = "001SCzwZ4MdpL6";
            string url = await MusicLib.GetUrlAsync(mid);

            Console.WriteLine(url);
            Process.Start(url);

            Console.ReadLine();
        }
예제 #7
0
 public async void Download()
 {
     await Task.Run(async() =>
     {
         string Url = await MusicLib.GetUrlAsync(Id);
         Console.WriteLine(Path + "  " + Downloading + "\r\n" + Url);
         HttpWebRequest Myrq = (HttpWebRequest)WebRequest.Create(Url);
         var myrp            = (HttpWebResponse)Myrq.GetResponse();
         Console.WriteLine(myrp.StatusCode.ToString());
         var totalBytes = myrp.ContentLength;
         GetSize(Getsize(totalBytes));
         Stream st = myrp.GetResponseStream();
         Stream so = new FileStream(Path, FileMode.Create);
         long totalDownloadedByte = 0;
         byte[] by = new byte[1048576];
         int osize = await st.ReadAsync(by, 0, (int)by.Length);
         while (osize > 0)
         {
             if (stop)
             {
                 break;
             }
             if (Downloading)
             {
                 totalDownloadedByte = osize + totalDownloadedByte;
                 await so.WriteAsync(by, 0, osize);
                 osize    = await st.ReadAsync(by, 0, (int)by.Length);
                 Progress = (int)((float)totalDownloadedByte / (float)totalBytes * 100);
                 ProgressChanged(Progress);
                 Console.WriteLine("downloading:" + Progress);
             }
         }
         st.Close();
         so.Close();
         myrp.Close();
         Finished();
     });
 }