මේ Code එකේ අවුල මොකක්ද?
මේකේ අවුල මොකක්ද බන්
මේකේ මෙන්න මේ line එක නැතුව තිබ්බම video එක down වෙනවා but prograss bar එක වැඩ නෑ මේ line එක දැම්මාම programme එක වැඩ නෑ
දන්නා කෙනෙක් කියාදෙනු මැනවි.



මේකේ අවුල මොකක්ද බන්
Code:
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public object Documents { get; private set; }
private void button1_Click(object sender, EventArgs e)
{
progressBar1.Minimum = 0;
progressBar1.Maximum = 100;
IEnumerable<VideoInfo> videos = DownloadUrlResolver.GetDownloadUrls(txturl.Text);
VideoInfo video = videos.First(p => p.VideoType == VideoType.Mp4 && p.Resolution == Convert.ToInt32(comboBox1.Text));
if (video.RequiresDecryption)
DownloadUrlResolver.DecryptDownloadUrl(video);
var VideoDownloader = new VideoDownloader(video, Path.Combine("E:/down", video.Title + video.VideoExtension));
VideoDownloader.DownloadProgressChanged += Downloader_DownloadProgressChanged;
VideoDownloader.Execute();
}
private void Downloader_DownloadProgressChanged(object sender, ProgressEventArgs e)
{
Invoke(new MethodInvoker(delegate ()
{
progressBar1.Value = (int)e.ProgressPercentage;
lblprecentage.Text = $"{string.Format("{0:0.##}", e.ProgressPercentage)}%";
progressBar1.Update();
}));
}
private void Form1_Load(object sender, EventArgs e)
{
comboBox1.SelectedIndex = 0;
}
}
}
මේකේ මෙන්න මේ line එක නැතුව තිබ්බම video එක down වෙනවා but prograss bar එක වැඩ නෑ මේ line එක දැම්මාම programme එක වැඩ නෑ
Code:
VideoDownloader.DownloadProgressChanged += Downloader_DownloadProgressChanged;
දන්නා කෙනෙක් කියාදෙනු මැනවි.






