socket.io-client-csharp
socket.io-client-csharp copied to clipboard
How can I assign json data to variables?
Hello,
How can I assign json data to variables?
client.On("price_changed", response =>
{
Console.WriteLine(response);
});
My all code:
public static async Task Main(string[] args)
{
var client = new SocketIO("wss://www.haremaltin.com:2088");
client.On("price_changed", (Data) => // Argument can be used without type.
{
});
client.On("price_changed", response =>
{
Console.WriteLine(response);
});
client.OnConnected += async (sender, e) =>
{
// Emit a string
await client.EmitAsync("");
Console.WriteLine("Connected");
Console.ReadKey();
// Emit a string and an object
};
await client.ConnectAsync();
Console.ReadKey();
}
What I want to do is to assign the USDTRY price, the GOLD price, the EURTRY price to the variables and print them one after the other. Example: string USDTRY = USDTRYprice(26.1200); string EURTRY = EURTRYprice(28.59100); strring GOLD = GOLDprice(1622.370);
Console.WriteLine("USDTRY Price= "+ USDTRY) Console.WriteLine("EURTRY Price= "+ EURTRY) Console.WriteLine("GOLD Price= "+ GOLD)
Thank you for your help