本文整理汇总了C#中FlickrNet.Flickr.PhotosetsAddPhoto方法的典型用法代码示例。如果您正苦于以下问题:C# Flickr.PhotosetsAddPhoto方法的具体用法?C# Flickr.PhotosetsAddPhoto怎么用?C# Flickr.PhotosetsAddPhoto使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FlickrNet.Flickr
的用法示例。
在下文中一共展示了Flickr.PhotosetsAddPhoto方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
示例2: UpdatePhotoButton_Click
private void UpdatePhotoButton_Click(object sender, EventArgs e)
{
Flickr flickr = new Flickr(ApiKey.Text, SharedSecret.Text, AuthToken.Text);
flickr.PhotosSetMeta(PhotoId.Text, NewTitle.Text, null);
OutputTextbox.Text += "Photo title updated";
PhotosetCollection sets = flickr.PhotosetsGetList();
Photoset set = sets[0];
flickr.PhotosetsAddPhoto(set.PhotosetId, PhotoId.Text);
}