How to obtain Server Name

Last post 07-05-2007 1:24 AM by mvark. 4 replies.

Sort Posts:

  • How to obtain Server Name

    07-04-2007, 8:32 AM
    • Loading...
    • akyash
    • Joined on 05-17-2007, 4:59 AM
    • Posts 50

    hi,

      Can anyone suggest me that how can i get the derver name by using asp.net from the localhost computer. so that i can give the server name at LDAP://{servername}

    thanks in advance

    aks

    Thanks
    Ajeet kumar
    .................................................
    Please click "Mark as Answer" on the posts that help you.
  • Re: How to obtain Server Name

    07-04-2007, 8:42 AM
    • Loading...
    • Jean-Paul
    • Joined on 08-18-2005, 10:24 AM
    • the Netherlands
    • Posts 86

    try setting debugging on, then you see all kind of interesting servervariables :)

    (dont know them exactly from memory)

    There are 10 kinds of people: Those who understand binary and those who do not
    ---
    If the reply answered your question please Mark it as "Answered". This would help people know that the question has been answered.
  • Re: How to obtain Server Name

    07-04-2007, 8:51 AM
    • Loading...
    • Novice.Net
    • Joined on 06-24-2007, 11:42 AM
    • UK
    • Posts 13

    You don't need a server name as you can bind serverless. Either you can bind to the namespace of AD or you can bind to RootDSE and then get the well-known naming context of defaultnamingcontext

    Paul
  • Re: How to obtain Server Name

    07-04-2007, 11:57 PM
    • Loading...
    • akyash
    • Joined on 05-17-2007, 4:59 AM
    • Posts 50

    hi paul,

    Ya you right but not in the case when you are using local machine account.

    Means You can't use it from local machine :)

    any way, Thanks for your interest

    Thanks
    Ajeet kumar
    .................................................
    Please click "Mark as Answer" on the posts that help you.
  • Re: How to obtain Server Name

    07-05-2007, 1:24 AM
    Answer
    • Loading...
    • mvark
    • Joined on 09-15-2005, 9:33 AM
    • Posts 436

    Use -
    Request.ServerVariables["SERVER_NAME"]
    or
    Request.ServerVariables["LOCAL_ADDR"]

    The list of Server Variables that you can extract info from, is here - http://www.w3schools.com/asp/coll_servervariables.asp

Page 1 of 1 (5 items)
Microsoft Communities
Page view counter