Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > computername

Reply
Thread Tools

computername

 
 
Mindy Geac
Guest
Posts: n/a
 
      05-26-2005
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


 
Reply With Quote
 
 
 
 
McKirahan
Guest
Posts: n/a
 
      05-26-2005
"Mindy Geac" <> wrote in message
news:4295a8a0$0$4230$...
> 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")


 
Reply With Quote
 
 
 
 
Roland Hall
Guest
Posts: n/a
 
      05-26-2005
"Mindy Geac" <> wrote in message
news:4295a8a0$0$4230$...
: 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


 
Reply With Quote
 
Mindy Geac
Guest
Posts: n/a
 
      05-26-2005
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:%...
> "Mindy Geac" <> wrote in message
> news:4295a8a0$0$4230$...
> : 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
>
>



 
Reply With Quote
 
Mindy Geac
Guest
Posts: n/a
 
      05-26-2005
I have a new reply to Roland Hall


 
Reply With Quote
 
Mindy Geac
Guest
Posts: n/a
 
      05-26-2005
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" <> wrote in message
news:4295c03e$0$157$...
> 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:%...
> > "Mindy Geac" <> wrote in message
> > news:4295a8a0$0$4230$...
> > : 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
> >
> >

>
>



 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      05-26-2005
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" <> a écrit dans le message de
news:4295c1a8$0$155$...
> 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" <> wrote in message
> news:4295c03e$0$157$...
> > 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:%...
> > > "Mindy Geac" <> wrote in message
> > > news:4295a8a0$0$4230$...
> > > : 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
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      05-27-2005
"Mindy Geac" wrote in message news:4295c1a8$0$155$...
: 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
computername:port not work instead localhost amjad ASP .Net 0 11-24-2005 05:02 AM
ComputerName of Remote User dthmtlgod ASP General 2 08-26-2004 09:07 PM
Gather Local ComputerName Joseph ASP .Net 2 04-23-2004 05:14 PM
How to grap computername Ryd ASP General 2 02-19-2004 05:19 PM
can asp.net get the computername? Jason Shohet ASP .Net 1 01-15-2004 09:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57