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

📄 utildisplay.cpp

📁 一个国外学生做的基于Web浏览器的email程序
💻 CPP
字号:
#include "webemail.h"void cfgstatus() //displays basic configuration info{	passwd *info;	cout << "content-type: text/plain" << endl;	cout << "Pragma: no-cache" << endl << endl;	cout << "Web Mail Config Status" << endl;	cout << "Version: " << VER << endl;	cout << "Executable name: " << EMAILPATH << endl;	cout << endl;	cout << "User ID: ";	cout << getuid() << endl;	info=getpwuid(getuid());	cout << "(" << info->pw_name << ")" << endl;	cout << "User Group: ";	cout << getgid() << endl << endl;	cout << "Effective user id: ";	cout << geteuid() << endl;	info=getpwuid(geteuid());	cout << "(" << info->pw_name << ")" << endl;	cout << "Effective Group: ";	cout << getgid() << endl; 	cout << endl;	cout << "#Defines" << endl;	cout << "------------------------------" << endl;	#ifdef HAS_SHADOW	  cout << "Using shadow passwords." << endl;	#endif	if (USEATTACHMENTS)	  cout << "Using UUencode attachments." << endl;	if (USEQUOTAS)	  cout << "Using mail box quota: " << MAX_MBOX_SIZE << endl;	if (USEEXTERNMAIL)	  cout << "Using Fetchmail." << endl;	cout << "SendMailPath: " << SENDMAIL << endl;	return;}void error(char *mes) //error messages{	cout << "Content-type: text/HTML" << endl;	cout << "Pragma: no-cache" << endl << endl;	cout << "<html>" << endl;	cout << "<head>" << endl;	cout << "<title>Web E-Mail</title>" << endl;	cout << "<META HTTP-EQUIV=\"expires\" content=\"0\">" << endl;	cout << "</head>" << endl;	cout << "<body text=\"#000000\" bgcolor=\"#FFFFFF\" link=\"#0000EF\"";	cout << " vlink=\"#0000EF\" alink=\"#FF0000\" background=/email/bg1.gif>" << endl;	cout << "&nbsp;";	header(WEM_Error);	cout << "<br>" << WEM_An_error_has_occurred; 	cout << WEM_Please_contact;	cout << "<center>" << endl;	cout << "<p><u><font color=\"#000000\">" << endl;	cout << mes;	cout << "</font></u></center>" << endl;	cout << "<p>" << endl;	tail();		cout << "</body>" << endl;	cout << "</html>" << endl;	exit(1);	return;}void header(char title[500]){	cout << "<table CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH=\"100%\" NOSAVE>" << endl;	cout << "<tr NOSAVE><td NOSAVE>" << endl;	cout << "<b><font size=\"+4\">" << title << "</font></b>" << endl;	cout << "<font size=-1>&nbsp;&nbsp;&nbsp;(" << globaluser << ")</font>" << endl;	cout << "</td><td NOSAVE>" << endl;	cout << "<div align=right>" << endl;	cout << "&lt;&nbsp;<a href=\"" << EMAILPATH << "\" TARGET=_top>" << WEM_Main << "</a>&nbsp;-&nbsp;";	cout << "<a href=\"" << EMAILPATH << "?write\" TARGET=_top>" << WEM_Compose << "</a>&nbsp;-&nbsp;";	cout << "<a href=\"" << EMAILPATH << "?book\" TARGET=_top>" << WEM_Address_Book << "</a>&nbsp;-&nbsp;";	cout << "<a href=\"" << EMAILPATH << "?about\" TARGET=_top>" << WEM_About << "</a>&nbsp;-&nbsp;";	cout << "<a href=\"" << EMAILPATH << "?reset\" TARGET=_top>" << WEM_Logout << "</a>&nbsp;>";	cout << "</div>" << endl;	cout << "</td></tr></table><hr WIDTH=\"100%\">" << endl;}void tail(){	cout << "<hr WIDTH=\"100%\">" << endl;	cout << "<br>" << WEM_Questions_or_comments_Refer_to;	cout << "<a href=\"http://ashaw.dyn.cheapnet.net/webmail/support.html\">";	cout << "ashaw.dyn.cheapnet.net/webmail/support.html</a>" << endl;}void about(){	cout << "Content-type: text/HTML" << endl;	cout << "Pragma: no-cache" << endl << endl;	cout << "<html>" << endl;	cout << "<head>" << endl;	cout << "<title>Web E-Mail</title>" << endl;	cout << "<meta http-equiv=\"expires\" content=\"0\">" << endl;	cout << "</head>" << endl;	cout << "<body text=\"#000000\" bgcolor=\"#FFFFFF\" link=\"#0000EF\" vlink=\"#0000EF\" alink=\"#FF0000\" background=/email/bg1.gif>";	header("About");	cout << "<center><font size=+2>Web E-Mail " << VER << "</font>" << endl;	cout << "<p>Written by Andrew Shaw.&nbsp; See README&nbsp;for license information.";	cout << "<p>Copyright &copy; 1999 Andrew Shaw, All rights reserved.</center>";	tail();	cout << "</body>" << endl;	cout << "</html>" << endl;	return;}//busts up html tags to prevent js attacksvoid distroytag(char *data, char *tag){	int i = 0;	while (data[i] != '\0')	{		if (strncasecmp(data+i, tag, strlen(tag)) == 0)			data[i] = '*';		i++;	}}

⌨️ 快捷键说明

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