1

Hi there I'm trying to store settings in a database so that users of my web application can be allowed to take their settings with them and have the same window setup on multiple machines. But I will also be using cookies to allow setting of a work safe image free experience as well.(No this is not for explicit material.)

So far my thought on it is something like this

news{x:0,y:0,height:120,Width:120,order:1};
market{system:F-9QTZ,Distance:Region,category:Ships,subcat:Massive,selection:TestShip,x:120,y:0,width:120,height:120}

Which is somewhat i think like JSON by my own style.

Does anyone have any thought on the best way to parse this using C# or a different thought on a more effective way to do this?

tereško
  • 58,060
  • 25
  • 98
  • 150

2 Answers2

1

Why not store it as actual JSON and then parsing would be easy. Just use one of the many .NET JSON libraries available for parsing and map them against properties of the related classes for your GUI?

Jesse Carter
  • 20,062
  • 7
  • 64
  • 101
  • Thanks for the suggestion I have not have much exposure to JSON that is why I did not attempt at it and see if i could make my own custom solution. – Melvin Bradley Jan 14 '13 at 22:05
0

Take a look at this question, particularly looking at the JSONSerialiser part of it.

Community
  • 1
  • 1
Stephen Hewlett
  • 2,415
  • 1
  • 18
  • 31