I am trying to achieve reading variables from a Java applet out of process from my C# program. Apart from reading memory addresses, is there any way I can obtain values of variables from a java applet? This java applet will be running inside a browser. If it is not possible to do this from C#, would it be possible to do it from a different java applet?
Thanks.
If you can change the code of the applet, you can have it host an RMI server, which is the subject of this excercise. I’m not an expert of the subject though – I assume it may be subject to various security restrictions.
If you can’t change the applet, but you can change the HTML page showing the applet, there are two ways to access information from the applet.
The first way is scripting the applet with Javascript like @Margus suggests (all public methods of the applet object are exposed via the applet’s DOM object).
The other way is putting an applet of your own in the page, and use
getAppletContext()to obtain a reference to the other applet. The main benefit of doing it this way is that you can access non-public information from the third-party applet via reflection, and publish it with an RMI server (as above).