Click here to Skip to main content
15,946,179 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am using OneDrive Rest API and create a web application. It works fine. I have also created one Windows Service and use FileSystemWatcher class of c# library. It sync changes to OneDrive account whenever the local OneDrive Folder is Changed. But when user perform changes on OneDrive directly I am not able to sync that changes with my local OneDrive folder. Hows that possible if any changes are done on OneDrive then data will be automatically update with my local OneDrive folder?

Thank you

What I have tried:

FileSystemWatcher watcher = new FileSystemWatcher();
               watcher.IncludeSubdirectories = true;
               string _path = "C:\\Users\\srust\\CloudStorage\\OneDrive";

               watcher.Path = _path;
               watcher.EnableRaisingEvents = true;
               watcher.Created += new FileSystemEventHandler(watcher_Created);
               watcher.Deleted += new FileSystemEventHandler(watcher_Deleted);
               watcher.Changed += new FileSystemEventHandler(watcher_Changed);
               watcher.Renamed += new RenamedEventHandler(watcher_Renamed);

And Then Implement all methods as per API Request.
Richard Deeming 10-May-17 14:08pm    
You do know that OneDrive already provides a Windows client application to do that, right?
Download Microsoft OneDrive[^]

If you're running a recent version of Windows, it's probably already installed.
Srusti Thakkar 11-May-17 0:32am    
Yeah, I know that but i want to create it using c# code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900