在C#中,我使用以下方法从服务器将视频文件上传到Facebook:
string fullurl = "https://graph-video.facebook.com/me/videos?" + "title=" + title + "&access_token=" + accessToken;
WebClient client = new WebClient();
byte[] returnBytes = client.UploadFile(fullurl, path);
path是服务器上视频文件的路径。这有效,并在用户个人资料上显示视频上传的帖子。如何添加文本说明(带链接)和操作链接到该帖子?
请在C#中保留答案
答案 0 :(得分:2)
您应该使用嵌入式网址传递额外的查询字符串参数 - description 。像这样:
var description = "Bring your conversations to life on Facebook. With face-to-face video calling, now you can watch your friends smile, wink and LOL.\n\nTo get started, visit http://www.facebook.com/videocalling";
string fullurl = string.Format("https://graph-video.facebook.com/me/videos?title={0}&description={1}&access_token={2}", HttpUtility.UrlEncode(title), HttpUtility.UrlEncode(description ), accessToken);
答案 1 :(得分:0)
我做到了。以下是我的代码:
string a = "User_Access_Token";
string fullurl = string.Format("https://graph-video.facebook.com/me/videos?title={0}&description={1}&access_token={2}", HttpUtility.UrlEncode("Dulha"), HttpUtility.UrlEncode("hello"), a);
WebClient client = new WebClient();
byte[] returnBytes = client.UploadFile(fullurl, @"C:\Users\Users\Downloads\Dulha.mp4");