2015-08-27 34 views
2

任何人都可以请帮我介绍如何将图片上传到Picasa网络相册。我的代码如下如何将图片上传到Picasa网络相册

 string file = "/data/data/Online_Mix.Online_Mix/files/Testing.jpg"; 
     string username = _userName; 
     PicasaService oService = new PicasaService("web-application-study"); 
     oService.setUserCredentials(username,_password); 



      System.IO.FileInfo fileInfo = new System.IO.FileInfo(file); 
     System.IO.FileStream fileStream = fileInfo.OpenRead(); 

     Uri postUri = new Uri(PicasaQuery.CreatePicasaUri(_userId, "default")); 

      PicasaEntry entry = (PicasaEntry)oService.Insert(postUri, fileStream, "Image/jpg", file); 
     PhotoAccessor pa = new PhotoAccessor(entry); 

     fileStream.Close(); 


     HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.google.com/accounts/CLientLogin"); 
     request.ContentType = "application/x-www-form-urlencoded"; 
     request.Method = "POST"; 
     request.BeginGetRequestStream(new AsyncCallback(GetRequestStreamCallbackItem), request); 
     auto.WaitOne(); 

在调试时,它显示PicasaEntry的异常“执行认证请求返回意外结果:404”。任何人都请帮我解决这个问题.....

回答

0

Google数据的弃用方法。您需要迁移新的API。

+0

这是答案或评论? – jean

相关问题