-3
好的,所以我100%全新的从Facebook上分享C#的东西。如何在Facebook上分享位图作为C#中的照片?
我需要一个如何在我的脸书上分享图像作为照片的示例代码?
请不要回答(谷歌,我知道二硝基甲苯,为什么?不可能,Facebook的SDK)...
好的,所以我100%全新的从Facebook上分享C#的东西。如何在Facebook上分享位图作为C#中的照片?
我需要一个如何在我的脸书上分享图像作为照片的示例代码?
请不要回答(谷歌,我知道二硝基甲苯,为什么?不可能,Facebook的SDK)...
你的问题是有点含糊。当你说“用C#”时,你的意思是在网页,窗口或服务环境中?因为Facebook做这件事的方式是在这个过程中必须有一些认证,并且通过重定向到Facebook让用户登录,然后发送照片进行共享。这是一个相当的过程,不仅仅是一个单线程的代码。
在任何情况下,你必须做到以下几点,你要搞清楚,你把它放到你的环境:
下面的代码:
// Step 2: you have to research what TheScope will be from Facebook API that gives you access to photos
Response.Redirect(string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&scope={1}&redirect_uri={2}"), MyAppCode, TheScope, MyRedirectingURL);
// Step 3: this is on the `Page_Load` of MyRedirectingURL.
// AnotherRedirectingURL will be your final destination on your app
using (var wc = new WebClient())
{
string token = wc.DownloadString(string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&client_secret={1}&code={2}&redirect_uri={3}", MyAppCode, MyAppSecretCode, TheCode, AnotherRedirectingURL));
}
// Step 4: Use the token to start stream up or down
using (var wc = new WebClient())
{
Uri uploadUri = new Uri(string.Format("https://graph.facebook.com/{0}?{1}", PhotoUploadCommand, token));
// Find out what the PhotoUploadCommand is supposed to be from the Facebook API
// use wc and uploadUri to upload the photo
}
底线是,你必须做你的研究对这个......这不是那么简单。这是一个可悲的事实,我必须经历做你正在做的事情。
我会回答“你到目前为止尝试了什么?” – RQDQ 2012-04-16 18:22:09
您是否尝试过Google,Facebook文档等? – 2012-04-16 19:23:31