کد
private void get_status ()
        {
            try
            {


                HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create(textBox1.Text);
                httpReq.AllowAutoRedirect = false;


                HttpWebResponse httpRes = (HttpWebResponse)httpReq.GetResponse();
                textBox2.Text = Convert.ToString(httpRes.StatusCode);
                // Close the response.
                button1.Text = "Go Status";
                httpRes.Close();
            }//end try
            
            catch (Exception)
            {


            }
        }