computername

Discussion in 'ASP General' started by Mindy Geac, May 26, 2005.

  1. Mindy Geac

    Mindy Geac Guest

    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
    Mindy Geac, May 26, 2005
    #1
    1. Advertising

  2. Mindy Geac

    McKirahan Guest

    "Mindy Geac" <> wrote in message
    news:4295a8a0$0$4230$4all.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")
    McKirahan, May 26, 2005
    #2
    1. Advertising

  3. Mindy Geac

    Roland Hall Guest

    "Mindy Geac" <> wrote in message
    news:4295a8a0$0$4230$4all.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
    Roland Hall, May 26, 2005
    #3
  4. Mindy Geac

    Mindy Geac Guest

    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$4all.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, May 26, 2005
    #4
  5. Mindy Geac

    Mindy Geac Guest

    I have a new reply to Roland Hall
    Mindy Geac, May 26, 2005
    #5
  6. Mindy Geac

    Mindy Geac Guest

    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$4all.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:%...
    > > "Mindy Geac" <> wrote in message
    > > news:4295a8a0$0$4230$4all.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, May 26, 2005
    #6
  7. Mindy Geac

    Patrice Guest

    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$4all.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" <> wrote in message
    > news:4295c03e$0$157$4all.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:%...
    > > > "Mindy Geac" <> wrote in message
    > > > news:4295a8a0$0$4230$4all.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
    > > >
    > > >

    > >
    > >

    >
    >
    Patrice, May 26, 2005
    #7
  8. Mindy Geac

    Roland Hall Guest

    "Mindy Geac" wrote in message news:4295c1a8$0$155$4all.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
    Roland Hall, May 27, 2005
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Shohet

    can asp.net get the computername?

    Jason Shohet, Jan 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,271
    Kevin Spencer
    Jan 15, 2004
  2. Joseph

    Gather Local ComputerName

    Joseph, Apr 23, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,760
    Joseph
    Apr 23, 2004
  3. amjad
    Replies:
    0
    Views:
    544
    amjad
    Nov 24, 2005
  4. dthmtlgod

    ComputerName of Remote User

    dthmtlgod, Aug 26, 2004, in forum: ASP General
    Replies:
    2
    Views:
    162
    dthmtlgod
    Aug 26, 2004
  5. Anatoli Hristov

    Change computername

    Anatoli Hristov, Oct 17, 2012, in forum: Python
    Replies:
    0
    Views:
    87
    Anatoli Hristov
    Oct 17, 2012
Loading...

Share This Page