当前位置: 首页>>代码示例>>C#>>正文


C# YouTubeRequest.CreateFormUploadToken方法代码示例

本文整理汇总了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);
        }
开发者ID:sarmin,项目名称:LifeTube.me,代码行数:27,代码来源:VideoController.cs

示例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;
 }
开发者ID:rajatpatel92,项目名称:ContentManagementSystem,代码行数:18,代码来源:VideoUpload.cs


注:本文中的YouTubeRequest.CreateFormUploadToken方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。