请教各位高手了~
web如何获取服务器的内容 我的服务器的是ARM 访问某一个网页时把数据全部显示出来 比如IP地址和MAC地址 谢谢了 在线等 --------------------编程问答-------------------- TCP/IP协议,自己简单按照HTTP协议,做做数据的收发就行了.比方说:一开始监听80端口,发现链接后,按http协议应答,并发送主页给客户端.然后按照客户端请求的网页地址,发送相对应的网页数据给客户端即可.对于TCP/IP协议来说,HTTP协议也好网页也好只不过是数据流而也. --------------------编程问答-------------------- 我的web能发送数据给ARM端 也就是服务器 但是访问有问题 这是我的代码 您看一下
"<HEAD>"
"<META http-equiv=Content-Type content=text/html;charset=gb2312>"
"<LINK href=01.css type=text/css rel=stylesheet></HEAD>"
"<Script src=Common.js language=javascript></Script>"
"<Script language=javascript>"
"function SetValue() {"
"f.mac1.value=mac1;"
"f.mac2.value=mac2;"
"f.mac3.value=mac3;"
"f.mac4.value=mac4;"
"f.mac5.value=mac5;"
"f.mac6.value=mac6;"
"}"
"</Script></HEAD>"
"<BODY onload=SetValue();><DIV align=center><BR><BR><BR><BR><BR><BR>"
"<TABLE borderColor=#24a71b height=80 width=55%% border=1>"
"<TR><TD class=title1 height=18><B>MAC地址</B></TD></TR>"
"<TR><TD><FORM name=f action=MacHandle method=POST'>"
"<TABLE width=100%% height=100%% border=1>"
"<TR><TD>物理地址</TD>"
"<TD>0x<input size=2 name=mac1 maxlength=2>"
"-<input size=2 name=mac2 maxlength=2>"
"-<input size=2 name=mac3 maxlength=2>"
"-<input size=2 name=mac4 maxlength=2>"
"-<input size=2 name=mac5 maxlength=2>"
"-<input size=2 name=mac6 maxlength=2>(16进制)</TD>"
"<TR><TD colspan=2>【<FONT color=#ff0000>注意:设置网络物理地址,谨慎操作!</FONT>】</TD></TR>"
"<TR><TD class=submit height=40%% align=center colspan=2><input type=button value=重置 onclick=SetValue();><input type=submit value=提交></TD></TR>"
"</TABLE></FORM></TD></TR></TABLE>"
"</BODY>"
这是网页部分 请求部分是这个
else if (strncmp(data, "GET ", 4) == 0)
{
for (i = 0; i < 40; i++)
{
if (((char *)data + 4)[i] == ' ' ||
((char *)data + 4)[i] == '\r' ||
((char *)data + 4)[i] == '\n')
{
((char *)data + 4)[i] = 0;
}
}
i = 0;
j = 0;
do
{
fname[i] = ((char *)data + 4)[j];
j++;
i++;
}
while (fname[i - 1] != 0 && i < 40);
pbuf_free(p);
if (!fs_open(fname, &file))
{
fs_open("/STM32F107.html", &file);
}
hs->file = file.data;
hs->left = file.len;
hs->left += sprintf(hs->file + hs->left,"var mac1='%.2X',mac2='%.2X',mac3='%.2X',mac4='%.2X',mac5='%.2X',mac6='%.2X',Debug=%u;",target_equipment.mac1[0],target_equipment.mac1[1],target_equipment.mac1[2],target_equipment.mac1[3],target_equipment.mac1[4],target_equipment.mac1[5],0);
send_data(pcb, hs);
/*Tell TCP that we wish be to informed of data that has been
successfully sent by a call to the http_sent() function.*/
tcp_sent(pcb, http_sent);
}
我想知道这两个怎么交互 就是web怎么才能把数据接收到
补充:Java , Web 开发