cgi and c# ?

  • Thread starter Thread starter GoodJobFastCar
  • Start date Start date
GoodJobFastCar said:
Suppose I have a simple c# program which does something
like give me the current time.

How would I attach it to a cgi-bin action inside a webserver?

So if my browser sends something like:

http://whatever.com/c_sharp_cgi_date

The webserver would respond with something like:

Nov 16, 2006

??

using System;

public class DotNetCGI
{
public static void Main(string[] args)
{
Console.WriteLine("Status: 200 OK");
Console.WriteLine("Content-Type: text/plain");
Console.WriteLine("");
Console.WriteLine("Today is " + DateTime.Now);
}
}

build in my Apache cgi-bin works as http://localhost/cgi-bin/dotnetcgi !

May I ask why you want to use CGI ? (it is rather mid 1990'ish)

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top