computername
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > computername




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    computername  
Mindy Geac


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-26-05 01:05 PM

Hello,

i'm new with ASP!

How can I display the hosting computername on the website, We have 2 servers
and I want to know which server I'm getting the asp pages from.

thnx,

Mindy







[ Post a follow-up to this message ]



    Re: computername  
McKirahan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-26-05 01:05 PM

"Mindy Geac" <comp.lang.php@news.news> wrote in message
news:4295a8a0$0$4230$e4fe514c@news.xs4all.nl...
> Hello,
>
> i'm new with ASP!
>
> How can I display the hosting computername on the website, We have 2
servers
> and I want to know which server I'm getting the asp pages from.
>
> thnx,
>
> Mindy
>

Try using

Request.ServerVariables("HTTP_HOST")







[ Post a follow-up to this message ]



    Re: computername  
Roland Hall


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-26-05 01:05 PM

"Mindy Geac" <comp.lang.php@news.news> wrote in message
news:4295a8a0$0$4230$e4fe514c@news.xs4all.nl...
: How can I display the hosting computername on the website, We have 2
servers
: and I want to know which server I'm getting the asp pages from.

...or Response.Write Request.ServerVariables("SERVER_NAME")

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp







[ Post a follow-up to this message ]



    Re: computername  
Mindy Geac


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-26-05 01:05 PM

Hello,

I get the IP address of the server, that's the IP address of the Cluster.
How can you display the Netbois name of the server?
I also tried  Request.ServerVariables("HTTP_HOST") but then I don't receive
any output.

Mindy


"Roland Hall" <nobody@nowhere> wrote in message
news:%23br6SmeYFHA.228@TK2MSFTNGP12.phx.gbl...
> "Mindy Geac" <comp.lang.php@news.news> wrote in message
> news:4295a8a0$0$4230$e4fe514c@news.xs4all.nl...
> : How can I display the hosting computername on the website, We have 2
> servers
> : and I want to know which server I'm getting the asp pages from.
>
> ...or Response.Write Request.ServerVariables("SERVER_NAME")
>
> --
> Roland Hall
> /* This information is distributed in the hope that it will be useful, but
> without any warranty; without even the implied warranty of merchantability
> or fitness for a particular purpose. */
> technet Script Center - http://www.microsoft.com/technet/scriptcenter/
> WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
> MSDN Library - http://msdn.microsoft.com/library/default.asp
>
>







[ Post a follow-up to this message ]



    Re: computername  
Mindy Geac


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-26-05 01:05 PM

I have a new reply to Roland Hall







[ Post a follow-up to this message ]



    Re: computername  
Mindy Geac


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-26-05 01:05 PM

In the meantime I tried something else :

<%@ Language=VBScript   %>
<%
Dim oSysInfo
Set oSysInfo = CreateObject("WinNTSystemInfo")

Dim CompName
CompName = oSysInfo.ComputerName
msgbox CompName
%>

But then I get an access denied on msgbox

....
"Mindy Geac" <comp.lang.php@news.news> wrote in message
news:4295c03e$0$157$e4fe514c@news.xs4all.nl...
> Hello,
>
> I get the IP address of the server, that's the IP address of the Cluster.
> How can you display the Netbois name of the server?
> I also tried  Request.ServerVariables("HTTP_HOST") but then I don't
receive
> any output.
>
> Mindy
>
>
> "Roland Hall" <nobody@nowhere> wrote in message
> news:%23br6SmeYFHA.228@TK2MSFTNGP12.phx.gbl... 
but[vbcol=seagreen] 
merchantability[vbcol=seagreen] 
> http://msdn.microsoft.com/downloads/list/webdev.asp 
>
>







[ Post a follow-up to this message ]



    Re: computername  
Patrice


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-26-05 01:05 PM

Just use Response.Write. You can't display a server side message box...

I don't know this object but you could use as well WScript.Network and its
ComputerName prorperty...

Patrice

--

"Mindy Geac" <comp.lang.php@news.news> a écrit dans le message de
news:4295c1a8$0$155$e4fe514c@news.xs4all.nl...
> In the meantime I tried something else :
>
> <%@ Language=VBScript   %>
> <%
>  Dim oSysInfo
>  Set oSysInfo = CreateObject("WinNTSystemInfo")
>
>  Dim CompName
>  CompName = oSysInfo.ComputerName
>  msgbox CompName
> %>
>
> But then I get an access denied on msgbox
>
> ....
> "Mindy Geac" <comp.lang.php@news.news> wrote in message
> news:4295c03e$0$157$e4fe514c@news.xs4all.nl... 
Cluster.[vbcol=seagreen] 
> receive 
> but 
> merchantability 
>
>







[ Post a follow-up to this message ]



    Re: computername  
Roland Hall


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-27-05 07:48 AM

"Mindy Geac" wrote in message news:4295c1a8$0$155$e4fe514c@news.xs4all.nl...
: In the meantime I tried something else :
:
: <%@ Language=VBScript   %>
: <%
: Dim oSysInfo
: Set oSysInfo = CreateObject("WinNTSystemInfo")
:
: Dim CompName
: CompName = oSysInfo.ComputerName
: msgbox CompName
: %>
:
: But then I get an access denied on msgbox

This will work but I'm not sure about how it works with a cluster.  Patrice
is right, you cannot use MsgBox server-side.  It can only be used with
client-side code.  You can pass the result to client-side and call an alert
with javascript or vbscript (Intranet).

<%@ Language=VBScript %>
<%
Dim oSysInfo :  Set oSysInfo = Server.CreateObject("WinNTSystemInfo")
Dim CompName : CompName = oSysInfo.ComputerName

'o---> Pass to Javascript alert <---o
Response.Write "<script type=""text/javascript"">" & vbCrLf & _
"  alert('Computer Name: " & CompName & "');" & vbCrLf & _
"</script>"

'o---> Pass to VBScript MsgBox <---o
Response.Write "<script type=""text/vbscript"">" & vbCrLf & _
"  Msgbox """ & CompName & """,64,""Computer Name""" & vbCrLf & _
"</script>"
%>

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:34 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum 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
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register