【问题标题】:'Google.YouTube.Video.Tags' is not supported by the language该语言不支持“Google.YouTube.Video.Tags”
【发布时间】:2014-10-28 12:09:44
【问题描述】:

编译时出现此错误 (c#):

该语言不支持“Google.YouTube.Video.Tags”

Video video = new Video();
    video.Title = txtTitle.Text;
    video.Tags.Add(new MediaCategory(cmbCat.SelectedItem.ToString(),YouTubeNameTable.CategorySchema ));

这个错误的原因是什么?

【问题讨论】:

  • Google.YouTube.Video.Tags的声明是什么?看来您可能正在尝试以 C# 不支持的方式使用该属性。一个精确的解决方法将取决于实际声明是什么。

标签: c# youtube-api google-data


【解决方案1】:

对于 Google API v3,video.Tags.Add 的正确参数是 string 参数。 MediaCategory 不是 Tags 属性的 Add 方法的有效数据类型。

video.Tags.Add("Keyword1");
video.Tags.Add("Keyword2");
video.Tags.Add("Keyword3");

video.Tags=new string[] {"Keyword1","Keyword2","Keyword3"};

UploadVideo.cs查看 Google 的示例

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-09
    • 2022-06-13
    • 2011-11-08
    • 2018-03-17
    • 1970-01-01
    相关资源
    最近更新 更多