FlickrNet.Flickr.PhotosDelete C# (CSharp) Method

PhotosDelete() public method

Delete a photo from Flickr.
Requires Delete permissions. Also note, photos cannot be recovered once deleted.
public PhotosDelete ( string photoId ) : void
photoId string The ID of the photo to delete.
return void
        public void PhotosDelete(string photoId)
        {
            Hashtable parameters = new Hashtable();
            parameters.Add("method", "flickr.photos.delete");
            parameters.Add("photo_id", photoId);

            FlickrNet.Response response = GetResponseCache(parameters);

            if( response.Status == ResponseStatus.OK )
            {
                return;
            }
            else
            {
                throw new FlickrException(response.Error);
            }
        }

Usage Example

Exemplo n.º 1
0
 /// <summary>
 /// this method will delete a flickr photograph given its id
 /// </summary>
 /// <param name="flickrAuth">authentication string</param>
 /// <param name="imageUID">id of image</param>
 /// <returns>true if success, false if error/fail</returns>
 public bool DeletePhotograph(string flickrAuth, string imageUID)
 {
     try
     {
         flickr.AuthToken = flickrAuth;
         flickr.PhotosDelete(imageUID);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
All Usage Examples Of FlickrNet.Flickr::PhotosDelete
Flickr