0

I am getting one Javascript Array from HttpRequest as below :

"var time[0] = '2019-11-23 20:11:12'; var plate[0] = 'DK01A11511'; var path[0] = '/LPR/2019112404111200.jpg'; var region[0] = ''; var direction[0] = '28'; 
    var roi_id[0] = '-92'; var plate_left[0] = '0'; var plate_top[0] = '0'; var plate_right[0] = '0'; var plate_bottom[0] = '0'; 
var time[1] = '2019-11-23 20:11:12'; var plate[1] = 'BR01AN1511'; var path[1] = '/LPR/2019112404111201.jpg'; var region[1] = 'o.0'; var direction[1] = '0'; 
    var roi_id[1] = '0'; var plate_left[1] = '29486'; var plate_top[1] = '11887'; var plate_right[1] = '48'; var plate_bottom[1] = '12334'; 
var time[2] = '2019-11-23 20:11:55'; var plate[2] = 'BR01DD0621'; var path[2] = '/LPR/2019112404115500.jpg'; var region[2] = 'o.0';  var direction[2] = '0'; 
    var roi_id[2] = '46'; var plate_left[2] = '12846'; var plate_top[2] = '11776'; var plate_right[2] = '28531'; var plate_bottom[2] = '12846'; 
var time[3] = '2019-11-23 20:12:03'; var plate[3] = 'BR01PG5254'; var path[3] = '/LPR/2019112404120300.jpg'; var region[3] = ''; var direction[3] = '0'; 
    var roi_id[3] = '0'; var plate_left[3] = '0'; var plate_top[3] = '0'; var plate_right[3] = '0'; var plate_bottom[3] = '0'; 
var time[4] = '2019-11-23 20:12:11'; var plate[4] = 'BR01PB0909'; var path[4] = '/LPR/2019112404121100.jpg'; var region[4] = '���8j��'; var direction[4] = '145'; 
    var roi_id[4] = '84'; var plate_left[4] = '27192'; var plate_top[4] = '-18699'; var plate_right[4] = '0'; var plate_bottom[4] = '0'; 
var time[5] = '2019-11-23 20:12:17'; var plate[5] = 'BR01PK9977'; var path[5] = '/LPR/2019112404121700.jpg'; var region[5] = '����Pi��'; var direction[5] = '145'; 
    var roi_id[5] = '84'; var plate_left[5] = '27192'; var plate_top[5] = '-18699'; var plate_right[5] = '0'; var plate_bottom[5] = '0'; 
var time[6] = '2019-11-23 20:12:31'; var plate[6] = 'BR01PJ0443'; var path[6] = '/LPR/2019112404123100.jpg'; var region[6] = 'r�������(���(����������'; var direction[6] = '216'; 
    var roi_id[6] = '-118'; var plate_left[6] = '19008'; var plate_top[6] = '-18782'; var plate_right[6] = '0'; var plate_bottom[6] = '0'; 
var time[7] = '2019-11-23 20:12:32'; var plate[7] = 'BR01PJ0443'; var path[7] = '/LPR/2019112404123200.jpg'; var region[7] = ''; var direction[7] = '136'; 
    var roi_id[7] = '-119'; var plate_left[7] = '-13812'; var plate_top[7] = '-18709'; var plate_right[7] = '-22552'; var plate_bottom[7] = '-16732'; 
var time[8] = '2019-11-23 20:12:36'; var plate[8] = 'BR01PH9530'; var path[8] = '/LPR/2019112404123600.jpg'; var region[8] = ''; var direction[8] = '160'; 
    var roi_id[8] = '-77'; var plate_left[8] = '-19628'; var plate_top[8] = '-18698'; var plate_right[8] = '-19628'; var plate_bottom[8] = '-18698'; 
var time[9] = '2019-11-23 20:13:36'; var plate[9] = 'BR0BB6799'; var path[9] = '/LPR/2019112404133600.jpg'; var region[9] = 'd���'; var direction[9] = '96'; 
    var roi_id[9] = '-85'; var plate_left[9] = '-20966'; var plate_top[9] = '-16732'; var plate_right[9] = '21420'; var plate_bottom[9] = '1';"

Now I am trying to use this in C# by directly assign to Object but didn't got any success.

Can you tell me how to deserialize and use this? I want to use time, plate and path. I have tried to assign this string to Object and Var but nothing is working. Even array size is not fix so picking value from string using substring is also not working.

Thank you.

Yousha Aleayoub
  • 4,532
  • 4
  • 53
  • 64
  • 1
    Does this answer your question? [Deserializing a JSON into a JavaScript object](https://stackoverflow.com/questions/6487167/deserializing-a-json-into-a-javascript-object) – jazb Nov 26 '19 at 08:14
  • 5
    Wait. hol up... what *sane* web request would return this. You will have to parse this your self, *why you have to* is another question entirely – TheGeneral Nov 26 '19 at 08:16
  • I agrre with TheGeneral, is not possible to deserialize this kind of string, you must create yourself a code to parse this string (split) – Digital3D Nov 26 '19 at 08:17

0 Answers0