0

I have 2 separate system, My first system will return a java script like bellow

var st=[]; var at=[]; var bt=[]; var ht=[]; ht[0]=['015',5,'33087443','23','50','22','x']; ht[1]=['018',5,'45648783','53','10','20','z']; 

My second system will grab all this java script to process it and store into database , is that any parser or any way to allow me to separate all this different var st , at, bt, ht into a list or dictionary ?

my expected outcome is list/dictionary : - (so that it easily for me to access the data)

List/Dictionary st = //All that array value List/Dictionary at = //All that array value List/Dictionary ht = //All that array value 
2
  • You better use some well-known format as an intermediate protocol between your programs. Like JSON or XML
    – zerkms
    CommentedJul 16, 2013 at 4:48
  • Looks like you need a Javascript interpreter with .NET bindings, that supports inspecting JS objects from C# code.
    – Cameron
    CommentedJul 16, 2013 at 4:52

1 Answer 1

1

If you can, I would recommend altering your system to return JSON data, not javascript as it is more easily consumed by .Net. Using Javascript will require that you either use the outdated MSScript control or JInt. Speaking from experience, neither of which are very pleasant to work with.

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.