Hi Hype,
We can't directly assign 'str' to textbox1.Text. The following exception occurs:
"Cross-thread operation not valid: Control 'textBox1' accessed from a thread other than the thread it was created on."
Hence the <control>.Invok e() method.
User Profile
Collapse
-
Porting a FileSystemWatcher app from CosoleApplication to Windows Forms
Hello,
I have the following app. It works great as a console app. It tracks any file changes, renames, or errors:
Code:static void Main(string[] args) { FileSystemWatcher watcher = new FileSystemWatcher(@"C:\"); watcher.NotifyFilter = (NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName); watcher.IncludeSubdirectories
No activity results to display
Show More
Leave a comment: