473,468 Members | 1,418 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 4546
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joan Bos | last post by:
Hi, Is there somewhere on the Internet a description of what a .NET application config file should contain? For our application, I have to write passwords encrypted in a config file. The...
6
by: ALI-R | last post by:
I have tree variable with their values: 1) rptName="report1" 2) rptPath="c:\......" 3) serverPath=http://server... and 4)an arry which contain Name/value pairs. what is the best way of...
9
by: ALI-R | last post by:
Hi,, I have two questions : 1) Is it mandatory that config file of a desktop application must be App.config 2) Is it possible to update config file in your code?? thanks for your help. ALI
1
by: Charles | last post by:
I'm reading some stuff in a custom section of the web.config file into a name value collection. What do I need to do to make this work: Dim nvcConfig As NameValueCollection = _...
0
by: Shaun Ram | last post by:
Hi, I have this constraint. A help would be greatly appreciated. I have this Config file. <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup...
0
by: Shaun Ram | last post by:
Hi, I have this constraint. A help would be greatly appreciated. I have this Config file. <?xml version="1.0" encoding="utf-8" ?> <configuration> <configsections> <sectionGroup...
4
by: feng | last post by:
..Net's .config file is supposed to replace the .ini files. That's all fine if all I need is to read from it. But what if I need both read and write? With .ini file, I can do that very easily with...
3
by: Agnes | last post by:
Can I write a file like config.ini which store the server-name, userid & password, So, my application can read the config.ini file and get the server - name, Does my concept is correct ? If...
10
by: lkrich7 | last post by:
hello, I wrote the following definition: typedef vector< pair<char, TrieNode* TrieNode; but it can't be compiled, because "TrieNode" is not declared in fact my aim is: struct Pair; typedef...
0
by: valdas | last post by:
Hi, I have a problem in accessing "sqlServerCatalogNameOverwrites" section in app.config file. <configuration> <configSections> <section name="sqlServerCatalogNameOverwrites" ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.