HOW TO GET WEATHER FORECAST OF ANY COUNTRY USING C# CONSOLE APPLICATION
HOW TO GET WEATHER FORECAST DETAIL OF ANY COUNTRY USING C# CONSOLE APPLICATION
NOTE:
- YOU NEED TO HAVE MICROSOFT VISUAL STUDIO (2010 OR NEWER VERSION) OR YOU CAN HAVE ANY PLATFORM WHICH SUPPORTS C# CONSOLE APPLICATION.
- AFTER CREATING THE PROJECT, FIRST ADD THE LIBRARIES:
- using System.Net;
- using System.IO;
- using System.Diagnostics;
- using System.Threading;
NOW,
Write or paste the following code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Net;
using System.IO;
using System.Diagnostics;
namespace weatherforecaster
{
class Program
{
static void Main(string[] args)
{
string search;
Console.WriteLine("Enter the country name to search about its Weather details:");
search = Console.ReadLine();
searchweather(search);
}
static void searchweather(string country_name)
{
Process.Start("https://www.weather-forecast.com/locations/"+country_name+"/forecasts/latest");
}
}
}
Write or paste the following code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Net;
using System.IO;
using System.Diagnostics;
namespace weatherforecaster
{
class Program
{
static void Main(string[] args)
{
string search;
Console.WriteLine("Enter the country name to search about its Weather details:");
search = Console.ReadLine();
searchweather(search);
}
static void searchweather(string country_name)
{
Process.Start("https://www.weather-forecast.com/locations/"+country_name+"/forecasts/latest");
}
}
}
IT'LL PRODUCE THE FOLLOWING OUTPUT:
Comments
Post a Comment