473,387 Members | 2,436 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.

store user DATA

hi
I am new to C# programming. can anyone tell me what is the standard way to
store high sensitive user data for application, so that application next run
can get back those data.

Nov 15 '05 #1
3 2474
Well that all depends on the tools available to you.

You could store the data in a database (SQL server, Access etc...) you
could store the data in a proprietary binary format. Databases are good for
persistent data storage and usually have pretty good security and
encryption.

-Casey
--
Legal Disclaimer: just in case you were wondering:
This posting is provided "AS IS" with no warranties, and confers no rights.

"pei_world" <pe*******@hotmail.com> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
hi
I am new to C# programming. can anyone tell me what is the standard way to store high sensitive user data for application, so that application next run can get back those data.

Nov 15 '05 #2
You have a bunch of different ways.

1. StreamReader and StreamWriter classes, allow you to read files.

// create or open a file
StreamWriter writer = new StreamWriter("c:\\test.txt");
// write data to it
writer.WriteLine("File created using StreamWriter class.");
// close
writer.Close();

similar class called StreamReader reads the file.

Also you could create a class which derives from a persistent class,
which then allows you to write that classes properties to disk.

[Serializable]
public class Dog {
public string name;
public string licenseTag;
}

Dog d = new Doc ();
d.name = "Rex";
d.tag = "OU812";

IFormatter formatter = new BinaryFormatter();
Stream stm = new FileStream("myDataStore.dta",
FileMode.Create, FileAccess.Write,
FileShare.None);
formatter.Serialize (stm,d); // stream the dog object out to disk.
stm.Close();

To read it back:
;IFormatter fmt = new BinaryFormatter();
Stream stm = new FileStream("myDataStore.dta",
FileMode.Open, FileAccess.Read,
FileShare.Read);
Dog dogFromDisk = (Dog) fmt.Deserialize(stm);
stm.Close();

// the data has now been restored in the object
//
this will store the data in binary. If you need moer security then you could
(just a wacky thought)
after you write the object to disk, then encrypt it. When you load the
object back into memory, then
decrypt the file before loading the stream.

With the file writina approach you could also encrypt it before you write it
to file
and then when you read the data back in, then once you have read it, then
decrypt it maybe?

of course, there are things like xml disconnected datasets and databases and
all that, but my
impression was you wanted to store some simple data say password or
something like that in a file, which
is in the same directory as the application or something like that. With
that assumption, i think
these approaches should get you up and running pretty quickly without the
need for you
to learn any of those other technologies.... but as I said it depends on
your needs.

hope that helps,
J

hope thi

"pei_world" <pe*******@hotmail.com> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
hi
I am new to C# programming. can anyone tell me what is the standard way to store high sensitive user data for application, so that application next run can get back those data.

Nov 15 '05 #3
You have a bunch of different ways.

1. StreamReader and StreamWriter classes, allow you to read files.

// create or open a file
StreamWriter writer = new StreamWriter("c:\\test.txt");
// write data to it
writer.WriteLine("File created using StreamWriter class.");
// close
writer.Close();

similar class called StreamReader reads the file.

Also you could create a class which derives from a persistent class,
which then allows you to write that classes properties to disk.

[Serializable]
public class Dog {
public string name;
public string licenseTag;
}

Dog d = new Doc ();
d.name = "Rex";
d.tag = "OU812";

IFormatter formatter = new BinaryFormatter();
Stream stm = new FileStream("myDataStore.dta",
FileMode.Create, FileAccess.Write,
FileShare.None);
formatter.Serialize (stm,d); // stream the dog object out to disk.
stm.Close();

To read it back:
;IFormatter fmt = new BinaryFormatter();
Stream stm = new FileStream("myDataStore.dta",
FileMode.Open, FileAccess.Read,
FileShare.Read);
Dog dogFromDisk = (Dog) fmt.Deserialize(stm);
stm.Close();

// the data has now been restored in the object
//
this will store the data in binary. If you need moer security then you could
(just a wacky thought)
after you write the object to disk, then encrypt it. When you load the
object back into memory, then
decrypt the file before loading the stream.

With the file writina approach you could also encrypt it before you write it
to file
and then when you read the data back in, then once you have read it, then
decrypt it maybe?

of course, there are things like xml disconnected datasets and databases and
all that, but my
impression was you wanted to store some simple data say password or
something like that in a file, which
is in the same directory as the application or something like that. With
that assumption, i think
these approaches should get you up and running pretty quickly without the
need for you
to learn any of those other technologies.... but as I said it depends on
your needs.

hope that helps,
J

hope thi

"pei_world" <pe*******@hotmail.com> wrote in message
news:OW**************@TK2MSFTNGP12.phx.gbl...
hi
I am new to C# programming. can anyone tell me what is the standard way to store high sensitive user data for application, so that application next run can get back those data.

Nov 15 '05 #4

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

Similar topics

5
by: Lars Behrens | last post by:
Hi there! For a web project I need a little expert help. I don't have written much code yet, just been fiddling around a bit, testing and planning. The web site will have a submission page for...
11
by: Colin Steadman | last post by:
Hope this makes sense! I'm building an ASP page which allows uses to add items to an invoice via a form, ie: Item No Part No Order No Quanity Units Price VAT ------- ...
2
by: Peter Rilling | last post by:
How does Windows store passwords that it uses? For instance, when you install a service, you can provide it the username and password. This information is stored somehow so that at a later date...
1
by: pei_world | last post by:
hi I am new to C# programming. can anyone tell me what is the standard way to store high sensitive user data for application, so that application next run can get back those data.
5
by: Guadala Harry | last post by:
What are my options for *securely* storing/retrieving the ID and password used by an ASP.NET application for accessing a SQL Server (using SQL Server authentication)? Please note that this ID and...
5
by: moondaddy | last post by:
I'm caching a dataset in an asp.net session variable to hold a user's data. one data item I need to store is an image the user uploaded. My problem is that I don't know how to get the image into...
0
by: Harley | last post by:
I am trying to write a personal app to keep a bank balance and history. The problem I'm haveing is finding a decent way to store the data on a pocketpc under .net compact framewok useing vb.net....
3
by: noridotjabi | last post by:
Say I'm writting a program. In this program for some reason I need to store data somewere were I will be able to access it again. I don't want to store it in a file because then it could be...
2
by: Alex | last post by:
Hey Guys.. I'm just now starting to learn VB 2005, but I have a question that might help me in the long run. I hope to write applications which store user data, and without wanting the user to...
0
by: Brian Vanderburg II | last post by:
Lance Gamet wrote: Lance Gamet wrote: One way I've just started to use it to create a utility function to return the location of the user data folder, depending on the operating system: import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.