FlickrNet.Flickr.PhotosCommentsAddComment C# (CSharp) 메소드

PhotosCommentsAddComment() 공개 메소드

Adds a new comment to a photo.
public PhotosCommentsAddComment ( string photoId, string commentText ) : string
photoId string The ID of the photo to add the comment to.
commentText string The text of the comment. Can contain some HTML.
리턴 string
        public string PhotosCommentsAddComment(string photoId, string commentText)
        {
            Hashtable parameters = new Hashtable();
            parameters.Add("method", "flickr.photos.comments.addComment");
            parameters.Add("photo_id", photoId);
            parameters.Add("comment_text", commentText);

            FlickrNet.Response response = GetResponseNoCache(parameters);

            if( response.Status == ResponseStatus.OK )
            {
                XmlNode node = response.AllElements[0];
                if( node.Attributes.GetNamedItem("id") != null )
                    return node.Attributes.GetNamedItem("id").Value;
                else
                    throw new FlickrException(9001, "Comment ID not found");
            }
            else
            {
                throw new FlickrException(response.Error);
            }
        }
Flickr