|
|
| Mindy Geac 2005-05-26, 8:05 am |
| 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
| |
| McKirahan 2005-05-26, 8:05 am |
| "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")
| |
| Roland Hall 2005-05-26, 8:05 am |
| "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
| |
| Mindy Geac 2005-05-26, 8:05 am |
| 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
>
>
| |
| Mindy Geac 2005-05-26, 8:05 am |
| I have a new reply to Roland Hall
| |
| Mindy Geac 2005-05-26, 8:05 am |
| 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
>
>
| |
| Patrice 2005-05-26, 8:05 am |
| 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
>
>
| |
| Roland Hall 2005-05-27, 2: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
|
|
|
|