I am using a file watcher to watch for files changing. My problem is: the
string file info returned is all LOWER CASE.
Below is the important part of the code?
Any suggestions?
using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Diagnost ics;
using System.ServiceP rocess;
using System.IO;
using System.Runtime. InteropServices ;
private void InitializeCompo nent()
{
this.fileSystem Watcher1 = new
System.IO.FileS ystemWatcher();
((System.Compon entModel.ISuppo rtInitialize)(t his.fileSystemW atcher1)).Begin Init();
//
// fileSystemWatch er1
//
this.fileSystem Watcher1.Enable RaisingEvents = true;
this.fileSystem Watcher1.Includ eSubdirectories = true;
this.fileSystem Watcher1.Path = "C:\\";
this.fileSystem Watcher1.Filter = "*.*";
this.fileSystem Watcher1.Delete d += new
System.IO.FileS ystemEventHandl er(this.fileSys temWatcher1_Del eted);
this.fileSystem Watcher1.Rename d += new
System.IO.Renam edEventHandler( this.fileSystem Watcher1_Rename d);
this.fileSystem Watcher1.Change d += new
System.IO.FileS ystemEventHandl er(this.fileSys temWatcher1_Cha nged);
this.fileSystem Watcher1.Create d += new
System.IO.FileS ystemEventHandl er(this.fileSys temWatcher1_Cre ated);
this.CanHandleP owerEvent = true;
this.CanPauseAn dContinue = true;
this.CanShutdow n = true;
this.ServiceNam e = "FileSysWat ch";
((System.Compon entModel.ISuppo rtInitialize)(t his.fileSystemW atcher1)).EndIn it();
private void fileSystemWatch er1_Changed(obj ect sender,
System.IO.FileS ystemEventArgs e)
{
name = e.Name; //??LOWER CASE ONLY!!
}