Difference between GetObject("IIS://localhost/W3SVC/1/ROOT") & GetObject("IIS://" & computername & "/W3SVC/1/ROOT")

Posted on 2006-05-11
Last Modified: 2011-10-03
Hi, what is the different between  GetObject("IIS://localhost/W3SVC/1/ROOT") and GetObject("IIS://" & computername & "/W3SVC/1/ROOT") , when I have to use localhost and when I have to use computername? and is there another parameter other than these two parameters?

Question by:Abdu_Allah
    LVL 14

    Accepted Solution

    Well, I'm not 100% sure, but as far as I know, EVERY computer can reference ITSELF by localhost. (Well, I mean every computer which runs IIS indeed.) But that same computer may have a different name as well. Suppose that you are on a machine which is also named ; now it can reference itself by localhost, but OTHER machines of the same domain should reference it by its full name.
    Hope it helps
    LVL 19

    Assisted Solution

    Localhost is best used when the code is running on the machine itself, while computername should ONLY be used when you are trying to connect to another pc. The advantages of localhost are quite obvious. If the computer changes name, changes domain, changes ip it will not affect your code. Localhost will always return the pc the code is running on.

    As far as executing time etcetera is concerned I think localhost is a bit faster then computername, but the speed difference is neglectable.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now