示例#1
0
文件: MainForm.cs 项目: iwenli/YS007
        void M()
        {
            T("InitSdk", YsAction.InitSdk());
            T(YsAction.GetAccessToken());
            var _list = YsAction.GetCameraList("C04104941");

            _list = YsAction.GetCameraList();
            T("DisposeSdk", YsAction.DisposeSdk());
        }
示例#2
0
        /// <summary>
        /// 是否可以启动窗体
        /// 暂无运行的窗体  &&  没有需要更新的版本  && 网络
        /// </summary>
        /// <returns></returns>
        static bool CanRun()
        {
            bool      canRun;
            Attribute guid_attr = Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(GuidAttribute));
            string    guid      = ((GuidAttribute)guid_attr).Value;

            _mutex = new System.Threading.Mutex(true, guid, out canRun);
            if (!canRun)
            {
                MessageBox.Show("已经在运行了!", AppInfo.AssemblyTitle,
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                canRun = IsConnect();
                if (!canRun)
                {
                    MessageBox.Show("网络异常,请检查网络是否连接!", AppInfo.AssemblyTitle,
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    canRun = YsAction.InitSdk();
                    if (!canRun)
                    {
                        MessageBox.Show("监控提供商链接失败,请联系软件开发者!", AppInfo.AssemblyTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        canRun = CheckUpdateTask().Result == null;
                    }
                }
            }
            return(canRun);
        }