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


C# Flickr.PhotosGetInfo方法代码示例

本文整理汇总了C#中FlickrNet.Flickr.PhotosGetInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Flickr.PhotosGetInfo方法的具体用法?C# Flickr.PhotosGetInfo怎么用?C# Flickr.PhotosGetInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FlickrNet.Flickr的用法示例。


在下文中一共展示了Flickr.PhotosGetInfo方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetOnePhotoInfoFromFlickr

 public FlickrPhoto GetOnePhotoInfoFromFlickr(string photoId)
 {
     Flickr flickr = new Flickr(_apiKey, _secret);
     flickr.InstanceCacheDisabled = true;
     PhotoInfo photoInfo = new PhotoInfo();
     FlickrPhoto flickrPhoto = new FlickrPhoto();
     try
     {
         photoInfo = flickr.PhotosGetInfo(photoId);
         flickrPhoto.PictureId = photoInfo.PhotoId;
         flickrPhoto.OwnerName = !string.IsNullOrWhiteSpace(photoInfo.OwnerRealName) ? photoInfo.OwnerRealName : photoInfo.OwnerUserName;
         flickrPhoto.Title = photoInfo.Title;
         flickrPhoto.Description = photoInfo.Description;
         flickrPhoto.AvailablePublic = photoInfo.IsPublic;
         flickrPhoto.SmallImageUrl = photoInfo.Small320Url;
     }
     catch (Exception ex)
     {
         if (ex is PhotoNotFoundException)
         {
             flickrPhoto.AvailablePublic = false;
         }
     }
     return flickrPhoto;
 }
开发者ID:kgfaith,项目名称:ExperimentalCRM,代码行数:25,代码来源:PhotoManager.cs

示例2: GetPhotoInfo

        public static PhotoInfo GetPhotoInfo(string photoId)
        {
            Flickr flickr = new Flickr(ConfigurationManager.AppSettings["apiKey"],
                ConfigurationManager.AppSettings["sharedSecret"]);

            return flickr.PhotosGetInfo(photoId);
        }
开发者ID:holdenben,项目名称:photoStarter,代码行数:7,代码来源:FlickrBLL.cs

示例3: UploadPhoto

        public IPhoto UploadPhoto(Stream stream, string filename, string title, string description, string tags)
        {
            using (MiniProfiler.Current.Step("FlickrPhotoRepository.UploadPhoto"))
            {
                Flickr fl = new Flickr();

                string authToken = (ConfigurationManager.AppSettings["FlickrAuth"] ?? "").ToString();
                if (string.IsNullOrEmpty(authToken))
                    throw new ApplicationException("Missing Flickr Authorization");

                fl.AuthToken = authToken;
                string photoID = fl.UploadPicture(stream, filename, title, description, tags, true, true, false,
                    ContentType.Photo, SafetyLevel.Safe, HiddenFromSearch.Visible);
                var photo = fl.PhotosGetInfo(photoID);
                var allSets = fl.PhotosetsGetList();
                var blogSet = allSets
                                .FirstOrDefault(s => s.Description == "Blog Uploads");
                if (blogSet != null)
                    fl.PhotosetsAddPhoto(blogSet.PhotosetId, photo.PhotoId);

                FlickrPhoto fphoto = new FlickrPhoto();
                fphoto.Description = photo.Description;
                fphoto.WebUrl = photo.MediumUrl;
                fphoto.Title = photo.Title;
                fphoto.Description = photo.Description;

                return fphoto;
            }
        }
开发者ID:sgwill,项目名称:familyblog,代码行数:29,代码来源:FlickrPhotoRepository.cs

示例4: GetDescription

        private void GetDescription(string photoId)
        {
            Flickr flickr = new Flickr(flickrKey, sharedSecret);
            PhotoInfo info = flickr.PhotosGetInfo(photoId);

            PhotoDescription.Text = info.Description;
            PhotoDateTaken.Text = info.DateTaken.ToString("MMMM dd,  yyyy");
        }
