JSON array to C# List -


how can deserialize simple json string list in c# ?

["on4thnu7","n71yzyvkd","cvfspm2w","10kqotv"] 

such that,

list<string> mystrings = [the content of json above] 

i using datacontractjsonserializer found in system.runtime.serialization.json, , don't need external library.

edit: javascriptserializer found in system.web.script.serialization acceptable.

just this,

  string json = "[\"on4thnu7\",\"n71yzyvkd\",\"cvfspm2w\",\"10kqotv\"]";   var result = new javascriptserializer().deserialize<list<string>>(json); 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -