Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Unable to connect to remote server

Unable to connect to remote server

Scheduled Pinned Locked Moved ASP.NET
questionsysadmindata-structureshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    needhi_p
    wrote on last edited by
    #1

    Hi all... I am making a web request to a site & all is working fine. But today i found that the site url isnt working. Site is unavailable due to some reasons. So then in my code i am getting error of "Unable to connect to remote server". My code is as follows. private WebRequest _request; _request = WebRequest.Create(uri[j]); // uri[j] is an array containing site url _request.Method = "POST"; _request.ContentType = "application/x-www-form-urlencoded"; _request.ContentLength = buffer.Length; PostData = _request.GetRequestStream(); <---- gives error PostData.Write(buffer, 0, buffer.Length); How can i catch this exception? Is there some way to catch such exception??? Thnx in advance..

    C A 2 Replies Last reply
    0
    • N needhi_p

      Hi all... I am making a web request to a site & all is working fine. But today i found that the site url isnt working. Site is unavailable due to some reasons. So then in my code i am getting error of "Unable to connect to remote server". My code is as follows. private WebRequest _request; _request = WebRequest.Create(uri[j]); // uri[j] is an array containing site url _request.Method = "POST"; _request.ContentType = "application/x-www-form-urlencoded"; _request.ContentLength = buffer.Length; PostData = _request.GetRequestStream(); <---- gives error PostData.Write(buffer, 0, buffer.Length); How can i catch this exception? Is there some way to catch such exception??? Thnx in advance..

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      This is plainly not an ASP.NET question. Have you tried putting this code in a try/catch block ?

      Christian Graus Driven to the arms of OSX by Vista.

      1 Reply Last reply
      0
      • N needhi_p

        Hi all... I am making a web request to a site & all is working fine. But today i found that the site url isnt working. Site is unavailable due to some reasons. So then in my code i am getting error of "Unable to connect to remote server". My code is as follows. private WebRequest _request; _request = WebRequest.Create(uri[j]); // uri[j] is an array containing site url _request.Method = "POST"; _request.ContentType = "application/x-www-form-urlencoded"; _request.ContentLength = buffer.Length; PostData = _request.GetRequestStream(); <---- gives error PostData.Write(buffer, 0, buffer.Length); How can i catch this exception? Is there some way to catch such exception??? Thnx in advance..

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Does your remote server working properly ? is it pinging ?

        cheers, Abhijit

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups