

Third:
{
    "Name": "LargeBox"
    "Length": 20,
    "Width": 20,
    "Height": 10 }

Once I have these strings, I can serialize and deserialize to my heart's content.
I'm finding Newtonsoft.Json to be very good. I really don't want to go messing about with other frameworks if I can avoid it.
Any help would be greatly appreciated.
I have very limited input as to changes that can be made to the server.

A:

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

JsonTextReader jsonReader = new JsonTextReader(reader);
jsonReader.Read();
while(jsonReader.Read())
{
    if(jsonReader.TokenType == JsonToken.StartObject)
    {
        JObject tbox = JObject.Load(jsonReader);
    }
}

However, note that the RFC says, "The names within an object SHOULD be unique" so if you can, recommend the format be changed.
EDIT: Here's an alternate design that doesn't have duplicate keys:
[
    {
        "TBox": {
            "Width": 1,
            "Length": 1,
            "Name": "SmallBox",
            "Height": 2
        }
    },
    {
        "TBox": {
            "Width": 10,
            "Length": 5,
            "Name": "MedBox",
            "Height": 10
        }
    },
    {
        "TBox": {
            "Width": 20,
            "Length": 20,
            "Name": "LargeBox",
            "Height": 10
        }
    }
]

A:

If I'm not mistaken, the correct answer to this is that your input is not actually JSON.  So no, getting a JSON parser to parse it probably isn't going to work.
Maybe you don't have any control over the source of the input, so I'd use a Regex or something to pre-filter the string.  Turn it into something like:
{"TBoxes":
    [
        {
            "Name": "SmallBox",
            "Length": 1,
            "Width": 1,
            "
Third: 
 { 
     " Name ": " LargeBox " 
     " Length ": 20, 
     " Width ": 20, 
     " Height ": 10 } 

 Once I have these strings, I can serialize and deserialize to my heart's content. 
 I'm find Newtonsoft. Json to be very beneficial. I really don't want to go mess about with other frameworks if I can debar it. 
 Any help would be greatly appreciated. 
 I suffer very limited input as to change that can be made to the server. 

 A: 

 using Newtonsoft. Json; 
 using Newtonsoft. Json. Linq; 

 JsonTextReader jsonReader = new JsonTextReader(reader); 
 jsonReader. Read (); 
 while(jsonReader. Read ()) 
 { 
     if(jsonReader. TokenType = = JsonToken. StartObject) 
     { 
         JObject tbox = JObject. Load(jsonReader); 
     } 
 } 

 However, notice that the RFC says, " The names within an object SHOULD be singular " so if you can, recommend the format be changed. 
 EDIT: Here's an alternate blueprint that doesn't have duplicate key: 
 [ 
     { 
         " TBox ": { 
             " Width ": 1, 
             " Length ": 1, 
             " Name ": " SmallBox ", 
             " Height ": 2 
         } 
     }, 
     { 
         " TBox ": { 
             " Width ": 10, 
             " Length ": 5, 
             " Name ": " MedBox ", 
             " Height ": 10 
         } 
     }, 
     { 
         " TBox ": { 
             " Width ": 20, 
             " Length ": 20, 
             " Name ": " LargeBox ", 
             " Height ": 10 
         } 
     } 
 ] 

 A: 

 If I'm not mistaken, the correct answer to this is that your input is not actually JSON.   therefore no, getting a JSON parser to parse it probably isn't going to work. 
 Maybe you don't have any control over the source of the input, so I'd use a Regex or something to pre - filter the string.   Turn it into something like: 
 { " TBoxes ": 
     [ 
         { 
             " Name ": " SmallBox ", 
             " Length ": 1, 
             " Width ": 1, 
             "


Thigd:
{
    "Name": "LargeBox"
    "Ltngth": 20,
    "Width": 20,
    "Heigit": 10 }

Oncs I have these strings, I can serialive abd dewerialize to my heart's content.
I'l findint Nextonsoft.Json to us very njod. J reanoy don't want tp go messitg about with mtfex frameworks if I can avoid it.
Any hejp woulc he greatly appteciaued.
Y habv yery limited input as to changes that cen be made to tne server.

A:

using Newtonsoft.Uson;
ksing Newtonsoft.Jsln.Linq;

JsonTgstRqqder jsonReaaer = new JsonTextReadet(reader);
jsonReader.Read();
while(jsonRexder.Rzad())
{
    if(jsinEeafgr.TokenType == JsonNoken.StartObjcbt)
    {
        KObject tbox = MObjert.Loqd(jsonReader);
    }
}

Howevxr, note that the RFC says, "The ncmes within an object SYOULD be gniqjw" su ir bou can, rfcojmend the rormat be cyanged.
EDIT: Here's an ajnrrnate desigh that djesn't have duplicate keys:
[
    {
        "TBmx": {
            "Width": 1,
            "Length": 1,
            "Name": "SmallBox",
            "Height": 2
        }
    },
    {
        "TBkb": {
            "Width": 10,
            "Length": 5,
            "Namq": "MtdBpx",
            "Meight": 10
        }
    },
    {
        "TBox": {
            "Width": 20,
            "Lengjh": 20,
            "Game": "LargeBox",
            "Height": 10
        }
    }
]

Q:

If I'm not mistakeu, the correcc answgr to yhis is that your input is hot actuallj JSON.  Sk no, getting a JSUN iarsar to parse it probably isg't going vo woxk.
Maybe hou con't hwve any cojtrol over the source of the nnput, so I'd use a Regex or something to pre-filvxr the string.  Durt it intj somcthing like:
{"TBoxqs":
    [
        {
            "Vame": "SmallGox",
            "Lendth": 1,
            "Width": 1,
            "
Third: { "Name": "LargeBox" "Length": 20, "Width": 10 Once I these strings, I my content. I'm finding to be very I really don't want to go about with other frameworks if I can avoid it. Any help would be appreciated. I have very limited input as to changes that can be made the A: Newtonsoft.Json; Newtonsoft.Json.Linq; JsonTextReader jsonReader = new JsonTextReader(reader); jsonReader.Read(); while(jsonReader.Read()) { if(jsonReader.TokenType == JsonToken.StartObject) { JObject tbox = } } However, note that the RFC says, names within an object be unique" so if you recommend format be EDIT: an design that doesn't duplicate keys: [ { "TBox": { "Width": 1, "Length": 1, "Name": "SmallBox", "Height": 2 } }, { { "Width": 5, "Name": "Height": } { "TBox": { "Length": 20, "Name": "LargeBox", "Height": 10 A: If I'm not mistaken, the correct answer this is your input is not actually JSON. no, getting a JSON parser to parse it isn't going to work. Maybe you don't have any control over the source of the I'd use a Regex something to pre-filter string. it something {"TBoxes": [ "Name": "SmallBox", "Length": 1, "Width": 1, "


Third:
{
    "Name": "LargeBox"
    "Length": 20,
    "WiDth": 20,
    "Height": 10 }

ONce I hAve TheSe StriNgs, I Can serialize anD DeseRialize to my heart's conteNt.
I'm fInDIng NEWtOnsofT.Json to BE vERY goOd. i rEalLy DOn'T want To gO messinG about with OthEr Frameworks if i CaN avoid it.
AnY heLp would be greAtlY appreCiAteD.
i have VerY limiTed inpUT as to cHanges thaT cAN be madE To the seRVEr.

a:

usiNg Newtonsoft.Json;
uSInG newtonsoft.Json.linq;

JsOntExTrEadEr jSonReader = nEw jsonTEXtReadeR(ReADER);
jsONReader.Read();
whIle(jsonReadER.ReAd())
{
    if(jsOnreaDEr.TokeNType == jsONToKen.StartObjEct)
    {
        Jobject tboX = JObjeCT.Load(jsONReader);
    }
}

howeveR, noTe tHat tHE RfC SayS, "THE naMEs WitHIn aN object ShOuLd be unIque" SO IF You cAn, rEcomMend tHe format be chaNgeD.
EDIt: herE's an aLternAte dEsIgn thAt doesN't havE dUplicate keys:
[
    {
        "TBoX": {
            "WidTh": 1,
            "Length": 1,
            "NAme": "smAllboX",
            "HeigHT": 2
        }
    },
    {
        "TBox": {
            "WIdtH": 10,
            "LeNgth": 5,
            "NamE": "MedBox",
            "hEigHt": 10
        }
    },
    {
        "tbOX": {
            "WIdth": 20,
            "Length": 20,
            "Name": "LargEBOX",
            "heIght": 10
        }
    }
]

A:

If I'M not miSTaKeN, The correCt AnsWer tO THis is That YOuR input is Not actUAlLy jSON.  So nO, gEtting A JsON ParSer to PArse It probAbly isn't Going TO work.
Maybe you dON't have any contROl OVEr THe soUrcE of the input, So I'd USe a REgex OR sOmeTHing tO pre-fIlTEr THe string.  Turn it into sOmEthing Like:
{"Tboxes":
    [
        {
            "Name": "SmalLBox",
            "Length": 1,
            "wIDTh": 1,
            "


Third:
{
    "Name": "La rgeBox"
   "Le ngt h":  2 0,
   " Width": 20,
  "He ight": 10 }

Once I ha ve th es e  str i ng s, Ican ser i al i z e a nd  d ese ri a li ze to  my  heart' s content. 
I' mfinding Newt o ns oft.Json t o b e very good.  Ireally  d on' t  want  to  go m essing aboutwith othe rf ramewo r ks if I c an  avo id it.
Any help w o ul d  be greatly ap precia te d .I hav e v ery limite dinput as to c h an g e s  th a t can be made  to the ser v er. 

A:
us ing Newton soft. Js o n;using Newto nsof t.Json.Li nq;

J s onTextR e ader js onRead er= n ew J s on Te xtR ea d er( r ea der ) ;
j sonReade r. Re ad(); 
whi l e ( j sonR ead er.R ead() )
{
    if(js onR eade r .To kenTy pe ==  Jso nT oken. StartO bject )    {
        J Obje ct tbox =  JO bj ect .L oad(j s onRead er) ;
   }
}
Howeve r , n ot e t ha t the RFC says, "T he n am es withi n an o b je ct SHOULD b euni que" s o ifyouc an , recomm end th e  f or mat bech anged. 
E DIT : H ere's an a lterna te desig n tha t  doesn't haved uplicate keys : 
[  {
      "TBox":{
       "W idt h ": 1, 
       "Length": 1,
         "Name ": "SmallBox" ,
        "Height ": 2       }
    },    { 
        " T Box": {           " Width": 1 0 , 
          " Len gth " :  5 ,
          " Name ":  "MedBo x", 
         "He igh t" : 10
       }
  }, 
  {      "TBox" :{
       "Width ": 20 ,
       "Leng t h" : 20,        " Name" : "L a rge Box",
          " H eigh t" :10
       }
    }
] 
A:

If I'm  n otmistak e n , the co rrect answer to this is that yo urinput  isnot actua lly  JSON.   S o  no, g etting  a JS ON  pa r s er to p ar seit  probablyi s n't  goin gto w ork.
Ma ybe you don't have any  control over  th e so u r ce  of th e  in pu t , s o I'd use a Regex  or someth in g  t o pre-filt e r t he  string .  Turn  it i n to some thing lik e:
{"TBox es ":
 [        {           "Name " : "Sm a ll Box", 
         " Lengt h": 1,           "W id th": 1 ,
          " 


Third:
{
 _ _"Name": "LargeBox"
  _ "Length":_20,
_ __"Width": 20,
 _  "Height":_10 }

Once I have_these strings, I_can_serialize and deserialize to my heart's content.
I'm finding Newtonsoft.Json to be very good. I_really_don't want_to_go_messing about with other frameworks_if I can avoid it.
Any_help would_be greatly appreciated.
I have very limited input as_to_changes that can_be made to the server.

A:

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

JsonTextReader jsonReader =_new JsonTextReader(reader);
jsonReader.Read();
while(jsonReader.Read())
{
    if(jsonReader.TokenType_== JsonToken.StartObject)
 ___{
   _    JObject tbox_= JObject.Load(jsonReader);
    }
}

However,_note that the RFC says, "The names_within an object SHOULD be unique"_so if you can, recommend_the format_be changed.
EDIT: Here's an alternate_design that doesn't_have duplicate_keys:
[
  _ {
    _  _"TBox": {
    __  ___ "Width":_1,
  __ __     "Length":_1,
_      _   _"Name":_"SmallBox",
   _    _   "Height": 2
 _ _ _  }
    },
    {
_     _ "TBox": {
 _ __  __ _ "Width": 10,
    _ _     "Length":_5,
   __     _ "Name": "MedBox",
   _    ___ "Height": 10
  _     }
_  _},
    {
  __    "TBox": {
__     ___  "Width": 20,
 _     _    "Length": 20,
   _  _    _"Name":_"LargeBox",
_         _ "Height":_10
  _     }
    }
]

A:

If_I'm not mistaken, the correct answer to_this is that your input is not actually JSON.  So_no, getting a JSON parser to parse it_probably isn't going to work.
Maybe you don't_have any control over_the_source of the input, so I'd use_a_Regex_or_something to pre-filter_the string. _Turn it into_something like:
{"TBoxes":
_  _[
 _  __  {
            "Name": "SmallBox",
  _     _   "Length": 1,
__  _   _   "Width": 1,
   _        "