System.InvalidOperationException: 'Sıra hiçbir öğe içermiyor' hatası

RoKF0siC

Hectopat
Katılım
14 Mayıs 2018
Mesajlar
180
C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using VideoLibrary;
using MediaToolkit;
using System.Net;

namespace deneme2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private async void button1_Click(object sender, EventArgs e)
        {
            using (FolderBrowserDialog fdb = new FolderBrowserDialog() { Description = "Lütfen Kaydetmek İstediğiniz yeri seçin" })
            {
                if (fdb.ShowDialog() == DialogResult.OK)
                {
                    durum.Text = "İndirme işlemi Başladı. Lütfen bekleyin";
                    durum.ForeColor = Color.Red;

                    var youtube = YouTube.Default;
                    var video = await youtube.GetVideoAsync(textBox1.Text);
                    File.WriteAllBytes(fdb.SelectedPath + @"\" + video.FullName + ".mp4", await video.GetBytesAsync());

                    durum.Text = "İndirme işlemi Tamamlandı.";
                    durum.ForeColor = Color.Green;
                }
                else
                {
                    MessageBox.Show("Lütfen Kaydetmek için bir yer seçin", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
Bu hatayı nasıl çözümünü bilen var mı?
"var video = await youtube.GetVideoAsync(textBox1.Text);"
bölümünde hata veriyor.
 
Son düzenleyen: Moderatör:

Geri
Yukarı