vuyiswam
October 27th, 2008, 08:27 AM
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.
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
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");
}
Thanks
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.
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
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");
}
Thanks