We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 27,014 times

Contents

Downloads

Related Categories

Create your own Web Server using C# - Summary

Imtiaz Alam

Summary

This article explains how to write a simple web server application using C#. Though it can be developed in any .net supported language, I chose C# for this example. The code is compiled using beta2. Microsoft (R) Visual C# Compiler Version 7.00.9254 [CLR version v1.0.2914]. It can be used with Beta1 with some minor modification. This application can co-exists with IIS or any web server, the key is to choose any free port. I assume that the user has some basic understanding of .net and C# or VB.Net. This Web server just returns html formatted files and also supports images. It does not supports any kind of scripting. I have developed a console-based application for simplicity.

Imtiaz Alam is a Senior Developer, currently residing in Phoenix, Arizona. He has more than five years of development experience in developing Mirosoft based Solution.

Imtiaz Alam is a Senior Developer, currently residing in Phoenix, Arizona. He has more than five years of development experience in developing Mirosoft based Solution. He can be reached at alamimtiaz@hotmail.com

Comments

  • Re: [1775] Create your own Web Server using C#

    Posted by michemal on 22 Jun 2007

    I was looking for a web server and came across a couple of other
    options, of course there is cassni / aka webdev but i tried this http://www.neokernel.com serv...

  • compression?

    Posted by rahulgarware on 01 Dec 2005

    How do you extend this to enable HTTP data compression?
    header:
    content-encoding=gzip

  • No Entry Point

    Posted by Aschehoug on 29 Jul 2005

    This code has no entry point. When compiling, I only get "error CS5001: Program 'c:\MyWebServer\MyWebServer.exe' does not have an entry point defined". I know that it is looking for a "Main()", but I ...

  • Posted by Michael H on 07 Sep 2004

    Hehe, I moved permanently to C# only a month or 2 after
    creating this thread :).

    I now have trouble reading VB code. Array access looks like
    function calls, etc... :cool:

  • Posted by SErhio on 07 Sep 2004

    i find c# more comprehensible then VB.
    for a C# programmer is more difficult for read VB code...