I have created a login screen using visual studio C# 2010, I want to link form to after members have logged in. How do I do this?
How do I enter multiple users for this login application.
Help much appreciated
4 Replies - 2351 Views - Last Post: 13 October 2011 - 06:55 AM
Rate Topic:




Replies To: C# windows forms
#2
tlhIn`toq
Re: C# windows forms
Posted 13 October 2011 - 06:43 AM
There are a LOT of ways you can go with this.
But personally I create a Permissions class that has properties for my needs:
Each of your User classes has a Permissions object
That gets you the concept. *HOW* you save and store these is up to you. Database, XML files, Registry, Each user on their own USB flash drive... Whatever... That's up to you and your application.
But personally I create a Permissions class that has properties for my needs:
.CanExit .CanEditUsers .CanIssueRefundsand so on.
Each of your User classes has a Permissions object
class User
{
Permissions myPerms = new Permissions();
#region Constructor
#endrregion
#region Methods
bool correct Checkpassword(Username, Password);
if (correct)myPerms = LoadPermissions(Username);
#endregion Methods
}
That gets you the concept. *HOW* you save and store these is up to you. Database, XML files, Registry, Each user on their own USB flash drive... Whatever... That's up to you and your application.
This post has been edited by tlhIn`toq: 13 October 2011 - 06:44 AM
Reason for edit:: typo
#3
Curtis Rutland
Re: C# windows forms
Posted 13 October 2011 - 06:43 AM
#4
tlhIn`toq
Re: C# windows forms
Posted 13 October 2011 - 06:45 AM
See FAQ #2 for form to form communication
FAQ (Frequently Asked Questions - Updated Sep 2011
FAQ (Frequently Asked Questions - Updated Sep 2011
Spoiler
- Q: My program doesn't work. I didn't show you any code or actually tell you the error message. How do I fix it?
SpoilerA: What have you tried so far? It is a requirment of this site that you at least make an effort to research (read the MSDN) and code a good faith effort for your own problem. Can you share your current code with us and better explain what issues or errors you are getting? Give us something to go on
- Q: How do I get Form 'A' to make a change or talk to Form 'B'
Spoiler
- Q: I'm trying to make a password/login form and...
A: Password handling tutorial
- Q: I'm making a client/server chat program and .....
A:Client/server chat tutorial
- Q: I do x and y happens which I didn't expect but I don't know how to figure out why. How do I debug and find my problem?
A:Spoiler - Debugging tools survival guide
- Video: Tips & Tricks to use Visual Studio to the fullest
- Q: I don't understand XML Serialization so I can save my information/class
A:
- Q:How do I get sound in my program?
A: Adding sound to your C# application
- Q: How do I use the serial port?
A: Serial port communication
- Q: How do I deploy my program / Make an installer?
A: C# application deployment project
Include the smallest .NET possible
- Q: How do I do compression or .zip files?
A:
- Q: How do I do multi-threading? Having a problem with cross-threading...
Spoiler
- Q: I am making a calculator as my school homework project and ...
A: Calculator tutorial
- Q: I've been struggling with this for days/weeks and I can't figure it out and my professor is worthless and can't teach. Can someone here explain it to me?
SpoilerA: If you are struggling with how to do this you need to talk to your professor. Let him/her know you are struggling at this early stage in class. Make your professor do the job (s)he gets paid to do by either helping you or finding you a tutor or giving you more exercises from earlier in the book. You are paying for this education. Be an active part in not allowing the teacher to brush you off and let you slip through the cracks. If the other 50 people in class aren't struggling then don't blame the teacher. If the other 50 people are struggling then you all need to go to the professor's superior and tell him/her. If the prof is really incompetent then you don't need to help him keep his cushy 100,000/year job. If the prof isn't incompetent then you need to study harder or consider buying another book on programming. You aren't required to ONLY use the text book provided for the class.
"How do you resolve your issues" survey.
Quote
Hi,
I'm currently learning C# in class at the moment and I'm a little bit stuck on what this question means.
[...]
show me where I can get help,
Your professor. That's where to start for a couple reasons:
1. They are getting paid to teach you. If they aren't teaching you this needs to come to their attention and that of their superiors.
2. You're the one paying them. Tens of thousands of dollars for your education. You need to learn to take every ounce of knowledge you can from these teachers and not sit passively back and try to learn it on the outside. If you were going to do that then you didn't need to take out all the student loans that are going to keep you in debt for the next 15 years.
3. You need to let the teacher do their job. If you are struggling here you don't want to hide it. You need them to be aware of position so they can give you the time and attention you need. Otherwise you will be a little lost on chapter 1. A little more on 2. Way behind by chapter 3. You have to get a good foundation now if you are to gain anything in the later lessons.
- Q: How do I save some information like preferences, settings or other data?
Spoiler
- Q: I want my textbox to offer suggestions as the user types.
A: Creating an auto-complete textbox
- Q: I want to write a program that does x, y and z with features for A, B, and C. {Notice there is no question in this question}
SpoilerA: That is a very good statement of intent. Go right ahead. You don't need to announce your intentions to us, nor get anyone's permission.
After you have made an effort to your own code (in good faith as described in the Welcome DIC email you got when you joined) and the forum rules that I'm sure you read before posting, and you have a QUESTION about this project... Please post the QUESTION here in this same thread. There is no need to start a new thread for this same topic.
- Q: I need to code to do x... Someone tell me the code for y...
SpoilerA: Your question is about to get bounced for begging for code anyway but...
So you're asking the volunteers here to write your code for you, to make it do everything in your wish list? Please read the rules. You seem to misunderstand what we do here. We help people learn to code. We help people with their projects. We help people better understand the errors and exceptions they are getting so they can fix their issues. We are not a free code writing service. If you have made an effort to code a specific feature, but are not getting the results you wanted then please post the relivant code for that feature along with the error messages or an explanation of what results you are seeing as compared to the results you were expecting, and we will try to guide you onto the right path.
- Q: What is the best programming language? What programming language should I learn?
SpoilerA: All of them. And none of them. You might as well be asking "What is the best kind of vehicle?" Because the answer for both questions is "It depends on your needs and what personally suites you the best." C, C++, C#, Objective-C, Cocoa, F#, Visual Basic, Python, JAVA... Are all good languages. They all have their pros and cons. They each have their strengths and weaknesses. Some have stronger footholds in some markets than others. Do you want to write for iPhone/iPad then you need Objective-C. Do you want to write for generic mobile phone use then you need JAVA. And so on. If you have no idea what area of programming you want to move to (Gaming, Financial, Windows, Macintosh, Cell phones) then nobody can advise you on a language. Personally, I would point you to C# because, like it or not, Microsoft owns the desktop computer market and C# will teach you good habits of design, OOP (Object Oriented Programming) design, inheritance and so on: Concepts that translate well to all other OOP languages.
- Q: How do I get my program to programmatically simulate a mouse click or button press?
A: Simulate mouse and keystroke (even to another application)
- Q: I'm not really sure what I want to do with my future? Do you guys like programming? I think I kinda like math and games and computers? What should I do or study?
A: Get experience while you find yourself
- Q: How do I use PInvoke and the Win32 api calls to get functions not available in .NET framework?
A: Using the Win32 API Tutorial
- Q: How can I have both a WinForms Windows app, and still have a Console window open?
SpoilerA: Make your new project a WinForms project. Then go back to project properties (Right-click on the project, select Properties). On the Application tab go to the dropdown that says "Windows Forms" and change it to "Console Application." You now have a WinForms application with a console window. I do this on occassion to see my Console.WriteLine statements when I am debugging. But don't consider this mixed mode operation a proper way to release an application for real-world use.
- Q: I want to do x, y, z with the HTML that comes out of a website ...
A: Check out the HTML Agility Pack. Yes its free.
- Q: How do I make a textbox just accept numbers and not letters?
A: Read this thread
- Q: What is the best programming language or O.S. I should be learning on?
SpoilerA: You are asking a very vague, generalize question about a broad topic.
You might as well be asking... What is the best kind of vehicle to buy? Or what is the best kind of plastic to make?
It all depends on your needs... Your area of business.
If you are interested in embedded devices like computers that control automobile engines it is still programming - but it is entirely different to writing a point of sale program meant to be used as a self-service kiosk like you see at Home Depot. And that is entirely different to writing a program that is meant to be used on a mobile platform.
You need to make a decision about what kind of programming, what area of interest, what industry you want to work in, before you can worry about the specifics of which language and OS and platform.
Which Language Should I Learn?
DIC Tutorials Section
Good thread on the topic
- Q:How do I become a better coder?
Read this, and practice a lot.
- Q:How do I browse for/open a file?
Read this tutorial
- Q:I'm trying to do x,y,z with a database {probably for the first time}...
A: Read this tutorial
Entire section of tutorials
- Q: Can someone explain bitwise operations?
A: Terrific explanation by CodingSup3rnatur@l-360. Be sure to +1 him for this thread.
- Q: Are there any resources for small C# projects a novice should be able to complete?
A:SpoilerThere is a novice projects thread here on DIC. But here's my advice whenever this comes up:
Look around. Anyone who can't find a dozen projects a day by just walking through life, is doing so with their eyes closed to the world.
- Do you like the weather? What about a program to get the various weather reports from different web sites? Or to integrate with one of the numerous USB weather station hobby kits on the market?
- Do you like the run? What about a program to log your runs, routes and progress?
- Do you like movies? What about a program to catalog all your DVD's and AVI's?
- Do you like photography? What about a program to browse your images, assign tags and GPS?
- Do you like shooting? What about a program to track your aim and improvement?
- What about every time you walk into a business and someone says "Oh, I'm sorry. The computers are slow/suck. This is going to take 10 minutes and 25 screens." SOunds like an opportunity to make and maybe even sell them a new program. So go home and make it first before you open your mouth. If you succeed in something great. If you fail, then you know where to study more and you haven't embarrassed yourself.
What about every time you walk into a business and someone says "Oh, I'm sorry. The computers are slow/suck. This is going to take 10 minutes and 25 screens." SOunds like an opportunity to make and maybe even sell them a new program. So go home and make it first before you open your mouth. If you succeed in something great. If you fail, then you know where to study more and you haven't embarrassed yourself.
Go to any of the on-line coder for hire sites. Read the new contract descriptions. DON'T BID ON THEM. Just read them. This will tell you what is requested by employers so you know where you have the potential to make money, and tell you where you should study. Then pick a project and build it. TRACK YOUR TIME. If you don't know how long it takes you to build a project then you won't be able to bid on contracts. If you bid $50 for 50 hours of work you're going to starve to death. Again, building projects just to learn the technology and learn your own speed and weaknesses is something we all do/did and you need to do too. Once you can build a project just for the learning experience, fast enough that you could have made a competitive bid... Now you can start considering actually bidding on new contracts that are in your skill set.
- Do you like the weather? What about a program to get the various weather reports from different web sites? Or to integrate with one of the numerous USB weather station hobby kits on the market?
- Q:How do I decide how much to charge for my application?
A: Read this
#5
modi123_1
Re: C# windows forms
Posted 13 October 2011 - 06:55 AM
It seems pretty straight forward - main screen is loading, and in the loading event opens a new login form. If the user passes let the main form continue loading, if they fail have the main form exit.
You'll have to clarify this, I don't know what you mean.
Quote
How do I enter multiple users for this login application.
You'll have to clarify this, I don't know what you mean.
Page 1 of 1
|
|
Query failed: connection to localhost:3312 failed (errno=111, msg=Connection refused).
|

New Topic/Question
Reply


MultiQuote







|