class Program
{
static void Main(string[] args)
{
string Appname;
string developerKey;
string username;
string password;
Appname = "a";
developerKey = "b";
username = "c";
password = "d";
YouTubeRequestSettings settings = new
YouTubeRequestSettings(Appname, developerKey, username, password);
YouTubeRequest request = new YouTubeRequest(settings);
Uri videoEntryUrl = new
Uri("http://www.youtube.com/watch?v=dOShGP0FM1U");
Video video = request.Retrieve<Video>(videoEntryUrl);
Comment MyComment = new Comment();
MyComment.Content = "random tango";
if (video != null)
{
request.AddComment(video, MyComment);
}
else
{
Console.Write("Video was null for some reason!");
Console.ReadKey();
}
}
}
出于某种原因,视频一直返回 null,我不知道,我已经尝试了所有我真正需要帮助的项目。