声明:这里面的代码均为网上找的然后有小小的改动,并非原创。但文章为原创

一、.编译

  1.1,、下载:进入http://embedthis.com/goahead/下载goahead3.6.3(2017年9月12日还是这版本)

  1.2、解压

  ,

    然后进入goahead-3.6.3-rc目录,进入后为这样

  

  然后在进入goahead-3.6.3

然后在终端中进入goahead-3.6.3,然后输入make进行编译(该方式默认是生成x86架构的程序),如图:

二、简单使用

2.1、首先在生成的可执行文件的同级目录创建一个auth.txt(可以为空)和route.txt(内容为下图中行开始没有‘#’符号的行,#开始表示注释)文件 ,如果不创建的话在运行goahead时需要加参数指定文件,否则goahead无法运行

2.2.在编译生成的二进制文件的同一级目录中创建一个目录(名字随意,这里用web)用来存放html和js文件

   

2.3、在web目录中创建一个文件,名为aspTest.html或aspTest.asp(这里为aspTest.asp),内容为

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<h4>串口状态</h4>
<table id="viewTab" class="viewTab" cellspacing="0" cellpadding="0">
<tr>
<th width="">串口</th>
<th width="">线路协议</th>
<th width="">波特率(bps)</th>
<th width="">数据位</th>
<th width="">起始位</th>
<th width="">停止位</th>
<th width="">奇偶校验</th>
<th width="">流控</th>
</tr>
<% MakePortAttributeList("1", "Test", "Lanj"); %>
</table>
</html>

2.4.  在goahead.c文件中的main函数中websServiceEvents(&finished);之前添加websDefineJst("MakePortAttributeList", getPortAttrib);,然后在goahead.c文件的开头声明static void getPortA(Webs *wp, STPortAttributeList *PortAttributeList);和static int getPortAttrib(int eid, Webs *wp, int argc, char **argv); // 原型。然后实现这两个函数

typedef struct PortAttributeList{
char *port;
char *agreement;
char *bandrate;
char *figure;
char *outset;
char *termination;
char *parityCheck;
char *flowControl;
}STPortAttributeList;

static void getPortA(Webs *wp, STPortAttributeList *PortAttributeList)
{
PortAttributeList[0].port="1";
PortAttributeList[0].agreement="RS232";
PortAttributeList[0].bandrate="1200";
PortAttributeList[0].figure="8";
PortAttributeList[0].outset="1";
PortAttributeList[0].termination="1";
PortAttributeList[0].parityCheck="ODD";
PortAttributeList[0].flowControl="Hardware";
PortAttributeList[1].port="2";
PortAttributeList[1].agreement="RS485";
PortAttributeList[1].bandrate="9600";
PortAttributeList[1].figure="8";
PortAttributeList[1].outset="1";
PortAttributeList[1].termination="1";
PortAttributeList[1].parityCheck="EVEN";
PortAttributeList[1].flowControl="NO";
}

static int getPortAttrib(int eid, Webs *wp, int argc, char **argv)
{
int i=0;
int SerialNum = 2;
STPortAttributeList PortAttributeList[SerialNum];
printf("Parameter = %d\n",argc);

while(i < argc)
{
printf("Parameter %d = %s\n",i,*(argv+i));
i++;
}
i = 0;

getPortA(wp,PortAttributeList);
while(i<SerialNum)
{
websWrite(wp,"<tr>");
websWrite(wp,"<td>%s</td>",PortAttributeList[i].port);
websWrite(wp,"<td>%s</td>",PortAttributeList[i].agreement);
websWrite(wp,"<td>%s</td>",PortAttributeList[i].bandrate);
websWrite(wp,"<td>%s</td>",PortAttributeList[i].figure);
websWrite(wp,"<td>%s</td>",PortAttributeList[i].outset);
websWrite(wp,"<td>%s</td>",PortAttributeList[i].termination);
websWrite(wp,"<td>%s</td>",PortAttributeList[i].parityCheck);
websWrite(wp,"<td>%s</td>",PortAttributeList[i].flowControl);
websWrite(wp,"</tr>");
i++;
}
return 0;
}

2.5.重新编译goahead,然后在终端中进入goahead可运行文件的目录,然后执行sudo ./goahead -v ./web,最后在浏览器中访问127.0.0.1/aspTest.html

goahead3.6.3就基本使用(后台上传信息到html页面),高手请忽略的更多相关文章

  1. 背水一战 Windows 10 (120) - 后台任务: 后台上传任务

    [源码下载] 背水一战 Windows 10 (120) - 后台任务: 后台上传任务 作者:webabcd 介绍背水一战 Windows 10 之 后台任务 后台上传任务 示例演示 uwp 的后台上 ...

  2. java 后台上传文件

    java 后台上传文件 public static String uploadFile(File file, String RequestURL) throws IOException { Strin ...

  3. 【已解决】phpMyAdmin中导入mysql数据库文件时出错:您可能正在上传很大的文件,请参考文档来寻找解决办法

    期间,用phpMyAdmin去导入90M左右的mysql数据库文件时出错: 您可能正在上传很大的文件,请参考文档来寻找解决方法. [解决过程] 1.很明显,是文件太大,无法导入.即上传文件大小有限制. ...

  4. shopex后台上传模板漏洞

    看到有人找这个拿SHELL的方法.就本地搭建试了下.很简单的. 首先是WIN下.需要WIN主机IIS解析漏洞. 进入后台.点页面管理.点模板列表.默认模板是紫气东来(ShopEx4.8).点编辑模板. ...

  5. jquery 如何动态绑定传递到后台上传组件参数

    $("#upload_photo").uploadify({ 'auto' : false, 'method' : "post", 'height' : 20, ...

  6. from表单实现无跳转上传文件,接收页面后台数据。

    本文基于我刚写的http://www.cnblogs.com/iwang5566/p/6287529.html进行了简单的扩展,实现页面无跳转表单数据提交,并接收后台返回的数据. 下载好,上一篇文章d ...

  7. WordPress 后台上传自定义网站Logo

    需求: 众所周知一般网站的logo都是固定的所以我在做网站时也是使用的静态logo文件,但最近用wp给一个客户做的网站时,因为网站现在的logo可能会需要重新设计,所以客户提出了需要在后台可以自己修改 ...

  8. from表单实现无跳转上传文件,接收页面后台数据

    实现无跳转发送表单数据.文件,并能接收后台返回的数据. 主要技术要点: 1.form表单添加target属性,指定一个iframme的name:form表单提交后在iframe内嵌窗口接受响应,主页面 ...

  9. Easyui前端、JAVA后台 上传附件

    前端使用easyui框架,后台使用JAVA 的JFinal框架开发 功能描述:实现附件上传功能.文件上传路径为:../upload(上传文件夹)/身份证号/慢病编码/上传的附件. 细节要求:实现多图片 ...

随机推荐

  1. 笔记01 登录、常用配置参数、Action访问Servlet API 和设置Action中对象的值、命名空间和乱码处理、Action中包含多个方法如何调用

    Struts2登录 1. 需要注意:Struts2需要运行在JRE1.5及以上版本 2. 在web.xml配置文件中,配置StrutsPrepareAndExecuteFilter或FilterDis ...

  2. [label][JavaScript] 自动填充内容的JavaScript 库

    一个帮助你针对不同标签自动填入内容的轻量级javascript类库 - fixiejs http://www.gbtags.com/technology/javascript/20120802-fix ...

  3. Docker Warning : the backing xfs filesystem is formatted without d_type support

    CentOS7 下安装配置 Docker,遇到如下的WARNING, WARNING: overlay: the backing xfs filesystem is formatted without ...

  4. 【原创】在Windows系统中使用VC9、VC11编译32位、64位PHP及其扩展

    项目中需要使用runkit模块实现AOP,但是团队成员的开发环境都是Windows,而runkit模块官方没有提供Windows环境下的dll扩展,只能自己编译. 下面是编译过程的分类总结.(操作系统 ...

  5. Rest-assured 写日志到 log4j

    背景: 采用Rest-assured,日志采用log4j,发现Rest-assured本身只支持打印日志到控制台,但期望打印到文件中以便排查问题 请求打印的语句只能输出到控制台 given().log ...

  6. cesium编程入门(八)设置材质

    cesium编程入门(八)设置材质 Cesium中为几何形状设置材质有多种方法 第一种方法 Material 直接构建Cesium.Material对象,通过设置Material的属性来进行控制,官方 ...

  7. 用MVC5+EF6+WebApi 做一个小功能(一)开场挖坑,在线答题系统

    从哪开始说呢,这几年微软的技术一直在变,像是牟足了劲要累死所有的NET程序员,从WebForm到MVC到现在MPA.SPA .Razor单页,从net2.0一直走到现在.net4.6.2,后面还有一个 ...

  8. golang plugin的依赖问题

    golang plugin的依赖问题 此文中涉及的plugin运行环境为mac 10.14,go版本为1.11 主要是想讨论一下插件依赖的第三方库的问题. 例子是在https://github.com ...

  9. Android Bug BaseExpandableListAdapter, getChildView

    @Override public View getChildView(final int groupPosition, final int childPosition, boolean isLastC ...

  10. [USACO17FEB]Why Did the Cow Cross the Road III P(CDQ分治)

    题意 两列$n$的排列,相同的数连边,如果一对数有交叉且差的绝对值$>k$,则$++ans$,求$ans$ 题解 可以把每一个数字看成一个三元组$(x,y,z)$,其中$x$表示在第一列的位置, ...