我想從卡西尼使用服務器類來包含一個基本的Web服務器在我自己的應用程序。我剛開始玩了,以熟悉的方式,服務器的工作原理和我建立一個簡單的應用程序,如下所示:卡西尼錯誤:「這種類型的頁面沒有提供」
static void Main(string[] args)
{
Server server = new Server(80, "/", @"C:\Projects\");
server.Start();
Console.ReadLine();
server.Stop();
}
它讓我通過目錄瀏覽,但如果我嘗試點擊一個文件中,例如C#源文件(*的.cs),它提供了以下錯誤:
Server Error in '/' Application.
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cs' may be incorrect.
Please review the URL below and make sure that it is spelled correctly.
我試圖尋找在卡西尼庫,錯誤文本,但沒有發現任何東西。
這個錯誤來自哪裏?我怎樣才能讓它提供任何文件? 我知道它意味着做asp.net和HTML,但我希望它也能像普通服務器那樣服務器上的任何文件。
亞當嗨,你好,它是否滿足了HTML和ASPX的內容好嗎? – Kev 2009-01-10 16:54:22
是的......這些都很好。 – 2009-01-10 17:42:18