1

I have a C# application that's launched from beanshell code. Is it possible for this C# application have access to objects contained in the beanshell code?

For example, in my beanshell code, I have an object A that contains a bunch of values that I'd like to use in my C# application later. How do I retrieve those values from C#?

Tim Lloyd
  • 37,954
  • 10
  • 100
  • 130
neo
  • 2,461
  • 9
  • 42
  • 67
  • Can't you just pass the values into you C# application as parameters? – stevehipwell Aug 18 '11 at 14:27
  • there are lots of values that i need to access, some are complex object data types. I guess i can covert everything into strings and pass them as parameters but that would be very ugly. – neo Aug 18 '11 at 20:06
  • You could use a data storage as intermediary between passing data between beanshell and the C# app to avoid passing alot of parameters. Data storage as in CSV/XML/INI/config file, or actual database, or Windows registry, etc. Frankly if there was something like Beanshell for.NET, you might have better luck here for passing objects. – David Feb 13 '12 at 23:07

1 Answers1

1

Try (de)serializing the objects with JSON.

echristopherson
  • 6,974
  • 2
  • 21
  • 31