本文整理汇总了C#中YouTubeRequest.CreateFormUploadToken方法的典型用法代码示例。如果您正苦于以下问题:C# YouTubeRequest.CreateFormUploadToken方法的具体用法?C# YouTubeRequest.CreateFormUploadToken怎么用?C# YouTubeRequest.CreateFormUploadToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类YouTubeRequest
的用法示例。
在下文中一共展示了YouTubeRequest.CreateFormUploadToken方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRequest1
public static YouTubeRequest GetRequest1()
{
YouTubeRequestSettings settings = new YouTubeRequestSettings("LifeTube",
ConfigurationManager.AppSettings["YouTubeAPIKey"],
ConfigurationManager.AppSettings["YouTubeUsername"],
ConfigurationManager.AppSettings["YouTubePassword"]);
YouTubeRequest request = new YouTubeRequest(settings);
Google.YouTube.Video newVideo = new Google.YouTube.Video();
newVideo.Title = "My first Movie";
newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema));
newVideo.Keywords = "cars, funny";
newVideo.Description = "My description";
newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag", YouTubeNameTable.DeveloperTagSchema));
newVideo.YouTubeEntry.Private = false;
newVideo.YouTubeEntry.setYouTubeExtension("location", "Somerville, MA");
var token = request.CreateFormUploadToken(newVideo);
var strToken = token.Token;
var strFormAction = token.Url + "?nexturl=http://[ LifeTube ]/form/post-video-step2.aspx?Complete=1";
//Session["YTRequest"] = request;
return request;
//return View(request);
}
示例2: addMetadata
public FormUploadToken addMetadata(String title, String description, String keyword)
{
String developerKey = "AI39si5IOTNaonIFeiHdJxhJQy3oNC-fB1I_9w4TMeGQ3SOTyf59bNvHh2IRKvqDIHQRGMC_PIfRpJuq_bwkFPauyXQWY9T1nQ";
String username = "[email protected]";
String pwd = "cmsgecg28";
YouTubeRequestSettings settings = new YouTubeRequestSettings("cms_app", developerKey, username, pwd);
YouTubeRequest request = new YouTubeRequest(settings);
Video newVideo = new Video();
newVideo.Title = title;
newVideo.Tags.Add(new MediaCategory("Education", YouTubeNameTable.CategorySchema));
newVideo.Keywords = keyword;
newVideo.Description = description;
newVideo.YouTubeEntry.Private = false;
newVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);
newVideo.Tags.Add(new MediaCategory("CMS, GECG28", YouTubeNameTable.DeveloperTagSchema));
FormUploadToken token = request.CreateFormUploadToken(newVideo);
return token;
}