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. General Programming
  3. C#
  4. What happoned to System.Uri(string, bool)?? [modified]

What happoned to System.Uri(string, bool)?? [modified]

Scheduled Pinned Locked Moved C#
csharphtmlcomtoolsquestion
2 Posts 1 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.
  • S Offline
    S Offline
    Spacix One
    wrote on last edited by
    #1

    I've not used URI's a lot of late, but I just noticed that telling the Uri constructor: System.Uri(string uriString, bool dontEscape) in .NET 2.0 to not escape the string is depicted AND the function isn't even included in the framework > 2.0) MSDN says to just use Uri(string uriString) If you use that how the heck can you send something to "mypage.html?view=2.0" if it escapes all strings entered?


    -Spacix All your skynet questions[^] belong to solved

    modified on Friday, April 18, 2008 2:45 PM

    S 1 Reply Last reply
    0
    • S Spacix One

      I've not used URI's a lot of late, but I just noticed that telling the Uri constructor: System.Uri(string uriString, bool dontEscape) in .NET 2.0 to not escape the string is depicted AND the function isn't even included in the framework > 2.0) MSDN says to just use Uri(string uriString) If you use that how the heck can you send something to "mypage.html?view=2.0" if it escapes all strings entered?


      -Spacix All your skynet questions[^] belong to solved

      modified on Friday, April 18, 2008 2:45 PM

      S Offline
      S Offline
      Spacix One
      wrote on last edited by
      #2

      Wow, never thought I'd see something this dumb, done by the .NET team... I found the solution: You have to make Two URI's and use one as the base URI, so now you have two strings (for no reason), more than one line of code, and two URI objects... example:

      Uri base = new Uri("http://www.google.com/search");
      Uri final = new Uri (base, "q=WTF");

      Which is sooo much easier and better than: :rolleyes: :rolleyes: :rolleyes:

      Uri final = new Uri ("http://www.google.com/search?q=WTF", true);

      WTF! why on earth would a programmer willing change it TO this?? This belongs on http://www.thedailywtf.com not in .NET :(


      -Spacix All your skynet questions[^] belong to solved

      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