I wanne write a web server by C# which can handle asp requests.
how can I do it?
I wanne write a web server by C# which can handle asp requests. how
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The ASP.Net runtime can be hosted by any process you’d like, and it’s actually quite simple to do. The key is in using the HttpRuntime class.
From my answer on the “Hidden Features of ASP.Net” thread:
And then in your webserver class:
Obviously this isn’t really a webserver, but what it shows is the processing of a request for an aspx page, parsing the page, and dumping the result to a text file.
To write a real server you’d obviously need to get into listening and accepting requests from socket connections, but the point is that you can easily leverage the asp.net runtime to crunch your pages for you, and write all your own logic for how to serve them up.