Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 894325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:21:58+00:00 2026-05-15T14:21:58+00:00

Lets say I have a web site hosted on a computer named linux and

  • 0

Lets say I have a web site hosted on a computer named “linux” and it is part of two different networks with the addresses 192.168.1.1 and 10.1.1.1. When working locally on “linux”, I can access this web site through the following URLs :

http://192.168.1.1/
http://10.1.1.1/
http://linux/
http://localhost/
http://127.0.0.1/

Working on another machine on the network “10.1.1.0/24” I can use the following :

http://10.1.1.1/
http://linux/

But on “192.168.1.0/24” I can only use :

http://192.168.1.1/
http://linux/

I’m developing an application that compares URLs, and on this application’s context two URLs are equal if they point to the same resource.

Is there a quick way of doing that kind of comparison using the URI class in C# ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:21:59+00:00Added an answer on May 15, 2026 at 2:21 pm

    There’s no way the URI class will help you; it can only determine if two URIs are the same URI, and they’re only the same URI if they have the same server name / IP address.

    The best option is to download the resource from both URLs and see if it is the same resource by checking for equality and assuming that two resources are the same resource if they’re the same sequence of bits.

    That isn’t an option for me, the perfomance cost could be too great. I was hoping for something that could match the ‘host address’ part of the URI’s, then all that was left to compare would be the relative path and port… – Thiado de Arruda

    Unfortunately, there is nothing in the framework that will do what you want out of the box, because there’s no reliable way of mapping different host names to the same host and therefore the same resource.

    You are going to have to have some sort of mapping of hosts to the various aliases of those hosts and query for them yourself. The URI.Host property will get the host name of the URI in question for you, but you’ll have to translate it yourself. Nothing in the framework is going to be able to do it for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have an asp:imagebutton for lets say loginning into a web site. OnClick
Lets say you have a web app related Android app that requires the user
I have an echo web service running on lets say http://localhost:8080/axis2/services/Service1 . This service
Lets say I have two .dlls, Dll1 and Dll2. DLL1 uses or makes calls
This is regarding ASP.NET MVC. Let's say I have a web site that is
Lets say I have several web sites on my web server, all as applications
Let's say I have a web site for hosting community generated content that targets
Lets say a Java EE based e-commerce web site is performing well giving expected
Let's say I have a class (MyClass.cs) in App_Code (using a ASP.NET web site,
So lets say I have the following scenario. http://website.com:8080 and http://website.com:8080/demo Is there any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.