When I use e.Fullname
or e.Name
on a file, it gives me the full name + extension, but I just want the name of the file without like:".txt" after the name.
How do I show just the file name without the extension behind it? Is there a particular code for it?
Do I have to get the extension from the e.fullname
apart and just use the piece that remains as the name without extension? Which one of these should I do?
Like at this:
private void fileSystemWatcher1_Changed(object sender, System.IO.FileSystemEventArgs e)
{
listBox1.Items.Add("File changed> " + e.FullPath + " -Date:" + DateTime.Now);
name = e.Name;
extension = Path.GetExtension(e.FullPath);
size = e.Name.Length;
}