コード例 #1
0
ファイル: DownloadManagerInfo.cs プロジェクト: bxstar/KanKan
        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();
                }
            }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: yxysp/biliroku
        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);
            }
        }
コード例 #3
0
        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;
            }
        }