Exemplo n.º 1
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            int    i, ret;
            string tmpstr;

            //			System.Windows.Forms.MessageBox.Show( "testing") ;
            tmpstr = System.Reflection.Assembly.GetExecutingAssembly().Location;
            System.Windows.Forms.MessageBox.Show("Working Area=" + tmpstr);

            ret = API2.AB_API_Open();
            if (ret < 0)
            {
                MessageBox.Show("AB_API_Open= err");                   // + AB_ErrMsg(ret)) ;
            }
            else
            {
                timer1.Enabled = true;
                ret            = AB_LoadConf();
                if (ret > 0)
                {
                    for (i = 0; i < ret; i++)
                    {
                        lstGwStatus.Items.Add("Gateway" + Convert.ToString(i + 1) + " not open");
                        ret = API2.AB_GW_Open(GwConf[i].gw_id);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void menuItem3_Click(object sender, System.EventArgs e)
        {
            int    ret, node;
            string tmpstr;

            node = 22;
            ret  = API2.AB_GW_Open(node);
            if (ret < 0)
            {
                MessageBox.Show("AB_GW_Open() err");
                return;
            }
            else
            {
                tmpstr = "AB_GW_Open() ok, node=" + Convert.ToString(node);
                MessageBox.Show(tmpstr);
                MsgBox2(tmpstr);
            }
        }