| Welcome to Webforumz.com. |
|
Oct 8th, 2007, 16:02
|
#1 (permalink)
|
Join Date: Oct 2007
Location: UK
Posts: 43
|
checking for localhot
A common problem I have when writing code is that I want ceratin code not to be executed when I am testing locally.
I am a vb.net developer.
Is there a way of checking whether that you are running locally or on a remote machine.
Thanks
Parm
|
|
|
Oct 8th, 2007, 16:15
|
#2 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: checking for localhot
What Operating System are you using?
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Oct 8th, 2007, 16:17
|
#3 (permalink)
|
Join Date: Oct 2007
Location: UK
Posts: 43
|
Re: checking for localhot
Windows
|
|
|
Oct 9th, 2007, 00:22
|
#4 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: checking for localhot
I will assume you mean XP. Have you installed IIS?
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Oct 9th, 2007, 09:23
|
#5 (permalink)
|
Join Date: Oct 2007
Location: UK
Posts: 43
|
Re: checking for localhot
I have windows xp. I have IIS installed locally.
When I upload it to the web server it does some authentication.
When I test it locally, I do not want it to do the authentication (since it is local). So what I need to do is make the code check whether it is running locally, and if so skip authentication and proceed with the rest of the app.
Please not: this is nbot a Q about authentication, its simply about detecting whether I am running locally, the authentication bit is simply one example of where it would be useful.
|
|
|
Oct 12th, 2007, 00:19
|
#6 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: checking for localhot
I don't quite get how you wouldn't know whether you are checking locally or remotely.
If it's locally, it will either be your IP address or "http://localhost" otherwise it will be an external IP address or domain name "http://example.com".
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|