Esempio n. 1
0
        private bool onList(DumbedNumber d)
        {
            if (d == null)
            {
                return(false);
            }

            if (this.Dumbeds == null)
            {
                return(false);
            }
            if (this.Dumbeds.Count < 1)
            {
                return(false);
            }
            foreach (DumbedNumber dn in this.Dumbeds)
            {
                if (d.number == dn.number)
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 2
0
        private void btnDumb_Click(object sender, EventArgs e)
        {
            int searched = 0;
            int hasImage = 0;
            int skiped   = 0;

            rtxbxDumber.Text += " Starting ..... ";
            string prefix     = txbx_Dumber_prefix.Text;
            int    Num_length = int.Parse(numUD_length.Value.ToString());

            int start = int.Parse(NumFrom.Value.ToString());
            int end   = int.Parse(NumTo.Value.ToString());

            for (int i = start; i <= end; i++)
            {
                string num = prefix + LeftZaeros((i), Num_length - prefix.Length);
                if (!settings.GetsessionExpired())
                {
                    DumbedNumber d = new DumbedNumber();
                    d.number = num;
                    if (this.onList(d) && this.ckbx_3_skipDumbedBefore.Checked)
                    {
                        skiped++;
                        continue;
                    }
                    d.TrueCallerInfo();


                    if (dataBasemanager.NumberExisted(d.number) == false && d.Tostore())
                    {
                        dataBasemanager.AddNew(d);
                    }

                    if (d.Has_Image())
                    {
                        hasImage++;
                    }
                    searched++;
                    rtxbxDumber.Text += (Environment.NewLine + num + ": Dumbed at" + DateTime.Now.ToShortTimeString());

                    if (d.HasError)
                    {
                        rtxbxDumber.Text += Environment.NewLine + "     Error " + d.ErrorType.ToString();
                        return;
                    }
                    NumFrom.Value++;
                }
            }

            lbl_Dumber_Result_HasImage.Text = "With Images=" + hasImage.ToString();
            lbl_Dumber_Result_Searched.Text = "Searched=" + searched.ToString();
            lblSkipped.Text = "Skipped=" + skiped;
        }
Esempio n. 3
0
 public string ToString(string space = "    ")
 {
     if (this.HasError)
     {
         return(ErrorType.ToString());
     }
     else
     {
         if (space.Trim() == "")
         {
             space = " ® ";
         }
     } return("Number:" + number + space + "Country:" + DumbedNumber.RealCountry(this.CountryAbb) + space + GetTrueCallerStored() + space + GetImageStatue() + space + "Time:" + this.CreationTime);
 }
Esempio n. 4
0
        private void btnDumb_Click(object sender, EventArgs e)
        {
            int searched = 0;
            int hasImage = 0;
            int skiped = 0;
            rtxbxDumber.Text += " Starting ..... ";
            string prefix = txbx_Dumber_prefix.Text;
            int  Num_length = int.Parse(numUD_length.Value.ToString());

            int start = int.Parse(NumFrom.Value.ToString());
            int end = int.Parse(NumTo.Value.ToString());
            for(int  i=start;i<=end;i++)
            {
                string num = prefix + LeftZaeros((i), Num_length-prefix.Length );
                if (!settings.GetsessionExpired())
                {

                    DumbedNumber d = new DumbedNumber();
                    d.number = num;
                    if (this.onList(d) && this.ckbx_3_skipDumbedBefore.Checked)
                    {
                        skiped++;
                        continue;
                    }
                       d.TrueCallerInfo();

                    if (dataBasemanager.NumberExisted(d.number) == false && d.Tostore())
                        dataBasemanager.AddNew(d);

                    if (d.Has_Image())
                        hasImage++;
                    searched++;
                    rtxbxDumber.Text += (Environment.NewLine + num + ": Dumbed at" + DateTime.Now.ToShortTimeString());

                    if (d.HasError)
                    {
                        rtxbxDumber.Text += Environment.NewLine + "     Error " + d.ErrorType.ToString();
                        return;
                    }
                    NumFrom.Value++;
                }
            }

            lbl_Dumber_Result_HasImage.Text = "With Images="+hasImage.ToString();
            lbl_Dumber_Result_Searched.Text = "Searched="+searched.ToString();
            lblSkipped.Text = "Skipped=" + skiped;
        }
Esempio n. 5
0
        private void ViewSearchedLocal()
        {
            int SelectedIndex___ = dataGridView1.CurrentCell.RowIndex;

            try
            {
                this.picbxLocal.Image = global::NumberDumber.Properties.Resources.defpic;
            }
            catch { }
            if (SelectedIndex___ < 0)
            {
                return;
            }
            if (this.lstbxLocal.SelectedIndex >= this.Dumbeds.Count)
            {
                return;
            }

            DumbedNumber d = this.SearchList[SelectedIndex___];

            chkbx_name_loadOnline.Visible = d.Has_Image();
            this.rtbxLocal.Text           = d.ToString(Environment.NewLine + Environment.NewLine + "-");
            string img_path = Application.StartupPath + "\\imgs\\" + d.CountryAbb.Trim() + "_" + d.number.Trim() + ".jpg";

            try
            {
                chkbx_name_loadOnline.Visible = false;
                if (File.Exists(img_path))
                {
                    this.picbxLocal.Image = Image.FromFile(img_path);
                }
                else if (chkbx_name_loadOnline.Checked)
                {
                    this.picbxLocal.Load(d.ImageLink);
                    this.picbxLocal.Image.Save(img_path);
                }
                else
                {
                    chkbx_name_loadOnline.Visible = true;
                }
            }
            catch
            {
            }
            gpx_Local_view.Visible = true;
        }
Esempio n. 6
0
        private bool DumbNumber(string num)
        {
            try
            {
                DumbedNumber d = new DumbedNumber();
                d.number = num;
                d.TrueCallerInfo();

                if (dataBasemanager.NumberExisted(d.number) == false && d.Tostore())
                {
                    dataBasemanager.AddNew(d);
                }

                return(!d.HasError);// false;
            }
            catch { return(false); }
        }
Esempio n. 7
0
 private void LoadDmbedBefore()
 {
     string[] lines = File.ReadAllLines(Program.ReturnLocalFile());
     this.Dumbeds = new List <DumbedNumber>();
     if (lines == null)
     {
         return;
     }
     foreach (string line in lines)
     {
         DumbedNumber d = DumbedNumber.Build(line);
         if (d.isValid() == false)
         {
             continue;
         }
         this.Dumbeds.Add(d);
         this.SearchResult.Add(d);
     }
 }
        internal static void AddNew(DumbedNumber dn)
        {
            try
            {

                if (dataBasemanager.NumberExisted(dn.number) || dn==null)
                    return;
            }
            catch { }
            try
            {
                string d = "";
                if (File.Exists(settings.GetDbPath()))
                    d += File.ReadAllText(settings.GetDbPath());

                d += (Environment.NewLine + dn.ToString("     "));
                File.WriteAllText(settings.GetDbPath(), d);
            }
            catch { }
        }
Esempio n. 9
0
        internal static void AddNew(DumbedNumber dn)
        {
            try
            {
                if (dataBasemanager.NumberExisted(dn.number) || dn == null)
                {
                    return;
                }
            }
            catch { }
            try
            {
                string d = "";
                if (File.Exists(settings.GetDbPath()))
                {
                    d += File.ReadAllText(settings.GetDbPath());
                }

                d += (Environment.NewLine + dn.ToString("     "));
                File.WriteAllText(settings.GetDbPath(), d);
            }
            catch { }
        }
Esempio n. 10
0
        private bool onList(DumbedNumber d)
        {
            if (d == null)
                return false;

            if (this.Dumbeds == null)
                return false;
            if (this.Dumbeds.Count < 1)
                return false;
            foreach (DumbedNumber dn in this.Dumbeds)
                if (d.number == dn.number)
                    return true;

            return false;
        }
Esempio n. 11
0
        private bool DumbNumber(string num)
        {
            try
            {

                DumbedNumber d = new DumbedNumber();
                d.number = num;
                d.TrueCallerInfo();

                if (dataBasemanager.NumberExisted(d.number) == false && d.Tostore())
                    dataBasemanager.AddNew(d);

                return !d.HasError;// false;
            }
            catch { return false; }
        }
Esempio n. 12
0
        private void Check_Click(object sender, EventArgs e)
        {
            gpxInfo.Visible = false;
            try
            {
                try
                {
                    this.PICBXnumber.Image = global::NumberDumber.Properties.Resources.defpic;
                }
                catch { }

                /*//////*/
                lblNumberError.Visible = false;
                /*//////*/
                DumbedNumber d = new DumbedNumber();
                d.number = txbxNumber.Text.IntOnly();
                d.CountryAbb = DumbedNumber.Abb(cmbx_Check_countryAbb.SelectedIndex);
                d.TrueCallerInfo();
                /*//////*/
                rtxbxInfo_Of_number.Text = d.ToString(Environment.NewLine + Environment.NewLine + "-");
               if(d.ErrorType==NumberError.SessionError)
                rtxbxInfo_Of_number.Text += "\r\nPlease restart the session \r\n add cookie \r\n or \r\n log out and log in again ";

                gpxInfo.Text = d.name + "`s Info";
                gpxInfo.Visible = true;
                PICBXnumber.Image = DefaultImage();
                if (d.isValid() && onList(d)==false)
                    this.Dumbeds.Add(d);
                /*//////*/
                string ip = Application.StartupPath + "\\imgs\\" + d.CountryAbb.Trim() + "_" + d.number.Trim() + ".jpg";
                if (d.Has_Image())
                {
                    try
                    {
                        if (File.Exists(ip))
                            this.PICBXnumber.Image = Image.FromFile(ip);
                        else if (chkbx_name_loadOnline.Checked)
                        {
                            this.PICBXnumber.Load(d.ImageLink);
                            this.PICBXnumber.Image.Save(ip);
                        }

                    }
                    catch
                    {

                    }

                }
                /*//////*/
                dataBasemanager.AddNew(d);

                lblNumberError.Visible = d.HasError;
                lnkLblPlzSignIn.Visible = (d.ErrorType == NumberError.SessionError);

                gpxInfo.Visible=true;
            }
            catch {   }
        }
Esempio n. 13
0
        internal static DumbedNumber Build(string line)
        {
            DumbedNumber d = new DumbedNumber(true);

            if (line.Contains("®") == false)
            {
                if (line.Contains(":"))
                {
                    string[] pcs = line.Split(new char[] { ':' });
                    d.number = pcs[1];
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                string[] spdByPeace = line.Split(new char[] { '®' });

                string numbandval = spdByPeace[0];
                if (numbandval.Contains(":"))
                {
                    d.number = numbandval.Split(new char[] { ':' })[1];
                }



                string countru_and_val = spdByPeace[1];
                if (countru_and_val.Contains(":"))
                {
                    d.CountryAbb = DumbedNumber.ValidAbb(countru_and_val.Split(new char[] { ':' })[1]);
                }



                if (spdByPeace.Length < 3)
                {
                    return(d);
                }
                string nameandVal = spdByPeace[2];
                if (nameandVal.Contains(":"))
                {
                    d.name = nameandVal.Split(new char[] { ':' })[1];
                }

                if (spdByPeace.Length < 4)
                {
                    return(d);
                }

                string imagandlink = spdByPeace[3];
                if (imagandlink.Contains(":"))
                {
                    if (imagandlink.Contains("Has no ima") == false)
                    {  // has image at:http://ask.com
                        string [] tmp = imagandlink.Split(new char [] { ':' });
                        for (int i = 1; i < tmp.Length; i++)
                        {
                            d.ImageLink += tmp[i] + ":";
                        }
                        d.ImageLink = d.ImageLink.Substring(0, d.ImageLink.Length - 1);
                    }
                    if (d.ImageLink.IsUrl())
                    {
                        d.HasImage = true;
                    }
                }


                if (spdByPeace.Length < 5)
                {
                    return(d);
                }
                string timeandVal = spdByPeace[4];
                if (timeandVal.Contains(":"))
                {
                    d.CreationTime = timeandVal.Split(new char[] { ':' })[1];
                }
            }

            return(d);
        }
Esempio n. 14
0
 public string RealCountry()
 {
     return(DumbedNumber.RealCountry(this.CountryAbb));
 }
Esempio n. 15
0
        private void Check_Click(object sender, EventArgs e)
        {
            gpxInfo.Visible = false;
            try
            {
                try
                {
                    this.PICBXnumber.Image = global::NumberDumber.Properties.Resources.defpic;
                }
                catch { }

                /*//////*/
                lblNumberError.Visible = false;
                /*//////*/
                DumbedNumber d = new DumbedNumber();
                d.number     = txbxNumber.Text.IntOnly();
                d.CountryAbb = DumbedNumber.Abb(cmbx_Check_countryAbb.SelectedIndex);
                d.TrueCallerInfo();
                /*//////*/
                rtxbxInfo_Of_number.Text = d.ToString(Environment.NewLine + Environment.NewLine + "-");
                if (d.ErrorType == NumberError.SessionError)
                {
                    rtxbxInfo_Of_number.Text += "\r\nPlease restart the session \r\n add cookie \r\n or \r\n log out and log in again ";
                }

                gpxInfo.Text      = d.name + "`s Info";
                gpxInfo.Visible   = true;
                PICBXnumber.Image = DefaultImage();
                if (d.isValid() && onList(d) == false)
                {
                    this.Dumbeds.Add(d);
                }
                /*//////*/
                string ip = Application.StartupPath + "\\imgs\\" + d.CountryAbb.Trim() + "_" + d.number.Trim() + ".jpg";
                if (d.Has_Image())
                {
                    try
                    {
                        if (File.Exists(ip))
                        {
                            this.PICBXnumber.Image = Image.FromFile(ip);
                        }
                        else if (chkbx_name_loadOnline.Checked)
                        {
                            this.PICBXnumber.Load(d.ImageLink);
                            this.PICBXnumber.Image.Save(ip);
                        }
                    }
                    catch
                    {
                    }
                }
                /*//////*/
                dataBasemanager.AddNew(d);

                lblNumberError.Visible  = d.HasError;
                lnkLblPlzSignIn.Visible = (d.ErrorType == NumberError.SessionError);

                gpxInfo.Visible = true;
            }
            catch {   }
        }
Esempio n. 16
0
        internal static DumbedNumber Build(string line)
        {
            DumbedNumber d = new DumbedNumber(true);
            if (line.Contains("®") == false)
            {
                if (line.Contains(":"))
                {
                    string[] pcs = line.Split(new char[] { ':' });
                    d.number = pcs[1];

                }
                else return null;
            }
            else
            {
                string[] spdByPeace = line.Split(new char[] { '®' });

                string numbandval =spdByPeace[0];
                if(numbandval.Contains(":"))
                    d.number = numbandval.Split(new char[] { ':' })[1];

                string countru_and_val = spdByPeace[1];
                if (countru_and_val.Contains(":"))
                    d.CountryAbb = DumbedNumber.ValidAbb (countru_and_val.Split(new char[] { ':' })[1]);

                if(spdByPeace.Length<3)
                    return d;
                string  nameandVal = spdByPeace[2];
                if(nameandVal.Contains(":"))
                    d.name = nameandVal.Split(new char[] { ':' })[1];

                if (spdByPeace.Length < 4)
                    return d;

                string imagandlink = spdByPeace[3];
                if (imagandlink.Contains(":"))
                {
                    if (imagandlink.Contains("Has no ima") == false)
                    {  // has image at:http://ask.com
                        string [] tmp =imagandlink.Split(new char [] {':'});
                        for (int i = 1; i < tmp.Length; i++)
                            d.ImageLink += tmp[i] + ":";
                        d.ImageLink = d.ImageLink.Substring(0, d.ImageLink.Length - 1);

                    }
                    if (d.ImageLink.IsUrl())
                        d.HasImage = true;
                }

                if (spdByPeace.Length < 5)
                    return d;
                string timeandVal = spdByPeace[4];
                if (timeandVal.Contains(":"))
                    d.CreationTime = timeandVal.Split(new char[] { ':' })[1];

            }

            return d;
        }