JavaScriptSerializer() and convert to base64
class Program
{
static void Main(string[] args)
{
var account = new ExternalAccount() { Name = "Someone" };
string json = JsonConvert.SerializeObject(account);
string base64EncodedExternalAccount = Convert.ToBase64String(Encoding.UTF8.GetBytes(json));
byte[] byteArray = Convert.FromBase64String(base64EncodedExternalAccount);
string jsonBack = Encoding.UTF8.GetString(byteArray);
var accountBack = JsonConvert.DeserializeObject<ExternalAccount>(jsonBack);
Console.WriteLine(accountBack.Name);
Console.ReadLine();
}
}
[Serializable]
public class ExternalAccount
{
public string Name { get; set; }
}
Also in C#:
- c# new dictionary linq
- Rigidbody.addforce
- out parameters c#
- c# linq to select even numbers
- convert string to decimal c#
- mysql executeScalar only if successful
- parsing string to int c#
- Unity C# make object face away
- check if current time is in the morning c#
- percentage in c#
- how to see a tag of what you hit with raycast
- populate combobox from array c#
- call a function c#
- c# Authorization has been denied for this request
- order by C#
- or in C#
- c# messagebox result
- snake
- unity add component
- button commandfield commandargument pass textbox
- c# input
- C# webclient submit form
- how to create and trigger a function unity animation events
- unity transformer double en float