Пример #1
0
        public static bool checkNewVersion()
        {
            bool zorunlu = false;

            string currentVersiyon = "";
            string mustUpdate      = "";



            try
            {
                WebRequest   request    = HttpWebRequest.Create(GlobalData.versionUrl);
                WebResponse  response   = request.GetResponse();
                StreamReader reader     = new StreamReader(response.GetResponseStream());
                string       strCurrent = reader.ReadToEnd();
                string       msg        = "";

                string[] arr = strCurrent.Split('|');
                if (arr.Length > 0)
                {
                    currentVersiyon = arr[0].ToString().Trim();
                    mustUpdate      = arr[1].ToString().Trim();

                    string deviceVersiyon = Utility.GetCurrentApplicationVersion();

                    int currentVersiyonSayisal = Convert.ToInt32(currentVersiyon.Replace(".", ""));
                    int deviceVersiyonSayisal  = Convert.ToInt32(deviceVersiyon.Replace(".", ""));

                    if (currentVersiyonSayisal > deviceVersiyonSayisal)
                    {
                        if (mustUpdate == "1")
                        {
                            msg     = "Yazılımın kritik güncellemeler içeren yeni bir sürümü mevcut. Devam etmeden önce lütfen güncel versiyonu yükleyiniz. Güncel versiyon: " + currentVersiyon;
                            zorunlu = true;
                        }
                        else
                        {
                            msg = "Yazılımın yeni bir sürümü bulunmaktadır. Güncel versiyon: " + currentVersiyon;
                        }
                        MessageBox.Show(msg.ToString(), "BİLGİ");
                    }
                }
            }
            catch
            {
                return(false);
            }

            return(zorunlu);
        }
        private void frm_WMLogin_Load(object sender, EventArgs e)
        {
            cmbSunucu.Text = GlobalData.sunucuTip;

            bool versiyonCheck = Utility.checkNewVersion();

            if (versiyonCheck)
            {
                //Update zorunlu
                btn_Giris.Enabled = false;
            }


            //Version bilgisi çekiliyor
            lbl_Version.Text         = /*Utility.GetCurrentApplicationDate()+*/ " - V. " + Utility.GetCurrentApplicationVersion();
            lbl_BaglantiBilgisi.Text = " sisteme bağlanıyorsunuz...";
        }
Пример #3
0
        private void frm_WMLogin_Load(object sender, EventArgs e)
        {
            logger.info("frm_WMLogin_Load begin");

            this.WindowState = FormWindowState.Maximized;
            cmbSunucu.Text   = GlobalData.sunucuTip;

            bool versiyonCheck = Utility.checkNewVersion();

            if (versiyonCheck)
            {
                //Update zorunlu
                btn_Giris.Enabled = false;
            }


            //Version bilgisi çekiliyor
            lbl_Version.Text         = Utility.GetCurrentApplicationDate() + " - V. " + Utility.GetCurrentApplicationVersion();
            lbl_BaglantiBilgisi.Text = " sisteme bağlanıyorsunuz...";

            logger.info("frm_WMLogin_Load end");
        }