Remote Desktop help vb.net 2008

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hi All

I have a windows forms app running on Windows 2003 Server which is used
locally and also by Remote Desktop users

Is there anyway in vb.net to find out how many Remote Desktop users are
registered on the Server

The customer has agreed that the initial app cost covers 5 Remote Desktop
users and if they add more users they pay a fee per extra user

I thus need to know in code if any new Remote Desktop users have been added
(or the total number has changed)


Regards
Steve
 
Hi Steve,

I think detecting new added Remote Desktop users does not make sense to me.
The reason is there can be Remote Desktop users who connects to the server
but do not start the target application, right? If we want to limit this
application's remote users, we can check the process count with different
session ID in the application's startup. I use the following codes to
achieve this objective,

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim pA As Process() =
Process.GetProcessesByName("WindowsApplicationVB")
Dim q = (From p In pA _
Select p.SessionId Distinct).Count
If (q > 6) Then
MessageBox.Show("Remote User has exceed the limitation!")
End If
End Sub

The above codes find all processes of "WindowsApplicationVB" and uses
LINQ-Object to query the count of different session ID. If the retrieved
number is bigger than 6, we can judge that the remote users+local users are
bigger than 6.

Does this resolve your question? If you have any future questions or
concerns, please feel free to let me know! Have a nice day!


Best regards,
Colbert Zhou
Microsoft Newsgroup Support Team
 
Back
Top