コード例 #1
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            GeneralDef.NETDEMO.NETDEMO_DEVICE_TYPE_E eDeviceType = GeneralDef.NETDEMO.NETDEMO_DEVICE_TYPE_E.NETDEMO_DEVICE_IPC_OR_NVR;
            if (1 == this.DeviceTypeCmb.SelectedIndex)
            {
                eDeviceType = GeneralDef.NETDEMO.NETDEMO_DEVICE_TYPE_E.NETDEMO_DEVICE_VMS;
            }

            String strIPAddr = this.ipDomainNameText.Text;
            short  sPort     = 0;

            try
            {
                sPort = Convert.ToInt16(this.portText.Text);
            }
            catch (FormatException)
            {
                return;
            }
            catch (OverflowException)
            {
                return;
            }

            String strUserName = this.userNameText.Text;
            String strPassword = this.passwordText.Text;

            m_oNetDemo.AddLocalDevice(strIPAddr, sPort, strUserName, strPassword, eDeviceType);
            this.Close();
        }
コード例 #2
0
        //add device
        private void addDeviceBtn_Click(object sender, EventArgs e)
        {
            String strUserName = this.userNameText.Text;
            String strPassword = this.passwordText.Text;

            if (strUserName == "" || strPassword == "")
            {
                return;
            }

            for (int i = 0; i < oDeviceIPList.Count() && i < oDevicePortList.Count(); i++)
            {
                GeneralDef.NETDEMO.NETDEMO_DEVICE_TYPE_E eDeviceType = GeneralDef.NETDEMO.NETDEMO_DEVICE_TYPE_E.NETDEMO_DEVICE_IPC_OR_NVR;
                if ("VMS" == oDeviceTypeList[i])
                {
                    eDeviceType = GeneralDef.NETDEMO.NETDEMO_DEVICE_TYPE_E.NETDEMO_DEVICE_VMS;
                }
                m_oNetDemo.AddLocalDevice(oDeviceIPList[i], oDevicePortList[i], strUserName, strPassword, eDeviceType);
            }

            this.Close();
        }