0

I have to write a Programm that saves data from a RS232 connection (done) and writes this data into a form on a Webpage (TODO). The user has this webpage already opened on his Display. How can I access this already opened Webpage and fill out the Form on it?

After searching for a while I found the Webbrowser Class, but it didnt look like i could do would i need it to do...

I hope you can help me!

Thanks in advance!

atzaka
  • 3
  • 6
  • So there is a server that sends a webpage to the user's computer, and there is an RS232 device plugged into the user's computer, and there is a program that has read data from the device and saved it as a file, and you now have to write a program that reads this file and enters the data inside the file into the webpage? – Caius Jard Oct 22 '20 at 08:05
  • I thinkk websockets could be a possible solution. For C#, see SignalR. Of course, it's hard to tell if this will work in your case, as there is nearly no information on the techstack you are using and the client's requirements (supported browsers) – Pac0 Oct 22 '20 at 08:14
  • @Caius Jard Yes, but the Program that reads the data from the RS232 is programmed by me and will be extended to write on to the Webpage. But the important point is, the Webpage is already opened on the users PC so my Programm needs to find that opened Window and doesnt create a new one. – atzaka Oct 22 '20 at 08:14
  • And it is always the same webpage? I ask because those form fields on the page will probably POST to the same place on the server so the simplest solution is to skip the webpage part and POST the data directly. If, on th chance that there is some unique thing on the page, you could GET the page first, extract the unique thing, and POST the data. Otherwise, the next simplest solution you're looking at is just to SendKeys the data to the open browser window i.e. pretend to be a keyboard and press `H` `E` `L` `L` `O` `TAB` `W` `O` `R` `L` `D` `RETURN` – Caius Jard Oct 22 '20 at 08:21
  • Well the Problem is, that the users should have the opportunity to check the page again after the data is written in the form to make (if needed) changes... I dont like the way I should do this and I think an API or something would be way more easy but sadly I have to do what im told to :D – atzaka Oct 22 '20 at 08:27
  • The idea with the SendKeys came in my mind too... but is there a way to prevent the user to switch out of the Webpage? otherwise there is a lot of errorpotential isnt it? – atzaka Oct 22 '20 at 08:28

0 Answers0