将字符串从ftp转换为json

时间:2014-11-02 20:59:10

标签: c# .net json

我有来自Ftp服务器的文件,如下所示:

var a = "some text"
var b= new Array(2,6,9,11,11,13,13,12,10,6,4,3)
var c=890
var d= 3
var e=new Array(d)
e[0]=new Array(13300,95000,2350000,14000000)
e[1]=new Array(13300,95000,2350000,14000000)
e[2]=new Array(11100,80000,1950000,11500000)

var f= new Array(d)
f[0]=new Array("x","y",140,1,"z",2,null,null,130,null,7,0,1,1000,null)
f[0][6]=new Array("String 1","String 2")
f[0][7]=new Array(1,1)
f[0][9]=new Array(7350,7350)
f[0][16]=1
f[1]=new Array("x","y",140,1,"z",2,null,null,130,null,7,0,1,1000,null)
f[1][6]=new Array("String 1","String 2")
f[1][7]=new Array(1,1)
f[1][9]=new Array(7350,7350)
f[1][16]=1
f[2]=new Array("x","y",140,1,"z",2,null,null,130,null,7,0,1,1000,null)
f[2][6]=new Array("String 1","String 2")
f[2][7]=new Array(2,2)
f[2][9]=new Array(5880,6370)
f[2][16]=1
var g="foo"
var h= new Array(3)
var i= new Array(3)
h[0] = "k,l ,m ,n ,o ,p ,q"
i[0] = "r,s,t,u,v,w"

它想将它转换为json,以便我可以在我的应用程序(MVC)中传递它

之类的东西
{
    "MyData"
        "a" : "some text"
        "b" : [2,6,9,11,11,13,13,12,10,6,4,3]
        "c" : 890
        "d" : 3
        "e" : ["13300,95000,2350000,14000000","...","..."]
        ....
        ....
}

无论如何我能做到这一点(使用json.net或其他图书馆)? Thx提前

0 个答案:

没有答案