473,398 Members | 2,368 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,398 software developers and data experts.

Saving Text File in registry Key

Hi EveryBody:

Is there any way to save my text file in Registry Key instaed of saving it
in Drive C: or any other drive drive ?

any help will be appreciated

regard's

Husam
Nov 21 '05 #1
4 1244
"Husam" <Hu***@discussions.microsoft.com> wrote in message news:02**********************************@microsof t.com...
Hi EveryBody:

Is there any way to save my text file in Registry Key instaed of saving it
in Drive C: or any other drive drive ?

any help will be appreciated

regard's

Husam


There probably is, assuming the file is not too large. But, just because you can doesn't mean you should.

Just for grins, why would you want to store text files in the registry?
Nov 21 '05 #2
I would read the text as string, convert it to byte array using
System.Text.Encoding.Default.GetBytes() method and use the SetValue method
of the Microsoft.Win32.RegistryKey object to save it to the registry.

To read the data, use the System.Text.Encoding.Default.GetString() method.

See: http://msdn2.microsoft.com/library/d...us,vs.80).aspx,
http://msdn2.microsoft.com/library/7...us,vs.80).aspx and
http://msdn.microsoft.com/library/de...valuetopic.asp
Shariq
sh****@shariqkhan.com
"Husam" <Hu***@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.com...
Hi EveryBody:

Is there any way to save my text file in Registry Key instaed of saving it
in Drive C: or any other drive drive ?

any help will be appreciated

regard's

Husam

Nov 21 '05 #3
"Husam" <Hu***@discussions.microsoft.com> schrieb:
Is there any way to save my text file in Registry Key instaed of saving it
in Drive C: or any other drive drive ?


For saving data in the registry, take a look at the
'Microsoft.Win32.Registry' class. Maybe an isolated storage is what you are
looking for (see documentation).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
I wouldn't suggest you save the file in the registry

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #5

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

Similar topics

5
by: Suresh Kumaran | last post by:
How do you retain the last value the user keyed in a text box? I should be able to show the values when the user runs the executable for the second time. Appreciate help. Suresh
4
by: Amitabh Deepak | last post by:
Is there any way to check whether daylight saving is enabled on a linux machine?
3
by: Ed P. | last post by:
I am trying to save a location to a database using the registry...I've been successful in this, but is there another way I can save this. I have searched on the net and have found that saving the...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
16
by: Larry Woods | last post by:
I need to persist user selections. I know that I can use the Registry, but I was hoping that there was some sort of "text based" solution. TIA, Larry Woods
4
by: Amjad | last post by:
Hi, I'm trying to create dynamic default values in TextBoxes that reflect the last user's input value. How can I save the user's input in a textbox control so that the user can see his last...
15
by: Dan DeConinck | last post by:
Hello, I want to save the position of all the controls on my form. I would like to write them out to a preference file. I have done this in DOS BASIC like this: TO WRITE the preference...
7
by: Kirk | last post by:
Hello, I am trying to find a VB.NET method that will allow me to save and read an application's settings in a separate file located on any drive, any folder. I have found a couple of methods...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
In the Registry at HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Jet \ 4.0 \ Engines \ Text the default key for Text Format is: "Format" = "CSVDelimited" I can use the following OleDB...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.