469,612 Members | 1,639 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

Write Namevalue pair into Config file


Hi I have this constraint. A help would be greatly apprecitated.
I have this Config file.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="ITASCA">
<section name="ConnectionString"
type="System.NamevaluesectionHandler,System" />
</sectionGroup>
</configSections>

<ITASCA>
<ConnectionString>
<add key="projcode1" value="database"/>
<add key="projcode2" value="database2"/>
</ConnectionString>
</ITASCA>
I use VB.NET to read this section
I want to use DPAPI with Machine store. For this I have to read the
connection string from config file as name value pair, Then encrypt the
connection string & want to replace back the encrypted string into the
same section of config file.
I have a issue in writing into the same section. Couple somebody please
help me with writing as name value pair, as a attribute into the
section.
I used configuration management application block from microsoft to
write. But then I was unable to write as an attribute to a element in a
node.

A help would be greatly apprecitated.
Thanking you
Shaun

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
2 4349
What exactly is your issue? How are you opening the config file? Are you
sure it's read/write?
What exception are you seeing?
--
HTH
Christoph Schittko [MVP, XmlInsider]
Software Architect, .NET Mentor
"Shaun Ram" <tr************@yahoo.com> wrote in message
news:ep**************@TK2MSFTNGP12.phx.gbl...

Hi I have this constraint. A help would be greatly apprecitated.
I have this Config file.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="ITASCA">
<section name="ConnectionString"
type="System.NamevaluesectionHandler,System" />
</sectionGroup>
</configSections>

<ITASCA>
<ConnectionString>
<add key="projcode1" value="database"/>
<add key="projcode2" value="database2"/>
</ConnectionString>
</ITASCA>
I use VB.NET to read this section
I want to use DPAPI with Machine store. For this I have to read the
connection string from config file as name value pair, Then encrypt the
connection string & want to replace back the encrypted string into the
same section of config file.
I have a issue in writing into the same section. Couple somebody please
help me with writing as name value pair, as a attribute into the
section.
I used configuration management application block from microsoft to
write. But then I was unable to write as an attribute to a element in a
node.

A help would be greatly apprecitated.
Thanking you
Shaun

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #2
Thanks for responding.
The requirement is:
I have the connection string in web.config file. This needs to be
encrypted using DPAPI.
But I can't use Registry or user store(Can't use Serviced components to
load profile)
So I'm trying to implement DPAPI with Machine Store.

But then on the deployment server, if the connection string is encrypted
on developer's machine I will not be able to decrypt it on server end
for application,
So I though if I could Encrypt & write the connection string at runtime
to the config file at server end, I could also decrypt at the server
end. This way the developers could use the encrypted string from the
server. (This issue poses problem during production & deployment)

Another question, with DPAPI Machine store can I Remotely log-in into
the server & decrypt the connection string?
If this works then I will not have to write into config file.

Do you have any sugestions for this requirement
Thanking you in advance
Shaun

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Joan Bos | last post: by
6 posts views Thread by ALI-R | last post: by
9 posts views Thread by ALI-R | last post: by
1 post views Thread by Charles | last post: by
reply views Thread by Shaun Ram | last post: by
3 posts views Thread by Agnes | last post: by
10 posts views Thread by lkrich7 | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.