Solved

c# user access login detail storing

Posted on 2013-01-18
3
255 Views
Last Modified: 2013-01-23
Hi

I am developing an application with an MDI form, and the first thing the user does is login, so a login form is the first thing they see.

I have created a login script, which checks the database and returns true/false of the details are correct.  Now, I need to store the login details somewhere that is accessible from all forms in the application (on a website I would store them in a session variable) what is the way to do this in c#?

Cheers

CD
0
Comment
Question by:cycledude
  • 2
3 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 38792352
A singleton class is probably what you are looking for.

http://en.wikipedia.org/wiki/Singleton_pattern
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 38792354
Also this for some implementations:
http://csharpindepth.com/Articles/General/Singleton.aspx
0
 

Author Closing Comment

by:cycledude
ID: 38811634
thanks andy
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to read json value 2 50
Hey Audio! 3 30
.NET 2008 VB and C# 6 28
What is Microsoft.Exchange.WebServices.Data.ExchangeService in PowerShell? 4 26
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question