FlickrNet API使得从 .NET 使用 Flickr 变得非常容易。您必须拥有 Flickr 帐户以及API 密钥和共享密钥。一旦你有了你需要的东西,使用 API 就非常简单了:
// http://www.flickr.com/services/api/misc.api_keys.html
string flickrApiKey = "<api key>";
string flickrApiSharedSecret = "<shared secret>";
string flickrAuthenticationToken = "<authentication token>";
Flickr flickr = new Flickr( flickrApiKey, flickrApiSharedSecret );
flickr.AuthToken = flickrAuthenticationToken;
foreach ( FileInfo image in new FileInfo[] {
new FileInfo( @"C:\image1.jpg" ),
new FileInfo( @"C:\image2.jpg" ) } )
{
string photoId = flickr.UploadPicture(
image.FullName, image.Name, image.Name, "tag1, tag2" );
}