Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i'm new in c#, i create a login system. is standalone not web base...
how to save the login ID and password without using any database??
Posted
Updated 15-Nov-12 19:53pm
v2
Comments
Karthik Harve 16-Nov-12 0:55am    
are you creating web application or desktop application ?
lailailaihou 16-Nov-12 1:55am    
desktop application
sorry forgot to mention it
faisal23 16-Nov-12 1:29am    
You have to set id and password in code using if loop and you cant change it. If you want to change id password then you have make changes in code.
lailailaihou 16-Nov-12 1:57am    
is it possible to make changes in code if user want to change??
can provide example??
Sorry i forgot to mention, it is desktop application...
faisal23 16-Nov-12 2:02am    
may be it is possible, but sorry i don't know how to make changes in code from runtime.

Hi,

If you dont want to use database to store the login and password detail then you have a choice to store the data in file or use XML to store the login data.

Hope this will help you.

Please refer the below links to work with XML.

http://www.c-sharpcorner.com/UploadFile/mahesh/ReadWriteXMLTutMellli2111282005041517AM/ReadWriteXMLTutMellli21.aspx[^]

http://www.codekicks.com/2007/04/reading-and-writing-xml-files-using-c.html[^]
 
Share this answer
 
v2
Comments
lailailaihou 16-Nov-12 2:03am    
If i want store in file
can give some example??
can save as .dat file??
Mohd. Mukhtar 16-Nov-12 2:18am    
the best way is to store into XML. Because reading and storing data into XML is easy and efficient. I have update some link to work with XML.
Since you are creating a desktop application storing the userID and password would depend on the number of users. If there will be only one user then I suggest keep the userID and password in registry. If there could be multiple users then keep them in an XML file in some isolated storage.

Note: In both the cases do not store it in plain text. store it in encrypted format.
 
Share this answer
 
Comments
lailailaihou 16-Nov-12 2:08am    
let say this application only one user, as you mention i keep in registry.
is it possible if user want to change password or username??
Rahul Rajat Singh 16-Nov-12 2:41am    
yes you can. you just need to write a class to read and write the registry.
lailailaihou 16-Nov-12 3:02am    
thank you very much...
Rahul Rajat Singh
Rahul Rajat Singh 16-Nov-12 3:16am    
you are most welcome. always happy to help fellow developers.
to save the login ID and password without using any database you can use cookies
 
Share this answer
 
Comments
Abhishek Pant 16-Nov-12 1:22am    
he is new to C# and question is also incomplete.
lailailaihou 16-Nov-12 1:52am    
thanks, but
my System is standalone application not web application,
sorry not mention clearly...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900