How can I JSON encode an array in VB.NET?

Dim serializer as New JavaScriptSerializer()
Dim arrayJson as String = serializer.Serialize(myArray)

There are four ways:

  1. Roll your own with a Custom formatter
  2. Json.NET.
  3. JavaScriptSerializer
  4. DataContractJsonSerializer

I recently blogged about how to do Json Serialization.


You are going to want to look into JSON serialization. Here is a good article that explains one way to do it (unfortunately the examples are in C#) but with more information we can probalby steer you towards the right toolkit.