[STATHread]
你写错了H小写
[STAThread]

解决方案 »

  1.   

    还是不行,提示下列错误:
    The type or namespace name 'STAThread' could not be found <are you missing a using directive or an assembly reference?>
      

  2.   

    还是不行,提示下列错误:
    The type or namespace name 'STAThread' could not be found <are you missing a using directive or an assembly reference?>
      

  3.   

    估计是有敲错了,拷贝这个.using System;namespace Hello
    {
    class Hello
    {
    [STAThread] static void Main(string [] args)
    {
    Console.WriteLine("<h1>hello!</h1>"); 
    }
    }}其实,[STAThread]是Single Thread Apartment单线程套间
    是一种线程模型。其它的好像还是MTA(多线程套间)、Free Thread(自由线程)这个属性要加在主 Main 上。这个属性只归 Com Interop 所用,如果全部是 managed code 则无需用。
      

  4.   

    不知为何通过了,怪!我想测试的程序是想用c#编写cgi程序
    test.htm内容为:
    html>
    <form action=http://localhost/bin/hello.exe>
    <input type=submit value="hello">
    </form>
    </html>hello.exe为hello.cs编译后的文件
    虽然hello.cs编译成功了。
    可测试test.htm的时候,却报运行时错误,实在搞不懂了,请帮忙测试这一过程,告诉小弟哪错了,多谢!
      

  5.   

    hello.cs:using System;namespace Hello
    {
    class Hello
    {
    [STAThread] static void Main(string [] args)
    {
                            Console.WriteLine("Content-Type:text/heml\n");
    Console.WriteLine("<h1>你好!</h1>"); 
    }
    }}
    test.htm:
    <html>
    <form action=http://localhost/bin/hello.exe>
    <input type=submit value="hello">
    </form>
    </html>