コード例 #1
0
        protected void OnSubmit()
        {
            ESMonitor.Model.Camera model = new ESMonitor.Model.Camera();
            ESMonitor.BLL.Camera   _bll  = new ESMonitor.BLL.Camera();
            string dnsAddr = txtDnsAddr.Text;

            if (!_bll.Exists(dnsAddr))
            {
                model.DevId    = int.Parse(ddlDev.SelectedValue);
                model.DnsAddr  = dnsAddr;
                model.UserName = txtUserName.Text.Trim();
                model.PassWord = txtPwd.Text.Trim();

                int camId = _bll.Add(model);
                if (camId > 0)
                {
                    Response.Redirect("CameraAdd.aspx");
                }
            }
            else
            {
                string tip = "已录入该记录";
                ClientScript.RegisterStartupScript(GetType(), "", "<script>alert(\"" + tip + "\");</script>");
            }
        }
コード例 #2
0
ファイル: Photos.ashx.cs プロジェクト: SHWDTech/lagecy_app
        private bool OpenVedio(string devId)
        {
            modelca = bll.GetModel(int.Parse(devId));
            if (modelca == null)
            {
                return(false);
            }
            string DNSAddr       = modelca.DnsAddr;
            string DVRIPAddress  = "";               //设备IP地址或者域名 Device IP
            Int16  DVRPortNumber = 0;                //设备服务端口号 Device Port
            string DVRUserName   = modelca.UserName; //设备登录用户名 User name to login
            string DVRPassword   = modelca.PassWord; //设备登录密码 Password to login

            if (!model.GetIPAddr(DNSAddr, ref DVRIPAddress, ref DVRPortNumber))
            {
                return(false);
            }

            if (!model.Open(DVRIPAddress, DVRPortNumber, DVRUserName, DVRPassword))
            {
                return(false);
            }

            return(true);
        }