entasy
entasy
CC#
Created by entasy on 2/10/2023 in #help
❔ ✅ Help Passing Arguments to Action (Custom Wait Code)
Thank you a lot @HowNiceOfYou
7 replies
CC#
Created by entasy on 1/31/2023 in #help
❔ Convert JSON string to struct
It worked, thank you. @🌈 Thinker 🌈 For anyone who needs:
c++

public struct Configdata
{
public string ip { get; set; }
public string port { get; set; }
}

string _data = @"{""ip"":""127.0.0.1"", ""port"":""12345""}";
var _data2 = JsonSerializer.Deserialize<Configdata>(_data);
Console.WriteLine($"Content: {_data2.ip}");
Console.WriteLine($"Content: {_data2.port}");
c++

public struct Configdata
{
public string ip { get; set; }
public string port { get; set; }
}

string _data = @"{""ip"":""127.0.0.1"", ""port"":""12345""}";
var _data2 = JsonSerializer.Deserialize<Configdata>(_data);
Console.WriteLine($"Content: {_data2.ip}");
Console.WriteLine($"Content: {_data2.port}");
5 replies