开发者ID:lotfar,项目名称:Asp.net_Flickr-App,代码行数:8,代码来源:WebForm1.aspx.cs

示例5: getFlickrPic

 /// <summary>
 /// Using the PhotoID gets the Photo Description (Contains FEN Move) from Flickr
 /// </summary>
 /// <param name="photoID">The Flickr Photo ID to get</param>
 /// <returns>The FEN Chess Move</returns>
 public static string getFlickrPic(string photoID)
 {
     try
     {
         string consumerKey = ConfigurationManager.AppSettings["FlickrConsumerKey"];
         Flickr flickr = new Flickr(consumerKey);
         PhotoInfo photoInfo = flickr.PhotosGetInfo(photoID);  //ChessBoard
         string photoTitle = photoInfo.Title;
         return photoInfo.Description;  //This has the FEN move
     }
     catch (Exception)
     {
         throw new System.ArgumentException("Cannot get Flickr image", "flickr");
     }
 }
开发者ID:PSU-SWENG500-TeamOne,项目名称:ChessByBird,代码行数:20,代码来源:FlickrClient.cs

示例6: ApiSpike_GetInfo

        public void ApiSpike_GetInfo()
        {
            var client = new Flickr(Settings.Flickr.ApiKey, Settings.Flickr.SharedSecret);
            client.InstanceCacheDisabled = true;

            var photos = client.PhotosSearch(new PhotoSearchOptions(Settings.Flickr.UserId, "blog"));

            var result = new List<Tuple<string,string>>();

            foreach (var photo in photos)
            {
                var info = client.PhotosGetInfo(photo.PhotoId, photo.Secret);
                result.Add(new Tuple<string, string>(info.Title, info.Description));
            }

            Assert.That(result, Is.Not.Empty);
        }
开发者ID:G-Rad,项目名称:nzblog,代码行数:17,代码来源:FlickrTests.cs

示例7: getFlickrPic

 public static bool getFlickrPic(string photoID, out string photoDescription)
 {
     string consumerKey = "8d25fce60055946ae5f7e1dff9a5b955";
     try
     {
         Flickr flickr = new Flickr(consumerKey);
         PhotoInfo photoInfo = flickr.PhotosGetInfo(photoID);  //ChessBoard
         string photoTitle = photoInfo.Title;
         photoDescription = photoInfo.Description;  //This has the FEN move
         return true;
     }
     catch (WebException)
     {
         photoDescription = "Error: Could not get the Image from Flickr";
         return false;
     }
     catch (Exception)
     {
         photoDescription = "Error: Could not get the Image from Flickr";
         return false;
     }
 }
开发者ID:PSU-SWENG500-TeamOne,项目名称:ChessByBird,代码行数:22,代码来源:FlickrClient.cs

示例8: RetrieveFlickrInfo

        public static FlickrInfo RetrieveFlickrInfo(string id)
        {
            LOG.InfoFormat("Retrieving flickr info for {0}", id);

            FlickrInfo flickrInfo = new FlickrInfo();

            Flickr flickr = new Flickr(Flickr_API_KEY, Flickr_SHARED_SECRET, config.flickrToken);
            PhotoInfo photoInfo = flickr.PhotosGetInfo(id);
            flickrInfo.ID = id;
            flickrInfo.Title = photoInfo.Title;
            flickrInfo.Timestamp = photoInfo.DatePosted;
            flickrInfo.Description = photoInfo.Description;
            flickrInfo.LargeUrl = photoInfo.LargeUrl;
            flickrInfo.MediumUrl = photoInfo.MediumUrl;
            flickrInfo.OriginalUrl = photoInfo.OriginalUrl;
            flickrInfo.SquareThumbnailUrl = photoInfo.SquareThumbnailUrl;
            flickrInfo.WebUrl = photoInfo.WebUrl;

            flickr = null;
            return flickrInfo;
        }
开发者ID:ploufs,项目名称:Greenshot-Flickr-Plugin,代码行数:21,代码来源:FlickrUtils.cs


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