I’m trying to write a small app which can be used in order to log off Citrix Sessions.
Citrix Sessions can be logged off via cmd or a batch file using this method:
@echo off
echo "Enter username"
set /p UserName=
echo 001
query user %username% /server:server1
echo 002
query user %username% /server:server2
echo 003
query user %username% /server:server3
etc etc
This would give me the following results:
001
No User exists for Charlie
002
No User exists for Charlie
003
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
Charlie ica-tcp#32 6 Active . 29.01.2010 13:23
So basically what I want to do is to select each listbox item that matches one of the hits from the cmd command. Probably the servername that gives a different result than “No User exists for”
How can something like this be achieved?
You can loop through the listbox items and check if the current item name is equal to your string, if true set the SelectedIndex to the current loop var(probably i).
Hope I understood your question