public Form1() { InitializeComponent(); string html = string.Empty; string url = @"https://confiraloterias.com.br/api/json/?loteria=lotofacil&token=9j7jvYVmdNhLOxL"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.AutomaticDecompression = DecompressionMethods.GZip; using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) using (Stream stream = response.GetResponseStream()) using (StreamReader reader = new StreamReader(stream)) { html = reader.ReadToEnd(); } LotoFacilBusiness lotoFacilBusiness = new LotoFacilBusiness(); lotoFacilBusiness.teste(); }
static void Main(string[] args) { LotoFacilBusiness a = new LotoFacilBusiness(); a.teste(); }