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

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?

Who is Participating?
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 comp1.domain.com ; now it can reference itself by localhost, but OTHER machines of the same domain should reference it by its full name.
Hope it helps
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.