What are you trying to do exactly? Create a CGI style EXE?
Console doesn't have a Content Type property to start with. If you want to write output to StdOut you simply use Console.Write() and you must write out the content type header as text with Console.WriteLine() or the like.
FWIW, you'll also need a proper HTTP protocol header - content type alone is not an invalid header.
A proper HTTP response looks like this:
Console.Write(
@"HTTP/1.1 200 OK
Content-type: text/html
Response content goes here
");
+++ Rick ---
>Hi All,
>
>I am trying to set a HTTP header to "text/html" and I am having no joy.
>
>This is what I have so far... Am I far off? How can I do this?
>
>
>using System;
>
>class Hello
>{
> static void Main()
> {
> Console.ContentType = "text/html";
> Console.WriteLine("Hello World");
> }
>}
>
>
>This is the c++ of what I want to do but in c#.
>
>
>#include <iostream.h>
>
>int main(){
> cout << "Content-type: text/plain" << endl << endl
> << "Hello World";
>}
>
>
>Can some-one please offer some help on this. It is really doing my head in.
>
>Thanks and Kind Regards,
>Tarran Walker