Hello
I am developing a window application. I am new to c# so my problem is i want to display popup messages on my form when a new user logged into the system with valid user id and password and at that time newly logged in user should get some notification from the already logged in users.
So Please help me in this regard
Thank you
Marimuthu ArigovindasamyPosted Jun 15, 2010, 1:22 AM
Marimuthu ArigovindasamyPosted Jun 7, 2010, 8:32 PM
//Get the current process name
Process currentProcess = Process.GetCurrentProcess();
string currProcessName = currentProcess.ProcessName;
// Get all the instances of current application
Process[] prevAppInstance = Process.GetProcessesByName(currProcessName);
if (prevAppInstance.Length > 1)
{
//Show error msg if the same exe is already running
MessageBox.Show("The application is already runninig in this machine");
return;
}
else
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
Kapil Deo MalhotraPosted Jun 7, 2010, 10:18 AM
As you mentioned it is Windows application (desktop) not web right? Can you explain what you mean by when new user logged in it should notify with the user already loged in. How two users will execute the Windows application from single desktop, is that application is sharing some thing? Can you provide me the use case (flow), i will try to help you for sure?
You can display the popup basically it will be form with no border and you can write ESC key code and it will be close down or after few seconds we can close that form. And in that form we can display the user information.
But i am not sure what you mean by two different user using same application.
-Kapil
Abhimanyu K VatsaPosted Jun 7, 2010, 3:48 AM
why u are not using ASP.net default login, create new user, and user identification like controls in your project. i think it will solve ur all problems.
CrishPosted Jun 7, 2010, 3:29 AM