asp.net - how to specify extension for word file and text file in web.config? -


i want give extensions word file , text file .doc , .txt in web.config file. in web.config should write , best practice. new .net please me.

add following config file:

<appsettings>   <add key="fileextension" value="docx"/> </appsettings> 

then, can read following way:

system.configuration.configuration rootwebconfig1 =     system.web.configuration.webconfigurationmanager.openwebconfiguration(null);             if (rootwebconfig1.appsettings.settings.count > 0)             {                 system.configuration.keyvalueconfigurationelement customsetting =                      rootwebconfig1.appsettings.settings["customsetting1"];                 if (customsetting != null)                     console.writeline("customsetting1 application string = \"{0}\"",                          customsetting.value);                 else                     console.writeline("no customsetting1 application string");             } 

refer following link:

http://msdn.microsoft.com/en-us/library/610xe886.aspx


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -