如何使用C#创建Web服务器 [英] How to create a webserver using C#

查看:141
本文介绍了如何使用C#创建Web服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过 [ ^ ]。



出于某种原因,我无法弄清楚Mime.Dat,VDirs.Dat和Default.Dat中的内容。



例如对于Default.Dat,只需使用default.html default.htm,index.html Index.htm行创建一个dat文件; ?这是怎么回事?



我尝试过的事情:



使用C#创建自己的Web服务器 [ ^ ]

I am following the tutorial by [^].

For some reason , I just can't figure out what goes in Mime.Dat , VDirs.Dat and Default.Dat.

For ex. for Default.Dat just create a dat file with the line default.html default.htm Index.html Index.htm; ? Is that how it supposed to work ?

What I have tried:

Create your own Web Server using C#[^]

推荐答案

文章描述告诉每个文件放什么。

Mime.dat包含

.html ; text / html .htm; text / html .gif; image / gif .bmp; image / bmp

Vdirs.dat包含

/; C:\ myWebServerRoot / / test /; C:\ myWebServerRoot \ Imtiaz \

Default.dat包含

default.html default.htm Index.html Index.htm ;



这假设您创建了一个目录为C:\ myWebServerRoot的子目录为C:\ myWebServerRoot \ Data
3个文件进入数据可怕ctory。

程序将读取这些文件,以了解如何处理您的网络服务器。
The article description tells what to put in each file.
Mime.dat contains
".html; text/html .htm; text/html .gif; image/gif .bmp; image/bmp"
Vdirs.dat contains
"/; C:\myWebServerRoot/ /test/; C:\myWebServerRoot\Imtiaz\"
Default.dat contains
"default.html default.htm Index.html Index.htm;"

This assumes that you created your directory a "C:\myWebServerRoot" with a subdirectory of "C:\myWebServerRoot\Data"
The 3 files go into the data directory.
The program will read these files for the configuration on what to do with your webserver.


这篇关于如何使用C#创建Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