2011-05-17 88 views
1

我想添加一張圖片到我的牆貼,一切都張貼在牆上除了圖片,我已經綁定到一個可訪問的url的圖片的網址,但它確實顯示在牆上的帖子上。我如何添加一張圖片到我的牆上張貼在C#

我的c#代碼: FacebookApp app = new FacebookApp(Session [「SSAccessToken」]。ToString());

  dynamic parameters = new ExpandoObject(); 
      parameters.message = "MESSAGE"; 
      parameters.link = Request.Url.Scheme + "://" + Request.Url.Host + ":" + Request.Url.Port+"/Default.aspx?vw=2&Id="+ID; 
      **parameters.picture = Request.Url.Scheme + "://" + Request.Url.Host + ":" + Request.Url.Port + "/Images/Test.jpg";** 
      parameters.name = "Title"; 
      parameters.caption ="Caption" 
      parameters.description = "Description..."; 
      parameters.actions = new 
      { 
       name = "Contribute", 
       // tagret = "_blank", 
       link = Request.Url.Scheme + "://" + Request.Url.Host + ":" + Request.Url.Port + "/Contributor.aspx?Id=" + goal.ID 
      }; 
      parameters.privacy = new 
      { 
       value = "ALL_FRIENDS", 
      }; 
      parameters.targeting = new 
      { 
       countries = "US", 
       regions = "6,53", 
       locales = "6", 
      }; 
      dynamic result = app.Post("me/feed", parameters); 

這張圖片不顯示在牆上的信息?有任何想法嗎 ?

回答

0

您可以使用圖形API瀏覽器才能看到該鏈接是如何在牆壁上一篇: https://developers.facebook.com/tools/explorer/

請創建一個發佈在您的應用程序的行動,並在瀏覽器中的圖片鏈接看起來如何驗證。如果一切正常,'src'參數將成爲您的圖片網址。

例如,這是我的應用程序後的外觀上的資源管理器:

{ 
    "id": "100001536253568_310941908967015", 
    "from": { 
    "name": "Henrique Baggio", 
    "id": "100001536253568" 
    }, 
    "message": "Confirmou presença em um evento", 
    "picture": "http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=193921427300379&v=1&size=z&cksum=2d14ff50fc9a74375400e780d6c46d32&src=http\u00253A\u00252F\u00252Fwww.findparty.com.br\u00252FImages\u00252FEvent\u00252F101\u00253Ftype\u00253Dgo", 
    // other post information 
}, 

這樣你可以檢查,如果該鏈接是Facebook平臺訪問。