Upload file to skydrive through SkyDrive API

后端 未结 3 1654
说谎
说谎 2020-12-17 06:17

I try to upload a text file to my skydrive or at least create new text file in SD and edit it\'s content, through SkyDrive API in my Windows 8 application. How can I do that

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-17 06:32

    Here's another way to upload a file from a console application using a SkyDriveApiClient downloaded from http://skydriveapiclient.codeplex.com/releases/view/103081

        static void Main(string[] args)
        {
            var client = new SkyDriveServiceClient();
    
            client.LogOn("YourEmail@hotmail.com", "password");
            WebFolderInfo wfInfo = new WebFolderInfo();
    
            WebFolderInfo[] wfInfoArray = client.ListRootWebFolders();
    
            wfInfo = wfInfoArray[0];
            client.Timeout = 1000000000;
    
            string fn = @"test.txt";
            if (File.Exists(fn))
            {
                client.UploadWebFile(fn, wfInfo);
            }
    
        }
    

提交回复
热议问题