C
clintonG
I'm using the intrinsic Request object wrong and need some help with this
one. I wrote a class file for some XMLTextWriter tasks and in the class file
I want to use a conditional to determine if the application is running on
the host provider's web server or the web server on my local development
machine. Here is my broken code...
string fileOut;
// Run-time: running on host provider's server
if(Request.ServerVariables["LOCAL_ADDR"] == "XXX.XXX.XXX.XX")
fileOut = HttpContext.Current.Server.MapPath("filename.xml");
else
// Design-time: running on local development server
fileOut = HttpContext.Current.Server.MapPath("filename.xml");
What do I need to change or add to the code in this class file to use the
Request object? Thanks for comments...
one. I wrote a class file for some XMLTextWriter tasks and in the class file
I want to use a conditional to determine if the application is running on
the host provider's web server or the web server on my local development
machine. Here is my broken code...
string fileOut;
// Run-time: running on host provider's server
if(Request.ServerVariables["LOCAL_ADDR"] == "XXX.XXX.XXX.XX")
fileOut = HttpContext.Current.Server.MapPath("filename.xml");
else
// Design-time: running on local development server
fileOut = HttpContext.Current.Server.MapPath("filename.xml");
What do I need to change or add to the code in this class file to use the
Request object? Thanks for comments...