我想從我的YouTube頻道中刪除視頻選擇了哪些視頻ID,但屬性ListBox
已啓用,代碼無效,是否有其他解決方案?我得到這樣一個錯誤,如下所示:C#Youtube-我想從我的Youtube頻道中刪除視頻
Execution of request failed: http://gdata.youtube.com/feeds/api/users/xxxxxx/uploads/System.Windows.Forms.ListBox+SelectedObjectCollection
這裏是我的代碼:
public void delete()
{
YouTubeRequestSettings settings = new YouTubeRequestSettings(my app name,
my dev key,
my username,
my password);
YouTubeRequest request = new YouTubeRequest(settings);
Uri videoEntryUrl = new Uri(String.Format("http://gdata.youtube.com/feeds/api/users/{0}/uploads/{1}", my channel name, list.checkedItems));
Video video = request.Retrieve<Video>(videoEntryUrl);
request.Delete(video);
}
代碼填充CheckedListBox
Feed<Video> videoFeed;
string feedUrl = "https://gdata.youtube.com/feeds/api/users/default/uploads";
videoFeed = request.Get<Video>(new Uri(feedUrl));
foreach (Video entry in videoFeed.Entries)
{
list.Items.Add(entry.VideoId,0);
}
感謝您的幫助,我會試一試 –