In a ListView box I want to list the file type.
Example if in the list box the Name is foo.txt the Type would be Text Document.
I thought using the FileInfo class would help but I am a bit lost.
I tried
string[] CipherFiles = System.IO.Direc tory.GetFiles(@ "C:\Cipher\Ciph erResult");
//File Info for file we looked at
System.IO.FileI nfo fi = new System.IO.FileI nfo(CipherFiles[0]);
object FileTypeObj = fi.GetType();
Console.WriteLi ne("object o = fi: Type is {0}", fi.GetType());
But am not sure how to get the type. I have to believe that the type is registered somewhere and I can tap into it but I do not have a clue at this point.
Example if in the list box the Name is foo.txt the Type would be Text Document.
I thought using the FileInfo class would help but I am a bit lost.
I tried
string[] CipherFiles = System.IO.Direc tory.GetFiles(@ "C:\Cipher\Ciph erResult");
//File Info for file we looked at
System.IO.FileI nfo fi = new System.IO.FileI nfo(CipherFiles[0]);
object FileTypeObj = fi.GetType();
Console.WriteLi ne("object o = fi: Type is {0}", fi.GetType());
But am not sure how to get the type. I have to believe that the type is registered somewhere and I can tap into it but I do not have a clue at this point.
Comment