computername

M

Mindy Geac

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
 
M

McKirahan

Mindy Geac said:
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")
 
R

Roland Hall

: 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
 
M

Mindy Geac

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
 
M

Mindy Geac

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

.....
 
P

Patrice

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

--
 
R

Roland Hall

in message : 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top