jeudi 30 septembre 2021

How I can put a string contain data from an api into a HashMap or Dictionary?

I'm new to c# and I have created a library that contain currency exchange rate from an API to a string

using System.Net;
namespace RateLib
{
    public class CurrencyRate
    {
        public void getRate()
        {
            string url = "apikey";

            WebClient myClient = new WebClient();
            string txt = myClient.DownloadString(url);

        }
    }
}

Now, how I can put this txt string into a hashmap (if it does exist in c#) or a Dictionary ?





Aucun commentaire:

Enregistrer un commentaire