Detecting if browser runs on the server

G

Guest

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
 
K

Ken Cox [Microsoft MVP]

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?
 
S

Sayed Hashimi

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
 
G

Guest

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
 
G

Guest

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
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top