[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

c# user access login detail storing

Posted on 2013-01-18
3
Medium Priority
?
264 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 45

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 45

Accepted Solution

by:
AndyAinscow earned 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

834 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