Exemplo n.º 1
0
        //ما يحدث بعد الضغط على الأزرار الأخرى
        //زر التحقق من وجود إصدار جديد
        private void tahdith_Click(object sender, EventArgs e)
        {
            //تأثير عند الضغط
            tahdith.BackgroundImage = Properties.Resources.tahdith;
            tahdith.Refresh();
            Thread.Sleep(100);
            tahdith.BackgroundImage = Properties.Resources.lighttahdith;

            //التحقق من وجود إصدار جديد
            try
            {
                //"
                WebClient web    = new WebClient();
                Stream    stream = web.OpenRead("https://pastebin.com/raw/RJCWm0x3");
                using (StreamReader reader = new StreamReader(stream))
                {
                    String textakhiralisdarfilmawqii = reader.ReadToEnd(); //" م1 بتصرف
                    raqmalisdarmawqi.Text = textakhiralisdarfilmawqii;
                    var mwq = Convert.ToInt32(raqmalisdarmawqi.Text);
                    var brn = Convert.ToInt32(raqmalisdarfibarnamj.Text);
                    //في حالة وجود إصدار جديد
                    if (mwq > brn)
                    {
                        //فتح نافذة يوجد إصدار جديد للتحميل
                        Form isdarjadid = new Form05();
                        isdarjadid.ShowDialog();
                    }
                    //في حالة عدم وجود إصدار جديد
                    else
                    {
                        //فتح نافذة أنت تملك إصدار جديد
                        Form isdarjadid = new Form06();
                        isdarjadid.ShowDialog();
                    }
                }
            }

            //لمنع ظهور رسالة الخطأ أثناء تعذر الإتصال بالخادم
            catch { }
        }
Exemplo n.º 2
0
        public Form01()
        {
            //التحقق من وجود الملفات الأساسية للبرنامج وغلقه إذا لم تكن موجودة
            //LinqBridge.dll التحقق من وجود الملف
            if (!File.Exists("LinqBridge.dll"))
            {
                MessageBox.Show("ينقص الملف LinqBridge.dll، قم بإعادة تحميل البرنامج من موقعه الرّسمي، ثم حاول تشغيله مرّة أخرى.", "حدث خطأ", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign);
                Environment.Exit(1);
            }

            //Atawbah.exe.config التحقق من وجود الملف
            if (!File.Exists("Atawbah.exe.config"))
            {
                MessageBox.Show("ينقص الملف Atawbah.exe.config، قم بإعادة تحميل البرنامج من موقعه الرّسمي، ثم حاول تشغيله مرّة أخرى.", "حدث خطأ", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign);
                Environment.Exit(1);
            }

            //AltawbaMB.exe التحقق من وجود الملف
            if (!File.Exists("AltawbaMB.exe"))
            {
                MessageBox.Show("ينقص الملف AltawbaMB.exe، قم بإعادة تحميل البرنامج من موقعه الرّسمي، ثم حاول تشغيله مرّة أخرى.", "حدث خطأ", MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign);
                Environment.Exit(1);
            }

            //تهيئة العناصر
            InitializeComponent();

            //التحقق من وجود إصدار جديد
            try
            {
                //"
                WebClient web    = new WebClient();
                Stream    stream = web.OpenRead("https://pastebin.com/raw/RJCWm0x3");
                using (StreamReader reader = new StreamReader(stream))
                {
                    String textakhiralisdarfilmawqii = reader.ReadToEnd();  //" م1 بتصرف
                    raqmalisdarmawqi.Text = textakhiralisdarfilmawqii;
                    var mwq = Convert.ToInt32(raqmalisdarmawqi.Text);
                    var brn = Convert.ToInt32(raqmalisdarfibarnamj.Text);
                    if (mwq > brn)
                    {
                        //فتح نافذة إصدار جديد
                        Form isdarjadid = new Form05();
                        isdarjadid.ShowDialog();
                    }
                }
            }
            //لمنع ظهور رسالة الخطأ عند تعذر الإتصال بالخادم
            catch { }

            //إظهار رسالة في شريط الأخبار
            try
            {
                //"
                WebClient web2    = new WebClient();
                Stream    stream2 = web2.OpenRead("https://pastebin.com/raw/zXugwVBD");
                using (StreamReader reader2 = new StreamReader(stream2))
                {
                    String text1 = reader2.ReadToEnd(); //" م1 بتصرف
                    Akhbar.Text = text1;
                }
            }
            catch { }

            //إظهار نافذة التنبيهاب عند تشغيل البرنامج أول مرة
            if (Properties.Settings.Default.idhharNafidhatAlTanbihat == true)
            {
                Form hawlaform = new Form00();
                hawlaform.ShowDialog();
            }

            //تهاني
            //العيد
            var akhbar = Akhbar.Text;

            if (akhbar.Contains("عيدك") | akhbar.Contains("تقبل الله"))
            {
                tahnia.BackgroundImage = Properties.Resources.al3id;
                tahnia.Visible         = true;
            }

            //رمضان
            if (akhbar.Contains("رمضان"))
            {
                tahnia.BackgroundImage = Properties.Resources.ramadan;
                tahnia.Visible         = true;
            }

            //Alt+F4 من الأوامر الخاصة بتعطيل
            this.KeyPreview = true;
        }