Hi all,
Console Application:
I want my console application to do this:
1) Request.ServerVariables("SCRIPT_NAME")
2) Server.Mappath("..")
I don't know how to do this in a C# console application.
Though I used the following to get the Path but, I feel that is not what I wanted to do:
Environment.CurrentDirectory
Please help me on this.
Thanks,
Loading
Anupam KakkarPosted Aug 17, 2011, 1:42 PM
Thank you all,
Sam HobbsPosted Aug 12, 2011, 7:43 PM
A console application executes in a separate process so if there was one console application for each ASP session there would be too many processes for the server. Note that statements such as "Request.ServerVariables" and "Server.Mappath" execute in the server, not the client.
As a result of executing in a separate process, a console application executes with full privileges, which means they can do much more in a system (the server) than any sane person would allow a web site to do.
Note that for web sites, the closest thing to a console application is Common Gateway Interface (CGI). It is old and archaic and not even supported for most webs, but it is like a console application that executes in a web site.
Guest UserPosted Aug 12, 2011, 2:14 PM