Posted: 10/22/2010
Hello Experts,
Can anyone tell me how I can create my own file extension?
Thanks in advance.
mohit said: user="mohit kumar"]Hello Experts,Can anyone tell me how I can create my own file extension? Thanks in advance.
user="mohit kumar"]
Hi Mohit,
Please be more specific.
Do you want to create file extension or file format?
File extensions are not something that defines what the file contain. As you already know, you may have .txt file and change its extension to .exe, so it will be an exe file :).
So, you can simply create file mohit.txt and change its extension to mohit.moh - so that its your extension.
As per the file format, the file can be plain text or binary, so you define the format on the way you want to be readable, something like you define the standards. The files we know (.txt, .exe, .rar, .jpg..etc) are all standardized as they are.
For example, in one project in my Master studies, I've created a program that has its own SCRIPT (for more flexibility with interaction), therefor, the script has had it own format which the program was parsing it in order to execute it. After that, I've added feature where user can save the written script on a script file with extension .hs - The program rules were that you must have file with such extension if you want to load it tru the Open -> Load Script feature ;).
So, I did nothing but creating rules in my program :).
Of course, I've registered the file format in folder options (on my PC)
FOLDER OPTIONS -> File Types - and have made them to open with my program.
Hope you get this.
Regards,Hajan
Posted: 10/23/2010
Mohit,
Your question is not specific what will you do with it , are you asking how to handle it in IIS ??
I just wrote a blog http://www.codeasp.net/blogs/raghav_khunger/microsoft-net/1007/custom-handler-to-handle-custom-extensions may be that is what you are asking .
Thank you Hajan:)