中级会员
 
- 积分
- 441
- 金钱
- 441
- 注册时间
- 2013-7-16
- 在线时间
- 71 小时
|
10金钱
请问 如何把 html 文件转为 .h文件的形式? 如下所示,我见有些例程是这样的形式,但不知道用什么工具转换,请告知
- #ifndef __WEBPAGE_H
- #define __WEBPAGE_H
- #define INDEX_HTML "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\'>"\
- "<html>"\
- "<head>"\
- "<title>W5500EVB - HTTP SERVER</title>"\
- "<style type='text/css'>"\
- "body {text-align:left; background-color:/*#ffc1e0*/#c0deed;font-family:Verdana;}"\
- "#main {margin-right:auto;margin-left:auto;margin-top:30px;}"\
- "label{display:inline-block;width:150px;}"\
- "#main h3{color:#66b3ff; text-decoration:underline;}"\
- "</style>"\
- "<script>"\
- "function $(id) { return document.getElementById(id); };"\
- "function settingsCallback(o) {"\
- "if ($('txtVer')) $('txtVer').value = o.ver;"\
- "if ($('txtMac')) $('txtMac').value = o.mac;"\
- "if ($('txtIp')) $('txtIp').value = o.ip;"\
- "if ($('txtSub')) $('txtSub').value = o.sub;"\
- "if ($('txtGw')) $('txtGw').value = o.gw;"\
- "};"\
- "</script>"\
- "</head>"\
- "<body>"\
- "<div id='main'>"\
- "<div style='background:snow; display:block;padding:10px 20px;'>"\
- "<h3>Device Settings</h3>"\
- "<form id='frmSetting' method='POST' action='config.cgi'>"\
- "<p><label for='txtIp'>Firmware version:</label><input type='text' id='txtVer' name='ver' size='16' disabled='disabled' /></p>"\
- "<p><label for='txtIp'>MAC address:</label><input type='text' id='txtMac' name='mac' size='16' disabled='disabled' /></p>"\
- "<p><label for='txtIp'>IP address:</label><input type='text' id='txtIp' name='ip' size='16' /></p>"\
- "<p><label for='txtSub'>Subnet mask:</label><input type='text' id='txtSub' name='sub' size='16' /></p>"\
- "<p><label for='txtGw'>Default gateway:</label><input type='text' id='txtGw' name='gw' size='16' /></p>"\
- "<p><input type='submit' value='Save Settings and Reboot' /></p>"\
- "</form>"\
- "</div>"\
- "</div>"\
- "<div style='margin:5px 5px;'>"\
- "©Copyright 1998-2013 by WIZnet Team"\
- "</div>"\
- "<script type='text/javascript' src='w5500.js'></script>"\
- "</body>"\
- "</html>"
- #endif
复制代码
|
|