Skip to content

Instantly share code, notes, and snippets.

@patelc75
Created June 15, 2013 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patelc75/5786534 to your computer and use it in GitHub Desktop.
Save patelc75/5786534 to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Script.Serialization;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
JavaScriptSerializer ser = new JavaScriptSerializer();
Test t = new Test();
t.content = System.IO.File.ReadAllbytes("c:\\test.bin");
string s = ser.Serialize(t);
}
}
class Test
{
public byte[] content;
public int valueint = 6546735;
public string valuestr = "test string";
}
}
{"content":[1,1,2,3,4,5,5,5,5,5,7,7,119,119,119,119,119,116,83,120,115,101,50,86,53,101,54,83,83,68,82,55,54,131,102,53,37,99,69,52,37,35,69,50,70,50,84,54,36,50,101,67,38,84,50,99,37,67,101,50,67,38,66,54,50],"valueint":6546735,"valuestr":"test string"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment