WebRequest request;
        WebResponse response;
        String strMSG = string.Empty;
        request = WebRequest.Create(new Uri(“http://www.tradeget.com/images/topimg.jpg”));
        request.Method = “HEAD”;
        try
        {
            response = request.GetResponse();
            strMSG = string.Format(“{0} {1}”, response.ContentLength, response.ContentType);
        }
        catch (Exception ex)
        {
            //In case of File not Exist Server return the (404) Error
            strMSG = ex.Message;
        }

        lblMSG.Text = strMSG;

Comments (0)