Detecting if browser runs on the server

Discussion in 'ASP .Net' started by =?Utf-8?B?S2VubmV0aA==?=, Oct 15, 2004.

  1. Hi,

    I've been written an asp.net Intranet application and since it will run on
    an intranet it would be good to be able to detect whether the app runs on the
    same computer that acts as a server or if it's possible to stop him from
    doing so.

    Normally you just enter the ip numbers to the server and startpage in the
    url. And then you surf on the Intranet.

    If everyone uses IE5+ on the client?

    TIA

    /Kenneth
    =?Utf-8?B?S2VubmV0aA==?=, Oct 15, 2004
    #1
    1. Advertising

  2. Could you explain a little more about what you're trying to accomplish? Are
    you trying to detect if the person is browsing the site by sitting at the
    server?

    "Kenneth" <> wrote in message
    news:...
    > Hi,
    >
    > I've been written an asp.net Intranet application and since it will run on
    > an intranet it would be good to be able to detect whether the app runs on
    > the
    > same computer that acts as a server or if it's possible to stop him from
    > doing so.
    >
    > Normally you just enter the ip numbers to the server and startpage in the
    > url. And then you surf on the Intranet.
    >
    > If everyone uses IE5+ on the client?
    >
    > TIA
    >
    > /Kenneth
    Ken Cox [Microsoft MVP], Oct 15, 2004
    #2
    1. Advertising

  3. I think your guess is correct; he wants to be able to detect if
    someone is sitting on the server and trying to run the app. If that
    really is the case, try:

    1) Get the client machine name:

    Request.ServerVariables("REMOTE_HOST")

    2) Server machine name:

    System.Environment.MachineName

    sayed

    "Ken Cox [Microsoft MVP]" <> wrote in message news:<O$>...
    > Could you explain a little more about what you're trying to accomplish? Are
    > you trying to detect if the person is browsing the site by sitting at the
    > server?
    >
    > "Kenneth" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > I've been written an asp.net Intranet application and since it will run on
    > > an intranet it would be good to be able to detect whether the app runs on
    > > the
    > > same computer that acts as a server or if it's possible to stop him from
    > > doing so.
    > >
    > > Normally you just enter the ip numbers to the server and startpage in the
    > > url. And then you surf on the Intranet.
    > >
    > > If everyone uses IE5+ on the client?
    > >
    > > TIA
    > >
    > > /Kenneth
    Sayed Hashimi, Oct 15, 2004
    #3
  4. Sayed,

    Exactly, I tested with some code:

    Dim lc As String = Request.ServerVariables("REMOTE_HOST")
    Response.Write(lc)
    Response.Write("<br>")
    Response.Write(System.Environment.MachineName)

    which ended up in one ip number (127.0.0.1) and one computer name "mjuk"

    It seems we're on the right track, but we have to change the code so both
    responses the same thing to be able to compare them with each other.

    Any suggestions to the code?

    /Kenneth

    "Sayed Hashimi" wrote:

    > I think your guess is correct; he wants to be able to detect if
    > someone is sitting on the server and trying to run the app. If that
    > really is the case, try:
    >
    > 1) Get the client machine name:
    >
    > Request.ServerVariables("REMOTE_HOST")
    >
    > 2) Server machine name:
    >
    > System.Environment.MachineName
    >
    >
    =?Utf-8?B?S2VubmV0aA==?=, Oct 16, 2004
    #4
  5. Ken,

    In my windows applications I detect whether the client starts their app from
    a client computer or from the server. This has to do with licensing issues.
    If I sell an app to a company that is to be used only on one computer
    (1-licens) then I can refuse the app from starting from the client's server.
    Everything installed on the client machine.

    Now I'd like to have the same functionality for Intranet apps.

    I guess that I have to check whether both the IE client and the server are
    on the same computer, perhaps using ServerVariables.

    Any ideas? And code?

    /Kenneth

    "Ken Cox [Microsoft MVP]" wrote:

    > Could you explain a little more about what you're trying to accomplish? Are
    > you trying to detect if the person is browsing the site by sitting at the
    > server?
    =?Utf-8?B?S2VubmV0aA==?=, Oct 16, 2004
    #5
    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. Replies:
    3
    Views:
    392
    Patrick.O.Ige
    Jan 23, 2006
  2. bienwell
    Replies:
    2
    Views:
    804
    bienwell
    Oct 23, 2007
  3. PerlFAQ Server
    Replies:
    0
    Views:
    383
    PerlFAQ Server
    Mar 15, 2011
  4. Mortisus
    Replies:
    2
    Views:
    213
    Mortisus
    Mar 29, 2005
  5. Replies:
    10
    Views:
    229
    Thomas 'PointedEars' Lahn
    Oct 1, 2007
Loading...

Share This Page