c# - Read File properties -


i trying read file properties, example if change file extension of test.txt file test_txt.vsf, type of file still .txt in file properties. want read file extension properties.

i usinf below code displays file name extension .vsf. it's extension .txt.

fileinfo info = new fileinfo(@"c:\users\saravana_rajkumar\desktop\test_txt.vsf"); console.writeline(info.extension); 

please guide...

the type of data in file not stored anywhere windows. applications determine if can handle file given.

for example, if rename exe ".txt" can try open notepad, , try open text file.

when this:

if change file extension of test.txt file test_txt.vsf, type of file still .txt in file properties.

you wrong. type of file not still ".txt" in file properties. file properties file type in windows explorer works solely off file suffix.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -