⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 env_test.cpp

📁 测试系统环境变量的程序
💻 CPP
字号:
/********************************************************************/
/***  ENV_TEST                                                    ***/
/***                                                              ***/
/***  This CGI program generates a HTML document listing all      ***/
/***  environment variables available to it.                      ***/
/***                                                              ***/
/***  ENV_TEST could be called directly from a URL, like this     ***/
/***      http://www.some.domain/scriptdir/env_test.exe           ***/
/***                                                              ***/
/***  It could also be called as the ACTION taken on a HTML form  ***/
/***  submit, ie:                                                 ***/
/***      <html>                                                  ***/
/***      <body>                                                  ***/
/***      <form action="/scriptdir/env_test.exe">                 ***/
/***      <input type=...>                                        ***/
/***      <input type=...>                                        ***/
/***      <input type="submit" value="submit">                    ***/
/***      </form>                                                 ***/
/***      </body>                                                 ***/
/***      </html>                                                 ***/
/***                                                              ***/
/********************************************************************/

#include <stdio.h>

int main( int argc, char **argv, char **env )
  {
	 int i=0;

	 argc; argv; /* Just to make them used. */


	 /****************************/
	 /***  Output MIME header  ***/
	 /****************************/
	 printf( "Content-type: text/html\n\n" );

	 /**********************************/
	 /***  Output the HTML document  ***/
	 /**********************************/
	 printf( "<html><body>" );
	 printf( "<H1>Environment Variables</H1>" );
	 printf( "CGI environment variables are:<br>" );

	 /* Here comes the environment */
	 while( env[i] ) printf( "%s<br>", env[i++] );

	 printf( "</body></html>" );

	 /*********************/
	 /*** Done. Return  ***/
	 /*********************/
	 return 0;
  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -