Remote Control App

C

Cralis

Hello!
Started a new job as a novice c# developer. My line manager has asked
our team to do a test on an application the company has already made.
Basically, he wants a small tool that can control the app, remotly.
Basically, the app needs to send a command to the app, and theapp will
open certain screens.
He mentioned the use of some sockets. The app will be in another city,
so we need to connect to it over a WAN.
I was thinking of maybe sending a command string over the WAN to the
app. Something like

%TebUsername=username%TedPassword=password%CbtnLogin%CbtnOpenaccount
%CClose%CExit

This string could then be sent to the app, and it would basically be 6
commands, separated by %. The first being "TebUsername=username"
which would mean Type (T) in ebUsername the string "username". Then
Type into ebPassword the world "password". Then Click btnLogin.

Not sure if that's clear.

If itis, would this be a method to use to try control the application
remotly?

There would be a listening socket on the app that basically handles
the commands. Maybe then put the commands into a List<String> and then
passes that last from form to form as things happen.

Would this be a good method, and possible?
 
P

Peter Duniho

[...]
%TebUsername=username%TedPassword=password%CbtnLogin%CbtnOpenaccount
%CClose%CExit

This string could then be sent to the app, and it would basically be 6
commands, separated by %. The first being "TebUsername=username"
which would mean Type (T) in ebUsername the string "username". Then
Type into ebPassword the world "password". Then Click btnLogin.

Not sure if that's clear.

If itis, would this be a method to use to try control the application
remotly?

Sure, other than the fact that you sort of glossed over the "hard" part:
sending the string. :)

I haven't used it, but others recommend using either .NET Remoting, part
of earlier versions of .NET, or the WCF ("Windows Communication
Foundation", I think it stands for) that is part of .NET 3.0. It may be
tht using those technologies, you won't have to mess with the string at
all, and that there's some better more-abstract way to represent commands.
There would be a listening socket on the app that basically handles
the commands. Maybe then put the commands into a List<String> and then
passes that last from form to form as things happen.

If you think sending string command is fine, then using the Socket class
is probably fine too. It's nice and simple, with only a few traps for new
users, and it's relatively easy to send strings with it. You'll have to
implement everything manually, but personally I haven't found basic
network i/o to be all that complicated to begin with. If you're not
moving complicated data structures around, you probably don't need all
that Remoting or WCF offer.
Would this be a good method, and possible?

"Good" depends on a variety of things, and mostly that's for you to
decide. Possible? Definitely yes.

Pete
 
C

Cralis

Thanks Pete.

Looks like Remote objects would be the way to go, but I am now
battling to find a simple example to build from. Something like a form
with a button, that just shows a messagebox saying 'clicked' or
something. And how I can click that button remoting from another
controlling app.

Any help available on a simple example?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top