Login user using xml as database(C#)

Johny Bravo
Johny Bravo used Ask the Experts™
on
Hi Experts,
I am usign an XML file as database.I am storing Username and password in xml file(I know its a bad idea but I am not having any database option on my web server.).I am storing the user details in xml file at the time of registration,now I want to authenticate user against this xml file.
I am giving Sample xml here.I am getting my hands on xml, so I really appreciate your help how to login user using credential in xml file.

<customerList>
- <customer>
  <name>Johny</name> 
  <address>Canada</address> 
  <emailID>johny_bravo1@gmail.com</emailID> 
  <company>IT</company> 
  <country>Canada</country> 
  <contact /> 
  <comment /> 
  <registeredForNews>False</registeredForNews> 
  <product>False</product> 
  <Username>johny_bravo1@gmail.com</Username> 
  <Pwd>johy567</Pwd> 
  </customer>
- <customer>
  <name>Marshal</name> 
  <address>Canada</address> 
  <emailID>marshal_tweetu@gmail.com</emailID> 
  <company>XYZ</company> 
  <country>Canada</country> 
  <contact /> 
  <comment /> 
  <registeredForNews>False</registeredForNews> 
  <product>GWD Project</product> 
  <Username>marshal_tweetu@gmail.com</Username> 
  <Pwd>marsh544j</Pwd> 
  </customer>
- <customer>
  <name>sagar</name> 
  <address>Mumbai</address> 
  <emailID>sagar@gmail.com</emailID> 
  <company>Bitwise</company> 
  <country>India</country> 
  <contact /> 
  <comment /> 
  <registeredForNews>False</registeredForNews> 
  <product>HR mgnt</product> 
  <Username>sagar@gmail.in</Username> 
  <Pwd>skosag</Pwd> 
  </customer>
- <pages>
  <aboutUs>0</aboutUs> 
  <captiveServices>0</captiveServices> 
  <careers>0</careers> 
  <contact>0</contact> 
  <downloads>0</downloads> 
  <enquiry>0</enquiry> 
  <gwd>1</gwd> 
  <indiaSolution>0</indiaSolution> 
  <news>0</news> 
  <productEngineering>0</productEngineering> 
  <products>0</products> 
  <supportServices>0</supportServices> 
  <testimonials>0</testimonials> 
  </pages>
  </customerList>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2013
Commented:
Check examples here:
http://msdn.microsoft.com/en-us/library/1b1y85bh(VS.71).aspx
http://www.15seconds.com/issue/020305.htm
Concept with DB or XML or web.config will remain same...difference is just accessing username/password.
at the end you will have to set FormsAuthentication cookie... upon successful validation.

Author

Commented:
Thanks for the links.I am having a look at it and will update you about my progress.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial