How to get a base URL from a given URL in ASP.NET(apijunkie.com)

submitted by APIJunkieAPIJunkie(539) 4 years, 3 months ago

A simple implementation of a function to get the base URL from a given URI

1 comment |category: |Views: 6

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by zigamorphzigamorph(3319) 4 years, 3 months ago 0

What is the matter with the built in function to do this?

Uri url = new Uri("http://msdn2.microsoft.com/en-us/netframework/default.aspx");
string basePart = url.GetLeftPart(UriPartial.Authority);

Reply

information Login or create an account to comment on this story