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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. http web exception (C#.Net)

http web exception (C#.Net)

Scheduled Pinned Locked Moved C#
csharphelp
1 Posts 1 Posters 1 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.
  • S Offline
    S Offline
    Sri harini
    wrote on last edited by
    #1

    Hi I am trying to test with windows mobile 5.0 emulator..using C#.Net.. but myHttpWebResponse is always null.httpwebexception coming. Please anybody help me.. This is code: public static void httpRequest(string uri, bool isGetMethod) { try { Prepare web request... HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(uri); if (isGetMethod) myRequest.Method = "GET"; else { myRequest.Method = "POST"; myRequest.ContentType = "application/x-www-form-urlencoded"; Stream newStream = myRequest.GetRequestStream(); newStream.Close(); } HttpWebResponse myHttpWebResponse = (HttpWebResponse)myRequest.GetResponse(); Stream streamResponse = myHttpWebResponse.GetResponseStream(); StreamReader streamRead = new StreamReader(streamResponse); Char[] readBuffer = new Char[256]; int count = streamRead.Read(readBuffer, 0, 256); string result = ""; while (count > 0) { string resultData = new String(readBuffer, 0, count); result = result + resultData; count = streamRead.Read(readBuffer, 0, 256); } HTTPClass.resultData = result; streamRead.Close(); streamResponse.Close(); myHttpWebResponse.Close(); } catch(Exception e) { MessageBox.Show(e.Message.ToString()); } } Anybody help me.. Thanks

    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