mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
611 B
C#
27 lines
611 B
C#
6 years ago
|
//AssemblyReference -Name System.Web.Extensions.dll
|
||
|
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Web.Script.Serialization;
|
||
|
|
||
|
namespace Ansible.Test
|
||
|
{
|
||
|
public class OutputTest
|
||
|
{
|
||
|
public static string GetString()
|
||
|
{
|
||
|
Dictionary<string, object> obj = new Dictionary<string, object>();
|
||
|
obj["a"] = "a";
|
||
|
obj["b"] = 1;
|
||
|
return ToJson(obj);
|
||
|
}
|
||
|
|
||
|
private static string ToJson(object obj)
|
||
|
{
|
||
|
JavaScriptSerializer jss = new JavaScriptSerializer();
|
||
|
return jss.Serialize(obj);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|