For a folder change, C # has its own class to implement it. We do not need to care about its internal implementation mechanism, or what APIs it calls at the underlying layer, we only need to care about how to call it and how to make it help us record the modification of folders.
Monitoring folder changes === policyfilters. lastWrite | watcher. changed + = (source, FileSystemEventArgs e) => + = (source, RenamedEventArgs e) => watcher. enableRaisingEvents =
In addition, we can tell you how to use xor exclusive or operations, that is, it can alternate the values of two variables without introducing the third variable. Your variable can be a numerical value, it can also be a character. If it is a character, we need to use its hashcode value for xor operations.
int a = 2;
int b = 3;
Console.WriteLine("a={0}", a);
Console.WriteLine("b={0}", b);
a = a ^ b ^ (b = a);
Console.WriteLine("a={0}", a);
Console.WriteLine("b={0}", b);
#endregion
Result