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

CrishRank #1,487 · 1.1K reputationPosted Jun 6, 2010, 11:29 PM EDT
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted Jun 6, 2010, 11:48 PM EDT
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.
Kapil Deo MalhotraRank #2,120 · 672 reputationPosted Jun 7, 2010, 6:18 AM EDT
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
Marimuthu ArigovindasamyRank #5,893 · 283 reputationPosted Jun 7, 2010, 4:32 PM EDT
//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());
}
Marimuthu ArigovindasamyRank #5,893 · 283 reputationPosted Jun 14, 2010, 9:22 PM EDT