In need of some advice controlling a C# winforms application via a asp.net website -


i'm working on little project basic youtube remote control, whereby have helper app running on pc, , can send commands website accessed via web browser on phone.

reading through threads on other sites people trying same thing i've realized not concept people comfortable with, struggling think of way beyond writing native app phone , having communicate helper application internally via wlan(would happy this, don't have cash spring new mac develop iphone).

if stick website/winforms model, there way in such way (most) people comfortable running?

the ideas had far were:

a) build web server helper app(though not sure of logistics of having host asp.net site)

b) host site externally, , have helper app periodically poll database/webservice on server receive commands (sketchy , imagine resource heavy)

sorry wall of text, i'm capable of running idea , building it, i'm not sure possible , considered 'best' way this.

any advice appreciated.

cheers

edit thanks, clear, when uncomfortable, mean - ok having website being able send potentially command computer? seems problem raised in other discussions topic. i'm not trying malicious, said, seemed concern.

if controlled environment can open port on firewall incoming communication, can have web app make wcf call windows client through users firewall.

if not (which suspect), may better off polling web service. every few seconds , whatever you're checking in web service call (a database?) make sure it's optimized. perhaps have return status int/enum or light weight instruct client on next call make (0 = no update, 1 = command1, 2 = command2, etc).

as how polling, like:

int seconds = 4; system.timers.timer _clienttimer = new system.timers.timer(seconds * 1000); _clienttimer.autoreset = false; _clienttimer.elapsed += clienttimer_elapsed; _clienttimer.start();  private void clienttimer_elapsed(object sender, elapsedeventargs e) {     try     {         // connect web service, status, if status != 0 something...     }         {         _clienttimer.start();     } } 

note: auto-reset = false means each time elapsed event fires, timer stopped. in approach i've taken, let timer stop client can process web service results , start timer once again after it's done. prevent multiple requests piling if connection real slow.

that's can think of :)


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -