web control 是什么意思

web control 是什么意思,第1张

网络控制 web control

网络控制系统的特征是通过一系列的通信信道构成一个或多个控制闭环,同时具备信号处理、优化决策和控制 *** 作的功能,控制器可以分散在网络中的不同地点。

1 web控件是运行在服务器上的,而客户端控件是运行在客户端;web控件必须要有runat="server"属性,如果你想用C# *** 作某个控件,那么你必须把此控件声明为runat="server",也就是服务器控件。反之,你就可以用客户端控件,由于web控件运行在服务器上,所以比较耗服务器资源,所以,对于服务器控件,能不用就不要用。

2 ResponseWrite("<script language='javascript'>windowopen('/indexaspx');</script>");

3 你可以用Session来传值。

    本文利用NI自带的WEB服务器,将程序面板通过嵌入式网络服务器来发布网页,可以在局域网中通过网页查看VI面板,并且可以完成远程控制功能。

1、工具-选项,Web服务器:配置一项,继而系统会d出Web服务器配置对话框。启用远程前面板。需要开启远程前面板服务器,启用远程前面板功能,这里要定义>看了你的留言直接在这回吧,其实网页方面我也是个菜鸟。去年我做过一个类似的,当时也是自学了1个月的iis的配置,aspnet,vb串口 *** 作等,大二假期比较闲。
做法:用DS18B20温度传感器连接51单片机,然后单片机通过串口与电脑通信,电脑成为服务器,手机连接网页,进行温度监控,开关单片机外接的继电器等等 *** 作。
硬件端的代码对你没用,服务器端我的基本思路就是aspnet连接数据库,然后用vb实时扫描数据库,通过vb中的MScomm控件连接串口,vb的代码对你也没啥用,因为MScomm连接单片机的代码的“通信协议”我是写在单片机上的,不配套就没用了
这是网页的代码,不精简,高手莫笑
主要功能就是连接数据库。。。里面没能直接通过aspnet控制串口,貌似也有C#直接控制的,你去CSDN看看吧,我试过是没问题的,就是 *** 作不太方便(可能我太菜了)
using System;
using SystemConfiguration;
using SystemData;
using SystemLinq;
using SystemWeb;
using SystemWebSecurity;
using SystemWebUI;
using SystemWebUIHtmlControls;
using SystemWebUIWebControls;
using SystemWebUIWebControlsWebParts;
using SystemXmlLinq;
using SystemDataSqlClient;
public partial class _Default : SystemWebUIPage
{
protected void Page_Load(object sender, EventArgs e)
{
//温度
SqlConnection cnn1 = new SqlConnection(@"Data Source=YINGJHSHP541\SQLEXPRESS;Initial Catalog=test3;User ID=sa;Password=yingjh");
cnn1Open();
//表
SqlCommand cmd1 = new SqlCommand();
cmd1Connection = cnn1;
cmd1CommandText = "select from T";
SqlDataReader data1;
data1 = cmd1ExecuteReader();
GridView1DataSource = data1;
GridView1DataBind();
cnn1Close();
//图
cnn1Open();
SqlDataAdapter Da = new SqlDataAdapter();
DaSelectCommand = new SqlCommand("select 时间,[温度(℃)] from T", cnn1);
DataSet ds = new DataSet();
DaFill(ds);
DataView myView = new DataView(dsTables[0]);
Chart1Series["Series1"]PointsDataBindXY(myView, "时间", myView, "温度(℃)");
cnn1Close();
cnn1Dispose();
//状态
SqlConnection cnn2 = new SqlConnection();
cnn2ConnectionString = @"Data Source=YINGJHSHP541\SQLEXPRESS;Initial Catalog=test3;User ID=sa;Password=yingjh";
cnn2Open();
SqlCommand cmd2 = new SqlCommand();
cmd2Connection = cnn2;
cmd2CommandText = "select from ST";
SqlDataReader data2;
data2 = cmd2ExecuteReader();
data2Read();
string a = data2GetString(0);
switch (a)
{
case "1":
Label2Text = "打开";
break;
case "0":
Label2Text = "预设";
break;
case "-1":
Label2Text = "关闭";
break;
default:
break;
}
Label4Text = data2GetString(1) + "℃";
cnn2Close();
cnn2Dispose();
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection cnn = new SqlConnection(@"Data Source=YINGJHSHP541\SQLEXPRESS;Initial Catalog=test3;User ID=sa;Password=yingjh");
SqlCommand cmd = new SqlCommand();
cnnOpen();
cmdConnection = cnn;
//设置开关,flag为开关控制权
switch (DropDownList1Text)
{
case "1":
cmdCommandText = "update ST set STATE='1'" + ",flag='1'";
break;
case "0":
cmdCommandText = "update ST set STATE='0'" + ",STEMP='" + TextBox1Text + "',flag='1'";
break;
case "-1":
cmdCommandText = "update ST set STATE='-1'" + ",flag='1'";
break;
default:
cmdCommandText = "update ST set STATE='0'" + ",STEMP='" + TextBox1Text + "',flag='1'";
break;
}
cmdExecuteNonQuery();
cnnClose();
cnnDispose();
//温度
SqlConnection cnn1 = new SqlConnection(@"Data Source=YINGJHSHP541\SQLEXPRESS;Initial Catalog=test3;User ID=sa;Password=yingjh");
cnn1Open();
//表
SqlCommand cmd1 = new SqlCommand();
cmd1Connection = cnn1;
cmd1CommandText = "select from T";
SqlDataReader data1;
data1 = cmd1ExecuteReader();
GridView1DataSource = data1;
GridView1DataBind();
cnn1Close();
//图
cnn1Open();
SqlDataAdapter Da = new SqlDataAdapter();
DaSelectCommand = new SqlCommand("select 时间,[温度(℃)] from T", cnn1);
DataSet ds = new DataSet();
DaFill(ds);
DataView myView = new DataView(dsTables[0]);
Chart1Series["Series1"]PointsDataBindXY(myView, "时间", myView, "温度(℃)");
cnn1Close();
cnn1Dispose();
//状态
SqlConnection cnn2 = new SqlConnection();
cnn2ConnectionString = @"Data Source=YINGJHSHP541\SQLEXPRESS;Initial Catalog=test3;User ID=sa;Password=yingjh";
cnn2Open();
SqlCommand cmd2 = new SqlCommand();
cmd2Connection = cnn2;
cmd2CommandText = "select from ST";
SqlDataReader data2;
data2 = cmd2ExecuteReader();
data2Read();
string a = data2GetString(0);
switch (a)
{
case "1":
Label2Text = "打开";
break;
case "0":
Label2Text = "预设";
break;
case "-1":
Label2Text = "关闭";
break;
default:
break;
}
Label4Text = data2GetString(1) + "℃";
cnn2Close();
cnn2Dispose();
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}

以Windows10系统为例,web服务器指的是网站服务器,可以浏览web文档,也可以放置网站文件,具体web文件的位置打开电脑--开始--控制面板--Internet Information Services后,在展开的节点里就可以看到相应的web程序信息了。
总的来说,web服务器就是一组提供web访问页面的服务器,Web服务器是一个程序,运行在物理服务器上,等待着客户端发送请求,当收到请求后,它会生成响应返回给客户端。严格意义上Web服务器只负责处理>

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/12775323.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-27
下一篇 2023-05-27

发表评论

登录后才能评论

评论列表(0条)

保存