Live Chat Icon For mobile
Live Chat Icon

WinForms FAQ - CGI

Find answers for the most frequently asked questions
Expand All Collapse All

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)
		if(args.GetLength(0) == 0)
			Console.WriteLine('The time now is {0}', System.DateTime.Now.ToString());
			Console.WriteLine('Hi {0}, the time now is {1}', args[0], System.DateTime.Now.ToString());
		foreach(string s in Environment.GetEnvironmentVariables().Keys)
{0} : {1}
',s, Environment.GetEnvironmentVariables()[s]);

Share with

Share on twitter
Share on facebook
Share on linkedin

Couldn't find the FAQs you're looking for?

Please submit your question and answer.