|
|
|
The General Winforms Interview Questions consists the most frequently
asked questions in Winforms. This list of 100+ questions guage your familiarity
with the Winforms platform. The q&a have been collected over a period
of time from various blogs, forums and other similar Winforms sites
|
56.Framework Tips CGI
|
| 56.1 Can I write CGI
applications using .NET?
|
56.1 Can I write CGI applications using .NET?
|
|
You sure can. Here is a simple CGI program that prints out the current time and
also all the environment variables that are available to it.
|
using System;
public class cgi
{
public static void Main(string[] args)
{
Console.WriteLine("Content-Type:text/html\n\n");
if(args.GetLength(0) == 0)
Console.WriteLine("The time now is {0}", System.DateTime.Now.ToString());
else
Console.WriteLine("Hi {0}, the time now is {1}", args[0],
System.DateTime.Now.ToString());
foreach(string s in Environment.GetEnvironmentVariables().Keys)
Console.WriteLine("
{0} : {1}
",s, Environment.GetEnvironmentVariables()[s]);
}
}
|