Open MadLongTom opened 6 months ago
Example:
string dllpath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).Replace("Roaming", ""), "Local", "Temp", "lab", "Main_Data", "Managed", "Assembly-CSharp.dll"); string folderpath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).Replace("Roaming", ""), "Local", "Temp", "lab", "Main_Data", "Managed"); string temppath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).Replace("Roaming", ""), "Local", "Temp"); FileSystemWatcher watcher = new FileSystemWatcher(temppath); watcher.EnableRaisingEvents = true; watcher.IncludeSubdirectories = true; Console.WriteLine("Service started,you can press start button now."); while (true) { while (watcher.WaitForChanged(WatcherChangeTypes.Changed).Name != Path.Combine("lab", "Main_Data", "Managed", "Assembly-CSharp.dll")) { } //do backup there } watcher.Dispose();
tbd
nb
Example: