mardi 24 février 2015

How to Communicate between a winforms app and a webform page?

I just want to start by saying that while researching this I read something like this could be bad programming, but let me explain my situation first and maybe it's not that bad. The coding is done in C#.


I have a winforms app that connects to a few ipcameras and creates the viewing stream. It saves each new frame to a filestream. The webform has a main page that lets you select which of the cameras you'd like to view, then starts grabbing the new frames from the filestream and allows you to view the cameras.


Right now, in the winforms app, I have a "play" button that creates the viewing stream, and the webform can only view that camera if the video is "playing" in the winforms app. So my idea was to have the winforms app be running all the time and have each camera playing, then you could select any camera from the webform and be able to view it. That works fine, but now I have to change it. I have to make it so when the camera is selected in the webform to then make the video start "playing" in the winforms app.


So I need some sort of flag that tells the winforms app that that camera is being viewed, and once that camera is not being viewed anymore to tell the winforms app it can stop "playing" that camera. The problem is that I have no idea how to do this. I looked at this question:


How to communicate between ASPX and WinForms


but I didn't really understand the answer. Can anyone help me?


I hope this makes sense; if not please ask me and I'll try to explain. I am an Electrical Engineering student and am not much of a programmer.


Aucun commentaire:

Enregistrer un commentaire