locked
How do I get the name of the current URL of my website? RRS feed

Answers

  • I don't think there is any magic .net method you can call to strip the request parameters off the url, at least from the windows client side.  There are server methods of course where this is really needed.  In your situation, this code should work:
     
     Sub Main()
      Dim fullurl As String = "http://localhost:2751/WebSite1/Default.aspx?id=1234"
      Dim parts As String() = fullurl.Split("?"c)
      Console.WriteLine(parts(0))
      Console.ReadKey()
     End Sub

     

    --
    Mike
    • Proposed as answer by Chao Kuo Monday, October 4, 2010 9:48 AM
    • Marked as answer by Dwigt Monday, October 4, 2010 1:01 PM
    Friday, October 1, 2010 12:37 AM