c# object to json string
C#
Newtonsoft.Json.JsonConvert.SerializeObject(new {foo = "bar"})var json = new JavaScriptSerializer().Serialize(obj);using System;
using System.Web.Script.Serialization;
public class MyDate
{
public int year;
public int month;
public int day;
}
public class Lad
{
public string firstName;
public string lastName;
public MyDate dateOfBirth;
}
class Program
{
static void Main()
{
var obj = new Lad
{
firstName = "Markoff",
lastName = "Chaney",
dateOfBirth = new MyDate
{
year = 1901,
month = 4,
day = 30
}
};
var json = new JavaScriptSerializer().Serialize(obj);
Console.WriteLine(json);
}
}
Also in C#:
- Title
- add row count devepxress report
- Category
- C#
- Title
- unity oncollisionenter2d
- Category
- C#
- Title
- how to create a list in c# unity
- Category
- C#
- Title
- iphone
- Category
- C#
- Title
- verifyusertokenasync password reset token
- Category
- C#
- Title
- round vector3 unity
- Category
- C#
- Title
- C# .NET Core linq Distinct
- Category
- C#
- Title
- c# ?
- Category
- C#
- Title
- c# sql duplicate key exception
- Category
- C#
- Title
- linq c# or
- Category
- C#
- Title
- math class C# exponents
- Category
- C#
- Title
- uwp file open picker
- Category
- C#
- Title
- C# extend array
- Category
- C#
- Title
- how to make error sound c#
- Category
- C#
- Title
- c# silent execute exe
- Category
- C#
- Title
- ASP select box all states
- Category
- C#
- Title
- unity how to check object position
- Category
- C#
- Title
- enums c#
- Category
- C#
- Title
- winforms c# add data to datagridview with a button
- Category
- C#
- Title
- unity rotate around point
- Category
- C#
- Title
- c# check to see if dictionary key exists
- Category
- C#
- Title
- C# check if is first run
- Category
- C#
- Title
- how to add a gameobject
- Category
- C#
- Title
- how to declare a string c#
- Category
- C#
- Title
- c# windows application get current path
- Category
- C#
- Title
- cannot convert string to generic type c#
- Category
- C#
- Title
- wpf label text in center
- Category
- C#
- Title
- create asp.net which send email and sms using own api
- Category
- C#
- Title
- c# regex replace
- Category
- C#
- Title
- how to make pressing enter an event in c#
- Category
- C#
- Title
- dont destroy on load unity
- Category
- C#
- Title
- Failed to retrieve Firebase Instance Id
- Category
- C#
- Title
- unity 2d detect click on sprite
- Category
- C#
- Title
- define enum c#
- Category
- C#
- Title
- c# float to string
- Category
- C#
- Title
- c# instantiate
- Category
- C#
- Title
- unity ui not seen
- Category
- C#
- Title
- how to put double quotes in a string c#
- Category
- C#
- Title
- c# calculate difference between two dates in days
- Category
- C#
- Title
- c# clear console read chache
- Category
- C#
- Title
- how to make a pause feautre in unity
- Category
- C#
- Title
- create new object from generic c#
- Category
- C#
- Title
- how to select time and date in datetimepicker in c#
- Category
- C#
- Title
- c# access session in class
- Category
- C#
- Title
- out parameters c#
- Category
- C#
- Title
- gfortran: declare an array
- Category
- C#
- Title
- combine two arraylist c#
- Category
- C#
- Title
- get user directory of file in c#
- Category
- C#
- Title
- .net core check if linux
- Category
- C#
- Title
- c# switct case
- Category
- C#
- Title
- pop up element from specific index in array
- Category
- C#
- Title
- c# arraylist contains
- Category
- C#
- Title
- unity try get component
- Category
- C#
- Title
- how to find object by ag unity
- Category
- C#
- Title
- populate combobox from array c#
- Category
- C#
- Title
- c# change colour of console
- Category
- C#
- Title
- unity create a child object
- Category
- C#
- Title
- what is using static in c#
- Category
- C#
- Title
- c# double question mark
- Category
- C#
- Title
- c# return two variables of different types
- Category
- C#
- Title
- Unity how to put IEnumerator in update and loop once with yeild return new waitforseconds
- Category
- C#
- Title
- c# making a folder
- Category
- C#
- Title
- c# length of array
- Category
- C#
- Title
- httpclient soap request c#
- Category
- C#
- Title
- query associative table ef6
- Category
- C#
- Title
- c# reverse a string for loop
- Category
- C#
- Title
- c# md5 string
- Category
- C#
- Title
- c# datetime dd/mm/yyy hh:mm:ss
- Category
- C#
- Title
- c# size of enum
- Category
- C#
- Title
- c# int
- Category
- C#
- Title
- unity how to change max fps
- Category
- C#
- Title
- how to reference scripts in other scenes unity
- Category
- C#
- Title
- set label position winforms
- Category
- C#
- Title
- check if two timespans intersect c#
- Category
- C#
- Title
- c# groupby date
- Category
- C#
- Title
- and unity
- Category
- C#
- Title
- convert string to number C#
- Category
- C#
- Title
- HashSet C# append
- Category
- C#
- Title
- c# webcam
- Category
- C#
- Title
- c# double value with 2 decimal places
- Category
- C#
- Title
- c# clone stream
- Category
- C#
- Title
- font family behind code uwp c#
- Category
- C#
- Title
- beard styles without mustache Intitle:work with me
- Category
- C#
- Title
- c# convert byte to char
- Category
- C#
- Title
- check if network is available c#
- Category
- C#
- Title
- The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located.
- Category
- C#
- Title
- c# .net core memory cache
- Category
- C#
- Title
- get enum by index c#
- Category
- C#
- Title
- convert string to datetime c#
- Category
- C#
- Title
- c# repeat string x times
- Category
- C#
- Title
- c# stop loop
- Category
- C#
- Title
- c# set textbox text
- Category
- C#
- Title
- c# MD5.Create returning nul
- Category
- C#
- Title
- iterate through dictionary c#
- Category
- C#
- Title
- csharp check if env is development
- Category
- C#
- Title
- unity change the source image or image
- Category
- C#
- Title
- c# tab character
- Category
- C#
- Title
- roulette algorithm genetic algorithm
- Category
- C#
- Title
- unity how to set an objects postion x,y,z
- Category
- C#
- Title
- add spaces between words unity
- Category
- C#