Tuesday, December 13, 2011

C#(get the country info from browser/create web request)



//GET AND CHECK THE COUNTRY
        public void getCountry()
        {
            //Prepare the web page we will be asking for
            HttpWebRequest request = (HttpWebRequest)
            WebRequest.Create("http://api.hostip.info/country.php");
            
            //DECLARE COUNTRY HERE
            StreamReader stream = new StreamReader(request.GetResponse().GetResponseStream());
            string r = stream.ReadLine();
        }


No comments:

Post a Comment