public async Task DownLoadFile(string title, string videoSrcUrl, string mode, string downPath) { if (!string.IsNullOrEmpty(title)) { var downloader = new FlvDownloader(videoSrcUrl); var partUrls = new List <string>(); partUrls = await downloader.GetDownloadFiles(mode); if (partUrls != null && partUrls.Count > 0) { string newdir = Path.Combine(downPath, title); if (!Directory.Exists(newdir)) { Directory.CreateDirectory(newdir); } var taskInfo = new DownloadTaskInfo(title, newdir, partUrls); DownloadTaskList.Add(taskInfo); taskInfo.Start(); } } }
private void savepathTextLabel_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var filename = FlvDownloader.CompilePath(savepathBox.Text, roomIdBox.Text); if (filename == "") { MessageBox.Show("你还没选文件呢!!!!!", "Error?"); } else { var path = System.IO.Path.GetDirectoryName(filename); System.Diagnostics.Process.Start("explorer.exe", path); } }
public async void ShowDownloadTitle(string url) { if (Url != url) { Url = url; } var dl = new FlvDownloader(url); ModeList = new List <KeyValueObject <string, string> >(); DownloadPath = ShareSetting.Setting.DownloadsPath; Title = await dl.GetTitleAndMode(ModeList); if (ModeList.Count > 0) { SelectedMode = ModeList[0]; } if (!string.IsNullOrEmpty(Title)) { ReadComplated = true; } }