[STATHread]
你写错了H小写
[STAThread]
解决方案 »
- 请问delegate.begininvoke创建的线程如何终止
- 三个问题,应该是跟数组,类型转换,SqlParameter有关
- C# 如何给html控件text1(input)写入数据?
- 急,急,急,急 怎么样将oracle中blob类型数据怎么插入到sql server中image字段??[
- socket编程中服务端如何设置ip的问题
- 在GUI中,怎么将Panel的尺寸随着form的改变而改变啊
- 用C#可不可以创建黑白的位图对象????
- 连接数据出问题(40分)
- 新手,求助
- 为什么用iframe去加载水晶报表 点击过水晶报表页面之后再点击其它页面 iframe的main主页面会另起一页?
- 有关.net library的继承?
- 关于记录修改问题,急急急
The type or namespace name 'STAThread' could not be found <are you missing a using directive or an assembly reference?>
The type or namespace name 'STAThread' could not be found <are you missing a using directive or an assembly reference?>
{
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 则无需用。
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的时候,却报运行时错误,实在搞不懂了,请帮忙测试这一过程,告诉小弟哪错了,多谢!
{
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>