/// <summary> /// 设置歌曲路径 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tsmiSongPath_Click(object sender, EventArgs e) { FrmSongPath frmSongPath = new FrmSongPath(); string songPath = new MyKTV_.DBHelper().ExecuteScalar("select song_url from song_info").ToString(); int songPathLength = songPath.Length; //路径总长度 int filePathLength = songPath.Substring(songPath.LastIndexOf("\\")).Length; //文件名长度 frmSongPath.song_path = songPath.Substring(0, songPathLength - filePathLength + 1); //去掉文件名后的路径 frmSongPath.Show(); }
//设置歌手写真路径 private void tsmiSingerPhotoPath_Click(object sender, EventArgs e) { FrmSongPath frmSongPath = new FrmSongPath(); string singer_photo_url = new MyKTV_.DBHelper().ExecuteScalar("select singer_photo_url from singer_info").ToString(); frmSongPath.singer_photo_path = singer_photo_url.Substring(0, singer_photo_url.Length - singer_photo_url.Substring(singer_photo_url.LastIndexOf("\\")).Length + 1); frmSongPath.Show(); }