JsonUtility 1.0.7
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package JsonUtility --version 1.0.7
NuGet\Install-Package JsonUtility -Version 1.0.7
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JsonUtility" Version="1.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JsonUtility --version 1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JsonUtility, 1.0.7"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install JsonUtility as a Cake Addin #addin nuget:?package=JsonUtility&version=1.0.7 // Install JsonUtility as a Cake Tool #tool nuget:?package=JsonUtility&version=1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
text.txt {"name":"foo", "age":"50", "children":{"name":"bar", "age":"20", "gender":"female","hobby":["tennis","swimming","walking"]}}
public partial class JsonUtilityTester : Form
{
public JsonUtilityTester()
{
Button button = new Button() { Text = "Open", Dock = DockStyle.Top, Parent=this,};
button.Click += (sender, e) => {
OpenFileDialog ofd = new OpenFileDialog() { InitialDirectory = Application.StartupPath, };
/** select .\text.txt */
if (ofd.ShowDialog() == DialogResult.OK)
{
using (System.IO.StreamReader sr = new System.IO.StreamReader(ofd.FileName))
{
var text = sr.ReadToEnd();
var dic = JsonUtility.JsonParser.GetAllValuesAsDic(text);
var msg = string.Join(Environment.NewLine,
dic.Select(x => string.Format("{0}={1}", x.Key, x.Value)).Take(
dic.Keys.Count > 30 ? 30 : dic.Keys.Count));
MessageBox.Show(msg);
/** necessary to add Newtonsoft.Json */
var json = Newtonsoft.Json.JsonConvert.DeserializeObject(text);
//var json = JsonUtility.JsonParser.Deserialize(text);
var dic2 = JsonUtility.JsonParser.GetAllValuesAsDic(json);
var msg2 = string.Join(Environment.NewLine,
dic2.Select(x => string.Format("{0}={1}", x.Key, x.Value)).Take(
dic2.Keys.Count > 30 ? 30 : dic2.Keys.Count));
MessageBox.Show(msg2);
}
}
};
StartPosition = FormStartPosition.CenterScreen;
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- Newtonsoft.Json (>= 12.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.