![html executable how to use built in server html executable how to use built in server](https://usermanual.wiki/adobe/robohelp2017ugen.682479107-User-Guide-Page-1.png)
Now we will write the function, to build and sends header information to the browser (client)
![html executable how to use built in server html executable how to use built in server](https://www.formations.eranet-info.com/wp-content/uploads/2017/03/2016-1536x1024.png)
sMyWebServerRoot = sMyWebServerRoot.ToLower().public string GetLocalPath( string sMyWebServerRoot, string sDirName).The GetTheDefaultFileName function takes the directory path as input, open the default.dat file and looks for the file in the directory provided and returns the file name or blank depends on the situation. We have already stored the default file name in the default.dat and stored in the data directory. Now let us assume that the user does not supplies the file name, in that case we have to identify the default filename and send to the browser, as in IIS we define the default document under documents tab. We defined namespace, included the references required in our application and initialized the port in the constructor, started the listener and created a new thread and called startlisten function. Console.WriteLine( "An Exception Occurred while Listening :" + e.ToString()).Thread th = new Thread( new ThreadStart(StartListen)).//start the thread which calls the method 'StartListen'.Console.WriteLine( "Web Server Running. Press ^C to Stop." ).//given port. It also calls a Thread on the method StartListen().//The constructor which make the TcpListener start listening on th.private int port = 5050 // Select any free port you wish.Mime.Dat will have the mime type supported by our web server. We will Create three files under data directory i.e. Eg: C:\MyPersonalwebServer, and will create a Data directory underneath, our root directory Eg: C:\MyPersonalwebServer\Data. I have developed a console-based application for simplicity.įirst we will define the root folder for our web server. It does not loads the embedded image or supports any kind of scripting. This Web server just returns html formatted files and also supports images.
![html executable how to use built in server html executable how to use built in server](https://codetoprosper.com/wp-content/uploads/2021/05/browser-window-1024x623.jpg)
I assume that the user has some basic understanding of.
HTML EXECUTABLE HOW TO USE BUILT IN SERVER FREE
This application can co-exists with IIS or any web server, the key is to choose any free port. It can be used with Beta1 with some minor modification. Microsoft (R) Visual C# Compiler Version. net supported language, I chose C# for this example. SUMMARY: This article explains how to write a simple web server application using C#.