views:

152

answers:

4

Hi All,

I made a very very simple small app to take screenshot of the desktop and send to network share. About 10 PC's would have this app installed.

My idea is, that there will be one dashboard in ASP.NET, which simply shows those screenshots on the webpage. So far, easy stuff. But, because I don't want to clog the network and send the screenshot every 1 minute, I would like to launch the .exe on the remote PC's by demand of ASP.NET user.

Unfortunately I haven't found any information (and I'm a complete ASP.NET n00b), how to launch remote executable IN the context of the remote PC (so I won't see screenshots of ASP server :) ) If there is no such possibility, please advise about other way to solve this.

+2  A: 

Update after clarification:

Take a look at the situation from another angle:

Why don't you run a web server on the clients that host an asp.net page that triggers the capture. Then you can, from your root server, simply sent http requests to the clients and fetch the image.

You can try http://CassiniDev.codeplex.com - it supports external IP and hostnames.

And you may also consider simply embedding the CassiniDev-lib (a very simple example is shown here - Using CassiniDev to host ASP.Net in your application, that way you can use the web server as the reciever and the forms app can do whatever it wants on the client.

I am confident in this approach as I designed cassinidev with this as one of the primary use cases.


From asp.net you cannot. It is only HTML/JavaScript once it gets to the browser.

ActiveX is a possibility but it is quite painful and dated and limited. And painful.

The new way to do something like this is to deploy a .net Forms application or WPF app via Click Once.

You can also write a WPF Browser Application but getting the kind of permissions you would need would entail setting the site as full trust.

Sky Sanders
you forgot painfull ;)
TomTom
I think we misunderstood. ASP Server is in the same network as "screenshoted" PC's.Maybe TCP connection from ASP Server to service running on those PC's? Sending a switch, and the service would make the screenshot and send it to predefined windows share?
ufoq
Ok, well that is an entirely different question. I will propose another solution.
Sky Sanders
+1  A: 

If a web page could launch an arbitrary .exe file on your machine, that would be a security disaster.

However, since these are your PCs, you can require them to install an ActiveX control of some kind that you could then embed in your ASP.NET page.

John Saunders
yeah. funny how many people never think one second about waht they really ask for (here: random html page starts random program on local computer without user interaction - think about what this can mean if abused by bad people).
TomTom
A: 

As others have said, there is really no way for ASP.Net to call out to the apps, but reversing the control flow should work OK...

I suppose you could have the grabber application running all the time on the users desktop, but have it make a call to a web service / file served by the server that contains an instruction for that instance of the app to grab a screenshot.

Something like...

App : Do I have to do anything? (GET /workinstruction.aspx)
Server : no. (server decides whether to request work, and return the result in (workinstruction.aspx)
App : (waits 1 minute)
App : Do I have to do anything?
Server : yes.
App : (takes screenshot and submits)
App : (waits 1 minute)
App : Do I have to do anything?

etc...

ZombieSheep
A: 

Thank you all for answering, those were interesting approaches to the subject.

Yet due to many factors I ended up with following solution:

  1. Pseudo-service (Windows Forms with tray icon and hidden form) application on client PC's. It is serving as TCP server.

  2. ASP.Net web app on the server, with TCP client function.

On request of the web user, web app is sending preformatted TCP 'activation' string to the chosen PC. Tray app is making a screenshot and sending it to predefined SMB share, available for web app to display.

Thanks again!

ufoq