J
jimdscudder
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.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.IO;
using System.Runtime.InteropServices;
private void InitializeComponent()
{
this.fileSystemWatcher1 = new
System.IO.FileSystemWatcher();
((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).BeginInit();
//
// fileSystemWatcher1
//
this.fileSystemWatcher1.EnableRaisingEvents = true;
this.fileSystemWatcher1.IncludeSubdirectories = true;
this.fileSystemWatcher1.Path = "C:\\";
this.fileSystemWatcher1.Filter = "*.*";
this.fileSystemWatcher1.Deleted += new
System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Deleted);
this.fileSystemWatcher1.Renamed += new
System.IO.RenamedEventHandler(this.fileSystemWatcher1_Renamed);
this.fileSystemWatcher1.Changed += new
System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Changed);
this.fileSystemWatcher1.Created += new
System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Created);
this.CanHandlePowerEvent = true;
this.CanPauseAndContinue = true;
this.CanShutdown = true;
this.ServiceName = "FileSysWatch";
((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).EndInit();
private void fileSystemWatcher1_Changed(object sender,
System.IO.FileSystemEventArgs e)
{
name = e.Name; //??LOWER CASE ONLY!!
}
string file info returned is all LOWER CASE.
Below is the important part of the code?
Any suggestions?
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.IO;
using System.Runtime.InteropServices;
private void InitializeComponent()
{
this.fileSystemWatcher1 = new
System.IO.FileSystemWatcher();
((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).BeginInit();
//
// fileSystemWatcher1
//
this.fileSystemWatcher1.EnableRaisingEvents = true;
this.fileSystemWatcher1.IncludeSubdirectories = true;
this.fileSystemWatcher1.Path = "C:\\";
this.fileSystemWatcher1.Filter = "*.*";
this.fileSystemWatcher1.Deleted += new
System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Deleted);
this.fileSystemWatcher1.Renamed += new
System.IO.RenamedEventHandler(this.fileSystemWatcher1_Renamed);
this.fileSystemWatcher1.Changed += new
System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Changed);
this.fileSystemWatcher1.Created += new
System.IO.FileSystemEventHandler(this.fileSystemWatcher1_Created);
this.CanHandlePowerEvent = true;
this.CanPauseAndContinue = true;
this.CanShutdown = true;
this.ServiceName = "FileSysWatch";
((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).EndInit();
private void fileSystemWatcher1_Changed(object sender,
System.IO.FileSystemEventArgs e)
{
name = e.Name; //??LOWER CASE ONLY!!
}