PSObject 转 C# Object
2021-05-15 23:26
标签:output object value tput val set style rop var PSObject 转 C# Object 标签:output object value tput val set style rop var 原文地址:https://www.cnblogs.com/nanfei/p/14666776.htmlpublic class MyInfo
{
public string Name { get; set; }
public double Diff { get; set; }
public string File { get; set; }
}
static void Main(string[] args)
{
PSObject obj = PSObject.AsPSObject(new { Name = "David", Diff = 0.2, File = "output.txt" });
var serialized = JsonConvert.SerializeObject(obj.Properties.ToDictionary(k => k.Name, v => v.Value));
Console.WriteLine(serialized);
var deseialized = JsonConvert.DeserializeObject
上一篇:bugku web wp(一)
下一篇:C#中对xml数据的读取和写入