Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C C#
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 15-Nov-12 19:53pm
Edited 15-Nov-12 20:53pm
v2
Comments
Karthik Harve at 16-Nov-12 0:55am
   
are you creating web application or desktop application ?
lailailaihou at 16-Nov-12 1:55am
   
desktop application
sorry forgot to mention it
faisal23 at 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 at 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 at 16-Nov-12 2:02am
   
may be it is possible, but sorry i don't know how to make changes in code from runtime.
lailailaihou at 16-Nov-12 2:11am
   
thank you for providing information.
i will try research on this.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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[^]
  Permalink  
v2
Comments
lailailaihou at 16-Nov-12 2:03am
   
If i want store in file
can give some example??
can save as .dat file??
Mohd. Mukhtar at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  
Comments
lailailaihou at 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 at 16-Nov-12 2:41am
   
yes you can. you just need to write a class to read and write the registry.
lailailaihou at 16-Nov-12 3:02am
   
thank you very much...
Rahul Rajat Singh
Rahul Rajat Singh at 16-Nov-12 3:16am
   
you are most welcome. always happy to help fellow developers.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

to save the login ID and password without using any database you can use cookies
  Permalink  
Comments
Abhishek Pant at 16-Nov-12 1:22am
   
he is new to C# and question is also incomplete.
lailailaihou at 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)

  Print Answers RSS
0 OriginalGriff 499
1 Maciej Los 325
2 Sergey Alexandrovich Kryukov 234
3 DamithSL 233
4 Mathew Soji 195
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100