1
回答
请教:用C#,RSET,PUT更新SkyDrive文件的属性,怎么操作?
【腾讯云】校园拼团福利,1核2G服务器10元/月!>>>   

   string ss = "{\"name\": \"aaa.docx\"}";
   //ss = "Authorization:Bearer " + strAccessToken + "\r\n" + "Content-Type:application/json\r\n\r\n" + ss;
   //WC.UploadString(@"https://apis.live.net/v5.0/file.547671336b0c9bbf.547671336B0C9BBF!191?access_token=" + strAccessToken, "PUT",ss);
   //System.IO.Stream s=WC.OpenWrite(@"https://apis.live.net/v5.0/file.547671336b0c9bbf.547671336B0C9BBF!191?access_token=" + strAccessToken, "PUT");
   byte[] bt = System.Text.Encoding.UTF8.GetBytes(ss);
   //s.Write(bt, 0, bt.Length);

   HttpWebRequest HWR = (HttpWebRequest)WebRequest.Create(@"https://apis.live.net/v5.0/file.547671336b0c9bbf.547671336B0C9BBF!191?access_token=" + strAccessToken);
   HWR.KeepAlive = true;
   HWR.CookieContainer = new CookieContainer();
   HWR.Method = "PUT";
   HWR.ContentType = "application/json";
   using (System.IO.StreamWriter st = new System.IO.StreamWriter(HWR.GetRequestStream()))
   {
    st.WriteLine(ss);
   }

修改不了文件名,谢谢

举报
廖浩
发帖于5年前 1回/183阅
顶部