473,387 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem registry value is read as verbatim

Hello,

Is there a way to read values from the registry as regular instead of
verbatim?

Regards,
Fred
Nov 16 '05 #1
8 1768
Is there a way to read values from the registry as regular instead of
verbatim?


What do you mean by regular and verbatim in this context?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2

"Mattias Sjögren" <ma********************@mvps.org> schreef in bericht
news:Or**************@TK2MSFTNGP09.phx.gbl...
Is there a way to read values from the registry as regular instead of
verbatim?


What do you mean by regular and verbatim in this context?


Hi Mattias,

When I read a string value from the registry then the string is formatted
with @ in the begin. I want to read it regular so that I can use the \r and
etc in the string for text formatting.

Regards,
Fred
Nov 16 '05 #3
Fred <fred@invalid> wrote:
When I read a string value from the registry then the string is formatted
with @ in the begin. I want to read it regular so that I can use the \r and
etc in the string for text formatting.


You're being confused by the debugger.

See http://www.pobox.com/~skeet/csharp/s....html#debugger

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4

"Jon Skeet [C# MVP]" <sk***@pobox.com> schreef in bericht
news:MP************************@msnews.microsoft.c om...
Fred <fred@invalid> wrote:
When I read a string value from the registry then the string is formatted
with @ in the begin. I want to read it regular so that I can use the \r
and
etc in the string for text formatting.


You're being confused by the debugger.


Hi Jon,

Compiled as release same "problem", when I add a \r or whatever to the
string in the register and write it to a textbox for testing the \r is
displayed as \r instead of a return. Is there another solution for this?

Regards,
Fred
Nov 16 '05 #5
Fred <fred@invalid> wrote:
Compiled as release same "problem", when I add a \r or whatever to the
string in the register and write it to a textbox for testing the \r is
displayed as \r instead of a return. Is there another solution for this?


If it's \r in the textbox itself, then that's in the registry. You can
replace all occurrences of "\r" with CR, but you need to know for
certain what you really expect in the registry.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #6

"Jon Skeet [C# MVP]" <sk***@pobox.com> schreef in bericht
news:MP************************@msnews.microsoft.c om...
Fred <fred@invalid> wrote:
Compiled as release same "problem", when I add a \r or whatever to the
string in the register and write it to a textbox for testing the \r is
displayed as \r instead of a return. Is there another solution for this?


If it's \r in the textbox itself, then that's in the registry. You can
replace all occurrences of "\r" with CR, but you need to know for
certain what you really expect in the registry.


Hi Jon

What I want is that a string stored in the registry something like this
'Thank you \r\n second line' read out of the registry and use that in a
e-mail. When I remove the @ in debug mode or create the string in the
program then it works. Only when a read the string from the registry it is
not formatted like the way I want.

Regards,
Fred
Nov 16 '05 #7

The problem is that when you put "Thank you \r\n second line" in C#
source code the compiler replaces the \r and \n with appropriate
characters in the compiled code. That does not happen at run-time.
To gain this behavior at you'll need to do a replace on the string to
replace the escape characters you want to support with their actual
values.

Best regards,

Sam
On Wed, 9 Mar 2005 11:55:49 +0100, "Fred" <fred@invalid> wrote:

"Jon Skeet [C# MVP]" <sk***@pobox.com> schreef in bericht
news:MP************************@msnews.microsoft. com...
Fred <fred@invalid> wrote:
Compiled as release same "problem", when I add a \r or whatever to the
string in the register and write it to a textbox for testing the \r is
displayed as \r instead of a return. Is there another solution for this?


If it's \r in the textbox itself, then that's in the registry. You can
replace all occurrences of "\r" with CR, but you need to know for
certain what you really expect in the registry.


Hi Jon

What I want is that a string stored in the registry something like this
'Thank you \r\n second line' read out of the registry and use that in a
e-mail. When I remove the @ in debug mode or create the string in the
program then it works. Only when a read the string from the registry it is
not formatted like the way I want.

Regards,
Fred


B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.
Nov 16 '05 #8
Fred <fred@invalid> wrote:
What I want is that a string stored in the registry something like this
'Thank you \r\n second line' read out of the registry and use that in a
e-mail. When I remove the @ in debug mode or create the string in the
program then it works. Only when a read the string from the registry it is
not formatted like the way I want.


I suggest you read the whole of the page I linked to before, and
understand what the @ is actually doing when it's in source code, and
what the difference is between a string literal in source code and the
string itself.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bob Kirkwood | last post by:
I believe the intent in .NET is that we store application setup information in an XML file now instead of the Registry or INI files. Is this correct? Are there any tools, sample apps, or...
2
by: fabrice | last post by:
hello, Is it possible to read a registry key in ASP, and use the value in an application via a session variable. I'm using II6 on windows server 2003. I'd like to create a key in the registry...
8
by: Saradhi | last post by:
Can any one put me a piece of code to write binary data into Registry?
3
by: Herb Finkel | last post by:
The following code is fairly simple to capture command line arguments: using System; namespace ConsoleApplication1 { class Class1 { static void Main(string args) { string first = args;
5
by: Tony | last post by:
TIA Tony
1
by: Bud Roble | last post by:
I've written a service program in VB.NET and I can't seem to get it to be able to read entries in the registry. Is there some trick to this? I have a windows program that reads and writes the...
5
by: Scott M. Lyon | last post by:
I've just discovered a bug in some code I wrote a little while ago, and I need you guys' help to fix it. My program imports data from a standard Excel Spreadsheet (just with specific column...
9
by: nbs.tag | last post by:
hey guys heres my question. I was told by a little birdie that .net 2.0 has the ability to read a connection string directly from a registry key. so in the registry key a string value of say :...
3
by: Aussie Rules | last post by:
Hi, I want to store some data in the registry, however I have not been able to do this, and think my logic maybe flawed. Firstly I try to open the registry and read in any existing values....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.