Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to use file watcher in c#

private void watch()
{
  FileSystemWatcher watcher = new FileSystemWatcher();
  watcher.Path = path;
  watcher.NotifyFilter = NotifyFilters.LastWrite;
  watcher.Filter = "*.*";
  watcher.Changed += new FileSystemEventHandler(OnChanged);
  watcher.EnableRaisingEvents = true;
}
Comment

c# file watcher

public MainWindow()
{
    InitializeComponent();

    FileSystemWatcher fsw = new FileSystemWatcher();
    fsw.Filter = "test1.csv";
    fsw.NotifyFilter = NotifyFilters.LastWrite;
    fsw.Path = "z:	emp";
    fsw.Changed += Fsw_Changed;
    fsw.EnableRaisingEvents = true;    
}

private void Fsw_Changed(object sender, FileSystemEventArgs e)
{
    MessageBox.Show(e.FullPath);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity how get random color to material 
Csharp :: how to map datatable to list in c# 
Csharp :: convert list to dicitonary c# 
Csharp :: c# loop through files in folder 
Csharp :: difference between while and do while in c# 
Csharp :: c# send email 
Csharp :: how to add item to listbox in c# 
Csharp :: WebClient c# with custom user agent 
Csharp :: c# timer 
Csharp :: json.net deserialize dynamic 
Csharp :: how to create a list in c# unity 
Csharp :: C# .net core convert string to enum 
Csharp :: unity create gameobject 
Csharp :: c# 
Csharp :: how to make a car in unity 
Csharp :: how to make a singleton in unity 
Csharp :: how to access individual characters in a string in c# 
Csharp :: C# How to read users input and display it 
Csharp :: c# list to array 
Csharp :: convert.tostring with datetime string 
Csharp :: c# list subfolders 
Csharp :: run wpf application maximized 
Csharp :: where did mark twain go to school 
Csharp :: xamarin forms open new page on button click 
Csharp :: how to verify the scene unity 
Csharp :: c# foreach on a dictionary 
Csharp :: 3d perlin noise unity 
Csharp :: unity raycast 2d 
Csharp :: unity new vector3 
Csharp :: remove adjacent duplicate characters 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =