How to serialize/deserialze in json an object that contains int[]?

I have the following class I want to serialize/deserialize with JSON.net:

class KeyStrokes{
    long[] timestamps;
    int[] keycodes;
    int[] updown;
}

Do you know if it is possible to serialize/deserialize objects of this class to JSON? How about BSON?

Thanks so much for your help.

Answers


Do you know if it is possible to serialize/deserialize objects of this class to JSON?

Yes, of course it's possible.


There are some threads with decent answers on SO, already:

How to serialize and deserialize a C# array of integers?

Json Serialization in C#


Get JSON.NET: http://james.newtonking.com/json

Also, please make sure to invest more time before asking questions, else it your questions will be immediately put on hold.


Need Your Help

Transform XML into HTML using XSLT

c# html xml xslt asp.net-3.5

I saw several questions related to XML, XSLT and HTML on stackoverflow, but I beleive my question is a little different. Here is what I need:

How do you generate random strings in C++?

c++ string random

I am looking for methods to generate random strings in C++.Here is my code: