From: Tim on
Hello, can you tell me how to export the xp registry with the streamwriter in c#?



auld wrote:

just to finish this thread i thought i add what i have found.
10-Jun-08

just to finish this thread i thought i add what i have found.

when i created my registry export file i used StreamWriter without any
specific codepage encoding.

not mention in the MSDN links is that

Previous Posts In This Thread:

On Freitag, 30. Mai 2008 16:15
auld wrote:

local and remote machine registry export
i current have a way to read both local and remote machines registry keys and
create a textual view (.txt output).

i now looking for ways to do export of local and remote mahcine registry
keys into "

On Freitag, 30. Mai 2008 16:35
Peter Duniho wrote:

Re: local and remote machine registry export
In C#?


If you already have code that produces text output of the registry, you are
most of the way there. The .reg file format is extremely simple. You
just need to specify specific key paths in s

On Freitag, 30. Mai 2008 18:31
auld wrote:

Peter,thanks for your response.
Peter,
thanks for your response.
yes i have C# code to create a textual file of the registry key hive i want.
but i read the 2 kbs and i do not see how to use C# to create the ".reg" file
export.
they

On Freitag, 30. Mai 2008 19:50
Peter Duniho wrote:

Re: local and remote machine registry export
The first article I provided documents the .reg file format. I am not
aware of any support in .NET to write the format automatically (though it
might yet exist). But the format is so simple that if

On Samstag, 31. Mai 2008 00:21
auld wrote:

will the file i create be able to be used by regedit to import on a machine?
will the file i create be able to be used by regedit to import on a machine?
i light is still not coming on.


"Peter Duniho" wrote:

On Samstag, 31. Mai 2008 00:26
auld wrote:

i think i can build the string and dword registry key to mimic the regedit
i think i can build the string and dword registry key to mimic the regedit
export file. but i'm seeing a problem constructing the "REG_MULTI_SZ" output
so that it mimics the regedit structure.

my cod

On Samstag, 31. Mai 2008 03:11
Peter Duniho wrote:

Re: local and remote machine registry export
Yes. The .reg file format is just a text file with a particular format
for the text contained within.

Again, I direct you to the Microsoft KB article I mentioned earlier, that
describes the format.

On Montag, 2. Juni 2008 15:48
auld wrote:

Peter you are smarter person than i.i understand what i read.
Peter you are smarter person than i.
i understand what i read. but using the C# registry class i do not see how to
get the "REG_MULTI_SZ".

i can get a string output but i can not build the output as

On Montag, 2. Juni 2008 15:58
Peter Duniho wrote:

Re: local and remote machine registry export
Maybe. Maybe not. Too early to tell. :)

=


,00,52,00,\
,00,4c,\
,4e,00,\
,00,55,\
,4c,00,\
,00,4d,\
,54,00,\

Well, what exactly is it that you are having difficulty with?

I mean, I can see a nu

On Montag, 2. Juni 2008 16:44
auld wrote:

Re: local and remote machine registry export
the output i can create for a "multi_sz" is something like this:
Number of records in WrapperComponentList = 4
WrapperComponentList = (REG_MULTI_SZ) DRIVER_US
WrapperComponentList = (REG_MULTI_SZ) MSD

On Montag, 2. Juni 2008 21:18
Peter Duniho wrote:

Re: local and remote machine registry export
Now we are getting somewhere! That example was precisely the sort of
information needed to elaborate on your question.


Yes, that is true. As the docs say, and as you are aware, there is a
specific

On Dienstag, 3. Juni 2008 09:33
auld wrote:

Peter,once again thanks.i will do the research and work on this.
Peter,
once again thanks.
i will do the research and work on this. this is great tips.

"Peter Duniho" wrote:

On Dienstag, 10. Juni 2008 09:39
auld wrote:

just to finish this thread i thought i add what i have found.
just to finish this thread i thought i add what i have found.

when i created my registry export file i used StreamWriter without any
specific codepage encoding.

not mention in the MSDN links is that

On Freitag, 23. Oktober 2009 06:57
Tim Taler wrote:

export registry
Hello, can you tell me how to export the xp registry with streamwriter in c# ?

EggHeadCafe - Software Developer Portal of Choice
Pure Javascript Martin Browser Fractals
http://www.eggheadcafe.com/tutorials/aspnet/6ac093ba-b60b-4134-8f34-87a1e53898a5/pure-javascript-martin-br.aspx
From: Gregory A. Beamer on
Tim Taler wrote in news:200910237326simon.sickinger(a)gmx.de:

> Hello, can you tell me how to export the xp registry with the
> streamwriter in c#?

What are you trying to do:

1. Read the file?
2. Walk the values and create a file to recreate the registry?

If read the file, I would aim at a binary reader, but realize that the
registry is constantly accessed, so this is likely to end up with
errors.

If walk the values, then you need full registry access and you start
with the top key values:

HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_CURRENT_CONFIG

and then walk through each subkey.

Either of these is likely to be fraught with danger, so the better
question is "why are you trying to do this?" The answer to that question
will reveal the true problem domain rather than the currently attempted
solution.

Peace and Grace,



--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
From: Jeroen Mostert on
Tim Taler wrote:
> Hello, can you tell me how to export the xp registry with the streamwriter in c#?
>
P/Invoke to RegSaveKey() or RegSaveKeyEx() and forget about the stream writer.

--
J.