Hi. i am working with small windows form application C# that save changes on an online database. But i want if user in offline mode/no internet to save data in a temp file, then automatically synchronous with the online database and save changes.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Sushil Gupta37 reputationPosted Dec 17, 2014, 7:21 AM EST
if (!File.Exists(@"C:\File.txt"))
System.IO.File.WriteAllText(@"C:\File.txt");
else
File.AppendAllText(@"C:\File.txt");
Later once connection is back you can copy that file back to server.