DO wwDotnetBridge

*** Create instance of wwDotnetBridge - this example requires .NET 4.0
LOCAL loBridge as wwDotNetBridge
loBridge = CreateObject("wwDotNetBridge","V4")  && .NET 4.0


*** Load a GAC assembly (full .NET type name required)
loBridge.LoadAssembly("System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")

*** Load a private assembly from disk
* ? loBridge.LoadAssemblY("c:\apps\myapp\myappassembly.dll")

*** Create an instance of the JavaScript Serializer
loSer = loBridge.CreateInstance("System.Web.Script.Serialization.JavaScriptSerializer")

lcValue = "Hello World" + CHR(13) + CHR(10) + "Here's what I've got!"

*** Serialize string to JSON
lcJson = loSer.Serialize(lcValue)
*lcJson = loBridge.InvokeMethod(loSer,"Serialize",lcValue)
? lcJson

*** Create a .NET Type object for string
loType = loBridge.GetType("x")

*** Deserialize with the .NET type provided
? loSer.Deserialize(lcJson,loType)
? loBridge.InvokeMethod(loSer,"Deserialize",lcJson,loType)