DataSet ds = new DataSet();
myadapter.Fill(ds, "tb");
for (int i = 0; i < 32; i++)
{
object a = ds.Tables["tb"].Rows[i]["x"];
int b = (int)a;
aa[i].x = (double)b;
object f = ds.Tables["tb"].Rows[i]["y"];
b = (int)f;
aa[i].y = (double)b;
}
MessageBox.Show("读取成功");
conn.Close();
button1.Enabled =true;
button5.Enabled = false;
图 5-2读取坐标节点界面
5.3 变换始终节点模块功能
变换始终节点模块主要是设置每次实验的开始节点和目标节点。
代码如下:
iiii++;
if (iiii == 2)
{
qd.x = 90;
qd.y = 20;
zd.x = 140;
zd.y = 60;
MessageBox.Show("变换成功");
}
else if (iiii == 3)
{
qd.x = 90;
qd.y = 20;
zd.x = 270;
zd.y = 80;
MessageBox.Show("变换成功");
}
else if (iiii == 4)
{
qd.x = 80;
qd.y = 50;
zd.x = 270; 无线传感器网络中数据传输最优路径选择(10):http://www.youerw.com/tongxin/lunwen_2234.html