我希望使用c#代码上传关于dailymotion的视频,但dailymotion不提供用c#上传视频的c#代码.
我搜索dailymotion文档api,我发现这不是明确的卷曲代码:
curl -F 'access_token=...' \
-F 'url=http://upload-02.dailymotion.com/files/5ccb48b8e8aef3fcb8959739f993e1b9.3gp' \
https://api.dailymotion.com/me/videos
Run Code Online (Sandbox Code Playgroud)
我试图转置,但它不起作用:
string contentFile = "c:\name_of_my_video_file.flv";
byte[] byteArray = Encoding.ASCII.GetBytes(contentFile);
MemoryStream fs = new MemoryStream(byteArray);
// Provide the WebPermission Credintials
// Create a request using a URL that can receive a post.
string uri = "https://api.dailymotion.com/me/videos";
WebRequest request = WebRequest.Create(uri);
// Set the Method property of the request to POST.
request.Method = "POST";
request.Credentials = new NetworkCredential("logindailymotion","passworddailymotion");
// Create POST data and convert it to a byte array.
string postData = …
Run Code Online (Sandbox Code Playgroud) 我尝试了3天后如何用c#创建一个帖子我的粉丝页面墙,我注意到两件事: - Facebook没有提供更新的文档,没有完整和糟糕的例子(api经常更改) - Facebook经常更改他的api和很多帖子是痴迷的.有人可以纠正我的代码或提供完整的优秀代码吗?
这是我的代码:
if (String.IsNullOrEmpty(Request.QueryString["code"]))
{
Response.Redirect("https://graph.facebook.com/oauth/authorize?client_id=157873644371673&redirect_uri=http://localhost:2551/Default.aspx&scope=publish_stream,manage_pages,offline_access&display=popup");
}
else
{
FacebookClient fb = new FacebookClient();
dynamic result1 = fb.Get("oauth/access_token", new
{
client_id = "MY_APP_ID",
client_secret = "MY_SECRET_ID",
grant_type = "client_credentials",
redirect_uri = "www.mysite.com"
});
fb.AppId = "MY_APP_ID";
fb.AppSecret = "MY_SECRET_ID";
fb.AccessToken = result1.access_token;
dynamic parameters = new ExpandoObject();
parameters.message = "Check out this funny article";
parameters.link = "http://www.example.com/article.html";
parameters.picture = "http://www.example.com/article-thumbnail.jpg";
parameters.name = "Article Title";
parameters.caption = "Caption for the link";
parameters.description = "Longer description of the …
Run Code Online (Sandbox Code Playgroud) 我的azure虚拟机(名称:Davzen,资源组:Rs1)有问题。我无意中进行了错误的操作:我停用了虚拟机的网络适配器,它弹出了我的远程桌面,自此之后,我没有设法重新建立连接。我试过了:重新启动,重新初始化连接,更改虚拟机计划(3,5go ram-> 7 go ram)。但是此设置仍然存在,我无法重新激活网络适配器,也无法将我与远程桌面连接。大家可以帮我吗?
但这根本没有用