使用.NET API将视频上传到picasa

时间:2011-12-23 18:44:44

标签: google-api picasa

我在谷歌的api页面上找不到任何东西,这有可能吗?我无法在网上找到任何东西

2 个答案:

答案 0 :(得分:3)

当然:您可以使用C#或任何其他.Net语言上传图像,视频或其他二进制文件:

http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_dotnet.html#PostPhotos ** **

这是完整的GData .Net API:

http://code.google.com/p/google-gdata/

答案 1 :(得分:0)

希望这可以帮助那些尝试使用.NET API将视频上传到picasa的人。

RequestSettings mySettings = new RequestSettings("PROGRAM NAME");
            mySettings.Timeout = 600000; 
            PicasaRequest pr = new PicasaRequest(mySettings);
            PicasaService service = pr.Service;
            service.setUserCredentials(username, password);
            Uri postUri = new Uri(PicasaQuery.CreatePicasaUri(username, picasaalbumid));

 PhotoEntry videoEntry = new PhotoEntry();
                videoEntry.Title = new AtomTextConstruct(AtomTextConstructElementType.Title,"Untitled.3gp");//I would change this to read the file type, This is just an example
                videoEntry.Summary = new AtomTextConstruct(AtomTextConstructElementType.Summary,"");
                MediaFileSource source = new MediaFileSource(stream,fileName,fileType);
                videoEntry.MediaSource = source;
                PicasaEntry entry = service.Insert(postUri,videoEntry);
                stream.Close();