Good Afternoon All
In VB.NET i used to have a Module. I need to Call the Main Form when the login is successfully. So this is what i deed in C# so Far in a Class, Can someone Help me on this in C#. Becaues C# does not have Modules.
Code:using System; using System.Collections.Generic; using System.Text; namespace SystemAdmin { class Startup { public void Main() { bool loggedIn; frmLogin frmlogin = new frmLogin(); loggedIn = (frmlogin.ShowDialog() == DialogResult.OK); if (loggedIn) { Application.Run(new frmmain()); } } } }
And my Login Screen Login button is like this
ThanksCode:String strusername = txtusername.Text; String Password = txtpassword.Text; int bl ; bl = obj.Check_Login(strusername, strPassword); if (bl == 1) { Me.DialogResult = Windows.Forms.DialogResult.OK; } else { MessageBox.Show("Invalid Login"); }




Reply With Quote