示例#1
0
        /// <summary>
        /// OnPower
        /// </summary>
        /// <returns></returns>
        public static bool Open()
        {
            if (GprsControl.IsActived())
            {
                GprsControl.Deactive();
                Thread.Sleep(200);
            }

            IsOnPower = GprsControl.Active() > 0;
            Thread.Sleep(5000);
            return(IsOnPower);
        }
示例#2
0
 private void FrPadMain_Load(object sender, EventArgs e)
 {
     if (WifiControl.IsActived())
     {
         btwifi.Text = "Close Wi-Fi";
     }
     if (GprsControl.IsActived())
     {
         btGPRS.Tag  = "Close";
         btGPRS.Text = "Close GPRS";
     }
 }
示例#3
0
        /// <summary>
        /// Switch Gprs
        /// </summary>
        private void SwitchGprs()
        {
            bool isInvoke = false;

            if (GprsControl.IsActived())
            {
                if (DialogResult.Yes == MessageBox.Show("Are you sure to close the gprs?", "GPRS", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
                {
                    if (GprsControl.Deactive())
                    {
                        btGPRS.Text = "Open GPRS";
                    }
                }
                else
                {
                    isInvoke = true;
                }
            }
            else
            {
                int ret = GprsControl.Active();
                {
                    isInvoke = true;
                }
            }

            if (isInvoke)
            {
                btGPRS.Text = "Close GPRS";
                string procname = @"\Windows\rnaapp.exe";
                if (!File.Exists(procname))
                {
                    return;
                }
                Process.Start(procname, "-e\"GPRSDial\"");      //"-p-e\"GPRSDial\""
            }
        }