473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to modify servervariables?

Hi,

I have an ASP.Net application which talks to an ASP application. As the
ASP.Net application talk to the ASP application, the REMOTE_ADDR server
variable points to the IP address of the ASP.Net application. I would like
to modify server variables to point to the actual client IP address rather
than ASP.Net application.

Client -ASP.Net (Web application) -ASP (Web application)

Request.ServerVariables["REMOTE_ADDR"] = clientIP;

Above code is throwing an exception.

[PlatformNotSupportedException: Operation is not supported on this
platform.]
System.Web.HttpServerVarsCollection.Set(String name, String value)
+3254625
System.Collections.Specialized.NameValueCollection .set_Item(String name,
String value) +9

I have also tried

Request.ServerVariables.Remove("remote_addr");
Request.ServerVariables.Add("REMOTE_ADDR", clientIP);

This code throws "Cannot directly modify server variables". Any idea how to
tackle this problem?

Thanks,
Sanjib
Feb 17 '08 #1
0 1880

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JW | last post by:
I use Request.ServerVariables("HTTP_REFERER") to get the URL of the referrer page. However, if the page that has Request.ServerVariables("HTTP_REFERER") is in a popup window then the value is...
1
by: JW | last post by:
Sorry, posting this twice as it tagged on to a spetember posting: --------------------------------------------------------------- I use Request.ServerVariables("HTTP_REFERER") to get the URL of...
2
by: W. Loo | last post by:
Hi, I've got a question regarding the usage of Request.ServerVariables. I'm not sure this is really a ASP question, so redirects to a more appropriate newsgroup are welcome. I have a variable...
3
by: crjunk | last post by:
I have the following url: https://test.mywebsite.com/secure/programs/test.asp?TOPIC_ID=21 How can I get the value "secure/programs/test.asp?TOPIC_ID=21" I can't use...
4
by: Martin | last post by:
Hi, From Page1.asp, I use "Server.transfer" to "REDIRECT" to another asp page (page2.asp), in page2.asp I use Request.ServerVariables("URL") and Request.ServerVariables("REFERER") to get the...
2
by: TS | last post by:
I seem to remember reading somewhere that accessing this collection is expensive and you should avoid it if possible. Are there any alternatives to the following: Request.ServerVariables; ...
1
by: preet | last post by:
I posted this elsewhere ; probably the wrong place so i am posting this again I am using the following script: hrefer=Request.Servervariables("HTTP_REFERER")...
1
by: Ryan | last post by:
I am trying to figure out why I am trying to use the result of Request.ServerVariables("LOGON_USER") in a query in my aspx application. I want to use the server variable. When I check the...
2
by: Henry Stock | last post by:
I don't seem to understand how to use the value: Request.ServerVariables("remote_addr") I am trying to pass the ip address of a sending web client in the body of an email message. When I...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.