• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

Single Instance

I have a winform app in vb.net (studio 2008) and I have defined the app as a single instance application. I need to get access to the StartupNextInstance event so this is important because when it launches for the second time I need to just take action in the running instance.  This all works fine and dandy until you publish this on a terminal server. I need for each user to have the same functionality but only within their session.. so what I need is for my appliction to be a single instance within a session application.  Is there some way to accomplish this?

SO the appliction launches and does stuff... then it gets called again (from another third party app) and depending on some paramaters passed to it if it already exists it will just change the screen (no relaunch, etc).  This works FINE - but not on a terminal server because of the single instnace flag... help.
0
NTGuru705
Asked:
NTGuru705
  • 3
  • 3
  • 2
2 Solutions
 
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
Hi,
for this you can use User Credential of user running application
Thanks
0
 
NTGuru705Author Commented:
Not sure I follow you... can you clarify?
0
 
CodeCruiserCommented:
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
follow the following link and store the user name in the class object, you may use list of users, if the new user comes then allow new instance ortherwise use old object
http://www.codeproject.com/KB/cs/getusername.aspx 
0
 
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:

You can get the current identity of the user under which the current thread is running (not necessarily the logged in user) using WindowsIdentity.GetCurrent().  Alternatively you can get the logged in user name via the Environment.UserName property.  It is not guaranteed to be the user running the current process however.

0
 
NTGuru705Author Commented:
Looks like I may have mis understood.. it may actually be another issue here that I am dealing with.. it may be supported just fine in terminal session.
0
 
NTGuru705Author Commented:
It is supported fine on terminal server.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now