how to convert object in string JSON c#
C#
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
- c# bitmap to Image
- Category
- C#
- Title
- odbc command parameters c#
- Category
- C#
- Title
- how to check if an integer is in array c#
- Category
- C#
- Title
- asp list box
- Category
- C#
- Title
- c# long to int
- Category
- C#
- Title
- c# distinct comparer multiple properties
- Category
- C#
- Title
- convert base64 string to string c#
- Category
- C#
- Title
- degree to radians c#
- Category
- C#
- Title
- unity coroutine
- Category
- C#
- Title
- unity connect to firebase
- Category
- C#
- Title
- unity cast int to float
- Category
- C#
- Title
- c# nullable generic
- Category
- C#
- Title
- c# check if type implements interface
- Category
- C#
- Title
- unity clamp rotation
- Category
- C#
- Title
- c# download file
- Category
- C#
- Title
- c# math to radiant
- Category
- C#
- Title
- get hash c#
- Category
- C#
- Title
- make camera follow character unity 2020
- Category
- C#
- Title
- unity change the source image or image
- Category
- C#
- Title
- unity getcomponent
- Category
- C#
- Title
- unity 2d joystick controls
- Category
- C#
- Title
- functions unity
- Category
- C#
- Title
- c sharp how to read a text file
- Category
- C#
- Title
- how to destroy a gameobject after some hits in unity 3d
- Category
- C#
- Title
- call Textboxfor in cs
- Category
- C#
- Title
- bundle.config in mvc is missing
- Category
- C#
- Title
- csharp check if env is development
- Category
- C#
- Title
- query associative table ef6
- Category
- C#
- Title
- how to get component in unity c#
- Category
- C#
- Title
- c# group array based on first character
- Category
- C#
- Title
- how to insert into a list c#
- Category
- C#
- Title
- if and c#
- Category
- C#
- Title
- c# tuple access
- Category
- C#
- Title
- c# inline initialize dictionary
- Category
- C#
- Title
- c# get object property value by name
- Category
- C#
- Title
- converting letter to ascii
- Category
- C#
- Title
- nunit return parameter
- Category
- C#
- Title
- unity set object scale
- Category
- C#
- Title
- find gameobject with tag
- Category
- C#
- Title
- while loop c#
- Category
- C#
- Title
- wpf restart application c#
- Category
- C#
- Title
- c# date
- Category
- C#
- Title
- how to name GameObject in c#
- Category
- C#
- Title
- reference to gameobject in different scene unity
- Category
- C#
- Title
- no overload for 'useItemOnSceneLoad' matches delegate 'UnityAction<Scene, LoadSceneMode>'
- Category
- C#
- Title
- C# events
- Category
- C#
- Title
- simple reset transform.rotation c#
- Category
- C#
- Title
- change textbox location C#
- Category
- C#
- Title
- c# else if
- Category
- C#
- Title
- c# get every point in a line in matrix
- Category
- C#
- Title
- c# make request to rest api
- Category
- C#
- Title
- c# fold list
- Category
- C#
- Title
- c# httpclient postasync stringcontent
- Category
- C#
- Title
- c# or
- Category
- C#
- Title
- unity serializefield
- Category
- C#
- Title
- c# empty array
- Category
- C#
- Title
- how to use more than one condition in ef join
- Category
- C#
- Title
- unity print
- Category
- C#
- Title
- c# how to convert string to int
- Category
- C#
- Title
- asking for user input integer c#
- Category
- C#
- Title
- unix time c#
- Category
- C#
- Title
- c# implement a superclass in subclass
- Category
- C#
- Title
- unity get number of child objects
- Category
- C#
- Title
- vb.net yes no cancel
- Category
- C#
- Title
- c# inheritance constructor
- Category
- C#
- Title
- how to hide and show object in unity script
- Category
- C#
- Title
- unity3d invector expand fsm controller
- Category
- C#
- Title
- how to close a windows form application in c#
- Category
- C#
- Title
- get enum value c#
- Category
- C#
- Title
- Add component object to gameobject unity
- Category
- C#
- Title
- c# object clone
- Category
- C#
- Title
- unity how to make jump script
- Category
- C#
- Title
- random class
- Category
- C#
- Title
- convert array object to int[] c#
- Category
- C#
- Title
- how to compare datetime in c#
- Category
- C#
- Title
- split string
- Category
- C#
- Title
- winforms messagebox with button
- Category
- C#
- Title
- c# length 2d array
- Category
- C#
- Title
- order by C#
- Category
- C#
- Title
- c# clone stream
- Category
- C#
- Title
- c# split large file into chunks
- Category
- C#
- Title
- c# convert Unix time in seconds to datetime
- Category
- C#
- Title
- unity make a int arry with preset values
- Category
- C#
- Title
- how to add object in dictionary in c#
- Category
- C#
- Title
- c# read char
- Category
- C#
- Title
- Failed to retrieve Firebase Instance Id
- Category
- C#
- Title
- displayname c#
- Category
- C#
- Title
- unity read text file
- Category
- C#
- Title
- create expression func c# for use in where clause
- Category
- C#
- Title
- get query string parameter from string value c#
- Category
- C#
- Title
- add row count devepxress report
- Category
- C#
- Title
- how to spawn coins randomly around the screen unity 2d
- Category
- C#
- Title
- convert string to number C#
- Category
- C#
- Title
- unity cast float to int
- Category
- C#
- Title
- open new window c# wpf
- Category
- C#
- Title
- conditional compilation c#
- Category
- C#
- Title
- input get button uibutton
- Category
- C#
- Title
- c# sort array
- Category
- C#
- Title
- c# type of generic is string
- Category
- C#
- Title
- panel drag all form c#
- Category
- C#