Server Variables

  • Thread starter Thread starter Charles Stanley
  • Start date Start date
C

Charles Stanley

Hi All,

In a WebForm, I'm trying to assign a variable, in this case a label, the IP
address of the user.

The code goes something like this:

Label6.Text = Request.ServerVariables("REMOTE_ADDR");



When compiling this, I get a message telling me that this denotes a property
where a method was expected. I've been all over the help, samples, etc. but
cannot figure out how to do this properly.

Suggestions please!

Thanks,

Charles Stanley
 
Charles,
The code goes something like this:

Label6.Text = Request.ServerVariables("REMOTE_ADDR");

Try:

Label6.Text = Request.ServerVariables["REMOTE_ADDR"];
 
Back
Top