using System;namespace CGI
{
class test
{
[STAThread]
static void Main(string[] args)
{ Console.Write("Content-Type:text/html\n\n");
Console.WriteLine("Content-Type:text/html\n");
Console.Write("<html>\n");
Console.Write("<head>\n");
Console.Write("</head>\n");
Console.Write("<body>\n");
Console.Write("<p>the test cgi \n");
Console.Write("<body>\n");
Console.Write("<html>\n");
}
}
}
{
class test
{
[STAThread]
static void Main(string[] args)
{ Console.Write("Content-Type:text/html\n\n");
Console.WriteLine("Content-Type:text/html\n");
Console.Write("<html>\n");
Console.Write("<head>\n");
Console.Write("</head>\n");
Console.Write("<body>\n");
Console.Write("<p>the test cgi \n");
Console.Write("<body>\n");
Console.Write("<html>\n");
}
}
}
Console.WriteLine("Content-Type:text/html\n");功能一样 去掉一句
谢谢,这样的确可以写CGI。但在C#和IIS中是否可以实现下面的功能:
下面是实际使用的“multipart/x-mixed-replace”类型:
Content-type:multipart/x-mixed-replace;boundary=ThisRandomString
--ThisRandomString
Content-type:text/plain
第一个对象的数据
--ThisRandomString
Content-type:text/plain
第二个(最后一个)对象的数据。
--ThisRandomString--
你是要写Server Push 的cgi程序噢
我写过一个,但没有成功 :(
你试一试,成功了别忘了告诉经验:)