0

I want to know what is the best method to send data from website to a windows application. I want to make a video encoder and it'll work like this: Customer will upload videos and when uploading progressed finished website send a signal and data (like: Video resolution and bit-rate) to a windows application to start encoding videos. I want to do it with VB.Net or C#.net.

ekad
  • 14,436
  • 26
  • 44
  • 46
MaSmart
  • 3
  • 3
  • Possible duplicate: http://stackoverflow.com/questions/7097071/invoke-or-call-c-sharp-console-app-from-c-sharp-web-service – Kevin DeVoe Aug 19 '13 at 20:11
  • Are you using ASP.NET? If so, all your code-behind will run on the server. You can then use an IPC mechanism to send data back-and-forth between the video encoder and the application that hosts your Website (IIS?). – Arian Motamedi Aug 19 '13 at 20:29
  • @PoweredByOrange I'm using ASP.NET and also, Yes, website hosts on IIS. But Windows application and website are not in the same machine. – MaSmart Aug 19 '13 at 20:38
  • 1
    @MaSmart Does it have to be a windows application? It would be so much easier to have the video converter in your ASP project. – Steven Liekens Aug 19 '13 at 20:41
  • @MaSmart As Steven Liekens suggested, it would make sense to put the encoder in your ASP.NET project. If they really need to be different applications, then you can use WCF to create a connection between the two processes. – Arian Motamedi Aug 19 '13 at 20:50

1 Answers1

0

Have your .NET program listen for HTTP requests from the outside world. When a request is received, that's your signal to start encoding. You can get data (bitrate, ...) from the query portion of the request.

Example workflow of a pure HTML/.NET implementation:

  1. Create a simple HTML form that POSTs its data to the address where the encoder is hosted.
  2. In your .NET program, create an instance of HttpListener (see MSDN) to act as a simple web server.
  3. When HttpListener receives a request, send back a simple "thank you" page (or whatever) and start encoding.
  4. Somehow notify the user when encoding has finished (email?).
Steven Liekens
  • 13,266
  • 8
  • 59
  • 85
  • "When HttpListener receives a request, send back a simple "thank you" page (or whatever) and start encoding." The request is a "OPTIONS" request, what now? – ikwillem Jul 14 '19 at 19:04