예제 #1
0
        private void label_name_DoubleClick(object sender, EventArgs e)
        {
            String current_id = textBox_id.Text;

            if (parser != null && song != null && current_id == id)
            {
                SaveMp3(current_id);
            }
            else
            {
                parser = CreateParser();
                if (parser == null)
                {
                    MessageBox.Show(this, "暂不支持该来源的试听下载", "提示");
                }
                else
                {
                    if (parser.CheckSong(current_id))
                    {
                        song = parser.GetSong(current_id);
                        ShowLyric();
                        SaveMp3(current_id);
                    }
                    else
                    {
                        MessageBox.Show(this, "该歌曲不存在,请输入正确的" + parser.ToString() + "id!", "歌曲id错误");
                        ActiveTextBox_id();
                    }
                }
            }
        }
예제 #2
0
 private void button_search_Click(object sender, EventArgs e)
 {
     id     = textBox_id.Text;
     parser = CreateParser();
     if (parser == null)
     {
         MessageBox.Show(this, "暂不支持该来源的歌词获取", "提示");
     }
     else
     {
         if (parser.CheckSong(id))
         {
             song = parser.GetSong(id);
             ShowLyric();
             ActiveTextBox_lyric();
         }
         else
         {
             MessageBox.Show(this, "该歌曲不存在,请输入正确的" + parser.ToString() + "id!", "歌曲id错误");
             ActiveTextBox_id();
         }
     }
 }