Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working on processing some files(in windows application i..e c#)

i have doubt as below.

How can i find the file type whether the file is .pdf or .doc or .txt if the extensions are hide.

(if we set in the system tools-->Folder Options-->View-->Hide extensions from known file types is checked)



Regards,
Posted

1 solution

If you are working on the files in C#, then the extension is not hidden - it is only not displayed to the user in dialog boxes and windows explorer. As far as your code is concerned, it is there and readable.
 
Share this answer
 
Comments
nm.nagaraju 30-Sep-11 7:19am    
how can you identify whether the file is .pdf or .doc if the extension of a file is hidden mode.
i am processing only .pdf files what i am doing is:-
i am reading the .pdf and i am processing
if the .pdf is hidden i can't able to read through the code...
OriginalGriff 30-Sep-11 7:29am    
It's only hidden from users: if you are using FileInfo objects to refer to your files (and if you aren't, do) then you could look at the Name property "myfile.pdf" or the Extension property ".pdf"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900