📄 webdoc1.c
字号:
//-----------------------------------------------------------------------------
// Net WEBDOC.C
//
// This module contains web pages and headers
//-----------------------------------------------------------------------------
#include "net.h"
// This is the header for web text pages. LENGTH is the body
// length, needed because in HTTP 1.1 we leave connection open
// Includes control statements to prevent browser from caching page
char code html_header[] = {
"HTTP/1.1 200 OK\n"
"Cache-control: no-cache\n"
"Connection: Keep-Alive\n"
"Content-Length: TAG:LEN1\n"
"Content-Type: text/html\r\n\r\n" };
// This page displays a table with weather data and a switch
// to turn a port pin on and off.
char code web_page[] = {
"<HTML><HEAD><TITLE>YG-51WEB单片机上网开发板Web Server</TITLE>\n"
"<META http-equiv=Content-Type content=\"text/html; charset=gb2312\">\n"
/*"<META http-equiv=\"refresh\" content=\"5\">"*/
"<META content=\"Microsoft FrontPage 5.0\" name=GENERATOR></HEAD>\n"
"<BODY>\n"
"<FORM action=/index.html method=post>\n"
"<TABLE border=0 width=\"786\">\n"
"<TBODY>\n"
"<TR>\n"
"<TD width=\"739\">\n"
"<H1> \n"
"<a href=\"http://www.mcusky.com\" target=\"_blank\">"
"<IMG src=\"photo1.jpg\" width=\"272\" height=\"58\"></H1></a>\n"
"<H1><font size=\"4\"></font><font size=\"4\"> YG-51WEB单片机上网开发板Web Server \n"
"演示程序</font></H1>\n"
"<TABLE border=2 width=\"419\">\n"
"<TBODY>\n"
"<TR>\n"
"<TD width=235 height=25>\n"
"<p align=\"center\"><font face=\"宋体\">系统温度</font></TD>\n"
"<TD width=166 height=25 align=\"center\">TAG:TMP1℃</TD></TR>\n"
"<TR>\n"
"<TD width=235 height=25>\n"
"<p align=\"center\">ADC输入电压</TD>\n"
"<TD width=166 height=25 align=\"center\">TAG:TMP2V</TD></TR>\n"
"</TABLE><BR><BR> LED指示灯: \n"
" <INPUT type=radio CHECKED value=1 name=switch>灭 <INPUT type=radio \n"
"value=0 name=switch TAG:CHK2>亮 <INPUT type=submit value=发送> </TD>\n"
"<TD width=\"37\"><BR> \n"
"</TD></TR>\n"
"<TR>\n"
"<TD width=\"739\">\n"
"</TD>\n"
"<TD width=\"37\"> </TD></TR></TBODY></TABLE></FORM></BODY></HTML>\n"
};
// This is the header for jpeg graphic pages. TAG2 is the body
// length, needed because in HTTP 1.1 we leave connection open
// Includes control statements to prevent browser from caching page
char code jpeg_header[] = {
"HTTP/1.1 200 OK\n"
"Cache-control: no-cache\n"
"Connection: Keep-Alive\n"
"Content-Length: TAG:LEN2\n"
"Content-Type: image/jpeg\r\n\r\n"};
// This is jpeg image of the board which gets displayed on the web
// page - to exercise capabilities of this server to send files
// which span multple TCP segments. This image is 6194 bytes.
UCHAR code photo1_jpeg[] = {
255,216,255,224,0,16,74,70,73,70,0,1,2,0,0,1,
0,1,0,0,255,225,14,61,69,120,105,102,0,0,73,73,
42,0,8,0,0,0,8,0,18,1,3,0,1,0,0,0,
1,0,0,0,26,1,5,0,1,0,0,0,110,0,0,0,
27,1,5,0,1,0,0,0,118,0,0,0,40,1,3,0,
1,0,0,0,2,0,0,0,49,1,2,0,28,0,0,0,
126,0,0,0,50,1,2,0,20,0,0,0,154,0,0,0,
19,2,3,0,1,0,0,0,1,0,0,0,105,135,4,0,
1,0,0,0,174,0,0,0,26,1,0,0,44,1,0,0,
1,0,0,0,44,1,0,0,1,0,0,0,65,67,68,32,
83,121,115,116,101,109,115,32,68,105,103,105,116,97,108,32,
73,109,97,103,105,110,103,0,50,48,48,52,58,48,55,58,
50,55,32,49,53,58,52,54,58,51,56,0,6,0,0,144,
7,0,4,0,0,0,48,50,49,48,144,146,2,0,4,0,
0,0,53,57,51,0,1,160,3,0,1,0,0,0,255,255,
0,0,2,160,4,0,1,0,0,0,16,1,0,0,3,160,
4,0,1,0,0,0,58,0,0,0,5,160,4,0,1,0,
0,0,252,0,0,0,0,0,0,0,2,0,1,0,2,0,
4,0,0,0,82,57,56,0,2,0,7,0,4,0,0,0,
48,49,48,48,0,0,0,0,3,0,3,1,3,0,1,0,
0,0,6,0,0,0,1,2,4,0,1,0,0,0,68,1,
0,0,2,2,4,0,1,0,0,0,241,12,0,0,0,0,
0,0,255,216,255,225,0,230,69,120,105,102,0,0,73,73,
42,0,8,0,0,0,5,0,18,1,3,0,1,0,0,0,
1,0,0,0,49,1,2,0,28,0,0,0,74,0,0,0,
50,1,2,0,20,0,0,0,102,0,0,0,19,2,3,0,
1,0,0,0,1,0,0,0,105,135,4,0,1,0,0,0,
122,0,0,0,0,0,0,0,65,67,68,32,83,121,115,116,
101,109,115,32,68,105,103,105,116,97,108,32,73,109,97,103,
105,110,103,0,50,48,48,52,58,48,55,58,50,55,32,49,
53,58,52,54,58,51,56,0,5,0,0,144,7,0,4,0,
0,0,48,50,49,48,144,146,2,0,4,0,0,0,53,57,
51,0,2,160,4,0,1,0,0,0,160,0,0,0,3,160,
4,0,1,0,0,0,34,0,0,0,5,160,4,0,1,0,
0,0,188,0,0,0,0,0,0,0,2,0,1,0,2,0,
4,0,0,0,82,57,56,0,2,0,7,0,4,0,0,0,
48,49,48,48,0,0,0,0,0,0,0,0,255,192,0,17,
8,0,34,0,160,3,1,34,0,2,17,1,3,17,1,255,
219,0,132,0,7,4,5,6,5,4,7,6,5,6,7,7,
7,8,10,17,11,10,9,9,10,21,15,16,12,17,25,22,
26,26,24,22,24,24,28,31,40,34,28,29,38,30,24,24,
35,47,35,38,41,42,45,45,45,27,33,49,52,49,43,52,
40,44,45,43,1,11,11,11,15,13,15,30,17,17,30,64,
43,36,43,64,64,64,64,64,64,64,64,64,64,64,64,64,
64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
64,64,64,64,64,255,196,1,162,0,0,1,5,1,1,1,
1,1,1,0,0,0,0,0,0,0,0,1,2,3,4,5,
6,7,8,9,10,11,16,0,2,1,3,3,2,4,3,5,
5,4,4,0,0,1,125,1,2,3,0,4,17,5,18,33,
49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,
66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,
24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,
67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,
99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,
131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,
154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,
184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,
214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,
242,243,244,245,246,247,248,249,250,1,0,3,1,1,1,1,
1,1,1,1,1,0,0,0,0,0,0,1,2,3,4,5,
6,7,8,9,10,11,17,0,2,1,2,4,4,3,4,7,
5,4,4,0,1,2,119,0,1,2,3,17,4,5,33,49,
6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,
177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,
37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,
58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,
90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,
122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,
152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,
182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,
212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,
242,243,244,245,246,247,248,249,250,255,218,0,12,3,1,0,
2,17,3,17,0,63,0,236,64,44,64,28,147,80,92,95,
88,219,33,107,139,235,100,0,224,128,225,142,125,48,57,166,
234,81,220,77,167,207,21,155,162,77,34,20,86,124,224,103,
131,211,219,53,205,29,22,195,74,242,133,246,253,75,80,148,
126,230,213,126,88,201,206,6,125,179,234,121,244,175,87,19,
94,165,55,238,173,59,189,143,63,1,130,161,136,77,212,155,
78,250,70,42,237,247,119,122,37,230,206,162,202,238,214,250,
22,154,206,117,146,36,36,59,159,151,110,57,231,61,56,172,
233,245,214,186,149,173,180,11,127,182,56,59,94,233,248,134,
51,255,0,179,86,3,193,53,147,69,166,223,219,203,125,113,
41,105,198,153,105,32,137,7,251,82,62,61,176,0,244,235,
91,218,118,165,169,37,229,165,141,198,133,103,99,109,42,72,
71,147,62,227,18,168,235,128,49,141,197,71,227,83,7,136,
173,21,205,238,175,199,254,7,230,93,106,120,44,45,71,200,
253,175,111,229,94,173,91,155,229,101,234,107,253,122,210,170,
179,125,213,39,232,41,146,203,20,49,180,183,18,164,81,160,
203,59,156,5,21,201,235,122,245,208,188,187,142,203,92,186,
123,117,131,205,140,91,219,227,107,19,247,75,99,59,64,254,
42,237,74,231,146,217,215,178,178,28,48,32,251,210,170,51,
103,104,206,58,214,55,133,239,98,146,217,109,127,226,108,242,
132,243,76,183,177,144,173,156,100,43,122,100,228,125,106,149,
254,177,113,61,237,172,114,216,128,246,183,15,59,44,242,45,
186,96,18,177,101,152,156,247,62,253,189,105,216,46,116,132,
17,212,98,138,173,166,173,218,219,147,125,63,156,206,219,212,
112,124,176,121,218,24,125,224,14,112,125,42,143,137,117,123,
189,49,98,251,13,238,159,16,110,36,89,70,249,23,61,8,
81,206,58,246,165,96,185,175,69,83,209,111,5,221,144,221,
61,205,204,136,112,243,79,110,97,243,51,206,84,99,165,71,
121,171,65,107,171,193,111,45,244,41,9,134,86,149,87,231,
33,134,48,14,50,71,27,141,0,104,144,71,80,69,37,99,
232,90,176,186,212,175,32,103,158,111,58,121,94,218,76,230,
63,41,72,94,59,138,209,191,186,146,206,15,50,43,41,111,
31,114,168,134,54,218,78,78,51,159,106,44,23,39,165,68,
103,108,40,201,172,141,31,93,187,213,175,29,99,210,163,183,
179,141,154,57,36,105,119,56,113,219,223,242,239,76,241,69,
229,163,53,182,147,113,118,176,45,195,249,151,45,207,201,18,
229,177,199,66,196,99,240,167,96,185,182,80,175,92,103,174,
51,206,61,113,77,174,78,199,92,15,173,92,77,5,156,34,
242,228,162,66,215,110,195,108,36,13,138,170,160,158,71,36,
251,215,71,168,95,27,70,242,237,237,102,184,156,163,72,160,
68,197,0,94,78,72,238,70,112,59,208,211,65,114,200,42,
203,185,29,28,2,84,148,108,224,142,163,235,72,126,233,250,
87,43,165,106,179,194,46,110,44,144,178,201,47,153,246,88,
109,134,39,98,126,99,130,197,148,96,125,238,153,237,197,117,
108,65,4,128,64,35,161,161,171,2,119,17,216,71,27,59,
135,42,170,88,133,25,36,15,65,92,243,105,51,248,136,75,
125,168,121,214,110,216,91,72,135,88,144,114,55,14,228,146,
107,38,47,25,106,209,70,17,76,4,47,25,49,242,107,185,
178,211,103,185,210,96,212,31,84,218,210,104,82,106,45,106,
9,243,12,163,161,31,46,60,190,64,198,115,154,231,196,81,
140,173,237,30,157,142,236,22,42,165,14,105,81,94,254,154,
246,93,151,77,122,249,104,114,210,235,154,190,134,18,207,82,
40,207,35,4,183,187,242,188,214,111,96,185,27,143,35,131,
211,61,235,95,69,183,212,195,201,121,173,92,164,215,83,162,
46,196,136,40,133,87,39,104,35,175,222,201,247,170,114,201,
112,218,87,133,181,87,212,35,251,86,177,113,44,5,154,207,
119,217,144,72,168,74,30,188,117,35,248,184,199,74,183,57,
213,79,136,181,189,58,211,86,68,181,210,93,3,77,37,131,
201,35,6,112,152,216,188,146,9,234,56,56,207,74,40,197,
83,92,188,215,245,245,181,182,238,78,38,162,175,53,56,193,
69,189,237,179,123,222,215,211,67,66,93,194,38,43,16,149,
128,56,70,56,12,125,9,172,107,187,27,159,236,77,94,226,
244,35,222,221,194,229,132,32,149,80,170,118,34,247,227,249,
154,171,171,235,26,254,146,186,168,186,185,183,105,116,203,165,
182,101,142,213,138,73,157,223,54,254,139,247,71,7,147,159,
106,181,61,254,169,21,252,150,178,223,197,9,93,74,45,57,
101,146,16,87,126,15,156,199,158,138,219,127,6,173,238,142,
78,86,104,36,183,22,250,60,13,103,105,246,137,196,40,22,
57,27,96,7,104,229,190,158,149,131,125,161,223,94,202,194,
21,150,41,230,83,246,235,153,228,204,119,7,168,85,65,200,
80,120,7,140,10,215,215,44,252,95,161,104,178,234,90,157,
238,150,169,10,40,146,40,211,115,44,197,151,17,30,122,236,
96,249,244,252,234,211,104,254,44,91,22,212,63,181,116,179,
96,170,103,243,132,7,63,103,242,76,162,108,103,56,36,108,
199,92,251,84,170,144,90,221,23,236,102,244,177,14,159,170,
45,196,139,109,54,153,125,103,50,252,167,49,102,28,143,238,
183,167,28,100,85,27,237,51,251,126,243,55,86,15,99,111,
15,241,229,124,233,219,24,4,178,231,10,59,12,213,189,14,
203,197,250,246,145,14,161,166,94,233,133,103,66,35,138,68,
218,205,48,118,6,46,189,66,41,124,250,26,202,58,223,136,
27,92,77,50,23,138,72,229,190,54,48,223,125,152,136,165,
125,225,114,57,193,234,14,51,208,213,41,43,180,158,196,184,
73,36,218,220,191,111,170,234,150,183,38,207,82,210,174,47,
17,91,108,119,208,21,220,235,216,176,233,159,94,149,87,88,
240,235,234,90,197,204,171,20,86,209,24,8,89,85,142,233,
164,56,193,97,232,48,56,239,138,214,214,52,239,17,233,122,
101,205,239,246,230,157,116,109,226,150,67,10,217,58,150,242,
165,242,229,27,137,192,193,35,30,190,195,154,206,214,46,188,
65,164,232,48,234,51,223,65,36,210,65,21,203,90,165,132,
155,35,142,92,236,62,119,221,207,28,131,143,98,105,70,113,
127,11,252,199,42,114,91,162,165,173,173,213,156,55,134,211,
64,185,91,219,136,158,51,43,94,169,141,75,18,73,81,216,
100,244,246,21,174,103,215,138,70,182,208,233,241,126,237,55,
75,62,231,125,248,27,184,28,117,168,124,66,190,42,208,162,
154,91,155,171,70,72,239,98,179,86,54,204,170,230,72,132,
155,129,244,25,193,199,122,209,183,211,181,168,188,101,165,104,
218,141,252,119,86,122,136,156,173,213,180,107,30,90,52,114,
85,88,22,29,85,115,158,121,193,0,210,117,35,107,220,21,
41,222,214,49,116,221,39,95,211,109,164,138,207,90,133,3,
185,144,131,104,173,150,61,78,79,53,122,125,54,75,137,236,
110,36,242,22,120,164,18,220,178,39,250,210,16,175,31,157,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -