?
Solved

App.config hexadecimal values and quotes

Posted on 2006-05-26
2
Medium Priority
?
610 Views
Last Modified: 2006-11-18
Is it possible and how to place hexadecimal numbers in a string in the config file and or strings with a " in it?

   <add key="Colors" value="&H0, &HA0, &HA000, &HA0A0, &HA000A0, &HA0A000, &HA0A0A0"/>
   <add key="SomeString" value="Some string with " and maybe also ' and other weird characters"/>

The standard VB or XML methods don't work I noticed.

&#xxx does not work for special characters.
Adding a \ or another & in front also doesn't help.
I get "expected ;" as soon as I use & in this file.

Visual Studio 2005 with .NET 2.0
0
Comment
Question by:NicoLaan
2 Comments
 
LVL 5

Accepted Solution

by:
mydasx earned 1000 total points
ID: 16770910
app.config while is xml, limits special characters for security purposes.  You will need to create your own inner xml with in the config file rather then using the built in Key Value Pair operations.  You will then simply create your own template for how multiple peices of data are broken up.

e.g.

<myxml>
    <colors>
         <color hex="H0" />
         <color hex="HA0" />
    </colors>
</myxml>

As for special characters, if you are trying to import text statements or "copy" use your webconfig to point at the file or database that these phrases are stored rather then storing them in the app.config
0
 
LVL 4

Author Comment

by:NicoLaan
ID: 16776655
I see, so actually it's not possible just with a workaround.
Thanks for the clear answer.

I'll wait for a week to see if someone disagrees, if not, the points are yours.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question