|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Accessing and editing the web.config file
<i><b>Originally posted by : Kerry (whelan_kerry@hotmail.com)</b></i><br />Hi,<br />I am trying to edit different sections of the web.config file. I can gain <br />access to configSections that I have defined using <br />ConfigurationSettings.GetConfig(People/owner) in my code when the <br />web.config file is as follows:-<br /><br />...<br /><configSections><br /> <sectionGroup name="People"><br /> <section name="owner" <br />type="System.Configuration.SingleTagSectionHandler, System, <br />Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" <br />allowLocation="false" /> <br /> <section name="seller" <br />type="System.Configuration.SingleTagSectionHandler, System, <br />Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" <br />allowLocation="false" /><br /> </sectionGroup><br /></configSections><br /> <br /><!-- Custom application settings. --><br /> <People><br /> <owner name="Joe" age="30"/><br /> <seller name="Jack" age="20"/><br /> </People><br /><br />What is the best way to go about changing Joe's name through my C# web <br />application?<br /><br />Also I am having difficulties in accessing any of the sections within the <br />system.web section. How can I access and edit a value for example:- <br /><sessionState Cookieless="false"><br />I have tried using bool nocookies = Session.Cookieless but I am looking for <br />a generic method like ConfigurationSettings.GetConfig(section/value).<br /><br />Any help would be greatly appreciated.<br /><br />Kerry<br /><br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : steve (steve@aspfree)</b></i><br />trying to secure certain parts of a .config to certain people wouldn't be a good idea. You could have a separate process that writes the certain information to each person and an automated script to generate the web.config file based on the information a person entered. Just bouncing some ideas around but having certain people who have rights to various parts of one web.config file is something that could risk things. just my 2 cents. <br /><br />------------<br />Kerry at 5/16/2002 8:31:31 AM<br /><br />Hi,<br />I am trying to edit different sections of the web.config file. I can gain <br />access to configSections that I have defined using <br />ConfigurationSettings.GetConfig(People/owner) in my code when the <br />web.config file is as follows:-<br /><br />...<br /><configSections><br /> <sectionGroup name="People"><br /> <section name="owner" <br />type="System.Configuration.SingleTagSectionHandler, System, <br />Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" <br />allowLocation="false" /> <br /> <section name="seller" <br />type="System.Configuration.SingleTagSectionHandler, System, <br />Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" <br />allowLocation="false" /><br /> </sectionGroup><br /></configSections><br /> <br /><!-- Custom application settings. --><br /> <People><br /> <owner name="Joe" age="30"/><br /> <seller name="Jack" age="20"/><br /> </People><br /><br />What is the best way to go about changing Joe's name through my C# web <br />application?<br /><br />Also I am having difficulties in accessing any of the sections within the <br />system.web section. How can I access and edit a value for example:- <br /><sessionState Cookieless="false"><br />I have tried using bool nocookies = Session.Cookieless but I am looking for <br />a generic method like ConfigurationSettings.GetConfig(section/value).<br /><br />Any help would be greatly appreciated.<br /><br />Kerry<br /><br />
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > Accessing and editing the web.config file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|