Exemplo n.º 1
0
 private void lbGeneBigData_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (null != slLogger)
     {
         slLogger.Trace(">> Game Selection changed in search results");
     }
     if (lbGeneBigData.SelectedIndex > -1)
     {
         ClPS1Game psGame = (ClPS1Game)(lbGeneBigData.Items[lbGeneBigData.SelectedIndex]);
         String    sTitle = psGame.Title.Trim();
         int       ipos   = sTitle.LastIndexOf("- [");
         if (ipos > -1)
         {
             sTitle = sTitle.Substring(0, ipos).Trim();
         }
         tbGeneTitle.Text   = sTitle.Trim();
         tbGeneDiscs.Text   = psGame.Serial.Trim();
         tbHiddenLink.Text  = psGame.Link.Trim();
         btLink.Enabled     = true;
         btViewPage.Enabled = true;
     }
     else
     {
         btLink.Enabled     = false;
         btViewPage.Enabled = false;
     }
     if (null != slLogger)
     {
         slLogger.Trace("<< Game Selection changed in search results");
     }
 }
Exemplo n.º 2
0
 private void btViewPage_Click(object sender, EventArgs e)
 {
     if (null != slLogger)
     {
         slLogger.Trace(">> View webpage Click");
     }
     if (lbGeneBigData.SelectedIndex > -1)
     {
         try
         {
             wbViewer.Navigate("about:blank");
             btScraper.Enabled   = false;
             btScrapeImg.Enabled = false;
             ClPS1Game psGame = (ClPS1Game)(lbGeneBigData.Items[lbGeneBigData.SelectedIndex]);
             //wbViewer.Url = new Uri("http://psxdatacenter.com/" + psGame.Link.Trim());
             wbViewer.Navigate("http://psxdatacenter.com/" + psGame.Link.Trim());
         }
         catch (Exception ex)
         {
             if (null != slLogger)
             {
                 slLogger.Fatal(ex.Message);
             }
         }
     }
     if (null != slLogger)
     {
         slLogger.Trace("<< View webpage Click");
     }
 }
Exemplo n.º 3
0
        private void btGeneSearch_Click(object sender, EventArgs e)
        {
            if (null != slLogger)
            {
                slLogger.Trace(">> Search Game Click");
            }
            String s = tbGeneSearchText.Text.Trim().ToUpper();

            lbGeneBigData.Items.Clear();
            lbGeneBigData.DisplayMember = "DisplayTitle";
            tbHiddenLink.Text           = "";
            btScraper.Enabled           = false;
            btScrapeImg.Enabled         = false;
            btViewPage.Enabled          = false;
            btLink.Enabled = false;
            _docHtmlStr    = String.Empty;
            if (dcPs1Games.Count > 0)
            {
                if (s.Length >= 2)
                {
                    foreach (KeyValuePair <string, ClPS1Game> pair in dcPs1Games)
                    {
                        ClPS1Game c1 = pair.Value;
                        if (c1.Title.ToUpper().Contains(s))
                        {
                            lbGeneBigData.Items.Add(c1);
                        }
                    }
                }
                else
                {
                    FlexibleMessageBox.Show("You have to enter at least 2 characters (other than space) to search something.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            else
            {
                FlexibleMessageBox.Show("Error. Gamelist not loaded.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            if (null != slLogger)
            {
                slLogger.Trace("<< Search Game Click");
            }
        }
Exemplo n.º 4
0
        private void btBinFindSerial_Click(object sender, EventArgs e)
        {
            lbResultBinFindSerial.Text = "Running...";
            tbSerialFound.Text         = String.Empty;
            lbGameFound.Text           = String.Empty;

            try
            {
                using (FileStream fs = new FileStream(tbBinFile.Text, FileMode.Open))
                {
                    List <String> lsSerialStart = new List <string>()
                    {
                        "SCUS", "SLUS", "SCES", "SLES", "SCPS", "SLPS", "SCPM", "SLPM"
                    };
                    String sInfoSearch1  = "CD001";
                    String sInfoSearch2  = "PLAYSTATION";
                    long   len1          = fs.Length;
                    int    len2          = 20;
                    bool   bFound        = false;
                    bool   bFound2       = false;
                    byte[] bSearchSerial = new byte[len2];
                    byte[] bSearchInfo   = new byte[53];
                    String s             = String.Empty;
                    String s1            = String.Empty;
                    for (int index = 0; index < len1; index += len2)
                    {
                        fs.Seek(index, SeekOrigin.Begin);
                        fs.Read(bSearchSerial, 0, len2);
                        for (int i = 0; i < len2; i++)
                        {
                            if ((!bFound) && (bSearchSerial[i] == (byte)('S')))
                            {
                                index += i;
                                fs.Seek(index, SeekOrigin.Begin);
                                fs.Read(bSearchSerial, 0, len2);
                                s = Encoding.UTF8.GetString(bSearchSerial);
                                s = s.Replace(".", "").Replace("_", "").Replace("-", "").Trim();
                                if (s.Length >= 9)
                                {
                                    if (lsSerialStart.IndexOf(s.Substring(0, 4)) > -1)
                                    {
                                        bFound = true;
                                        s      = (s.Substring(0, 4) + "-" + (s.Substring(4, 6)).Replace("P", "").Substring(0, 5)).ToUpper();
                                    }
                                }
                            }
                            else
                            if ((!bFound2) && (bSearchSerial[i] == (byte)('C')) && (i < len1 - 1) && (bSearchSerial[1 + i] == (byte)('D')))
                            {
                                index += i;
                                fs.Seek(index, SeekOrigin.Begin);
                                fs.Read(bSearchSerial, 0, 5);
                                bSearchSerial[5] = 0;
                                s = Encoding.UTF8.GetString(bSearchSerial);
                                if (s.IndexOf(sInfoSearch1) == 0)
                                {
                                    index += 7;
                                    fs.Seek(index, SeekOrigin.Begin);
                                    fs.Read(bSearchSerial, 0, 11);
                                    bSearchSerial[11] = 0;
                                    s = Encoding.UTF8.GetString(bSearchSerial);
                                    if (s.IndexOf(sInfoSearch2) == 0)
                                    {
                                        index += 11;
                                        fs.Seek(index, SeekOrigin.Begin);
                                        fs.Read(bSearchInfo, 0, 53);
                                        s1      = Encoding.UTF8.GetString(bSearchInfo);
                                        bFound2 = true;
                                    }
                                }
                            }
                            if (bFound && bFound2)
                            {
                                break;
                            }
                        }
                        if (bFound && bFound2)
                        {
                            break;
                        }
                    }
                    if (bFound)
                    {
                        lbResultBinFindSerial.Text = String.Empty; // "Serial found ->";
                        tbSerialFound.Text         = s;
                        if (!String.IsNullOrEmpty(s1))
                        {
                            lbGameInfoFound.Text = s1.Trim();
                        }
                        else
                        {
                            lbGameInfoFound.Text = String.Empty;
                        }
                        foreach (KeyValuePair <string, ClPS1Game> pair in dcPs1Games)
                        {
                            ClPS1Game c1 = pair.Value;
                            if (c1.Serial.ToUpper().Contains(s))
                            {
                                lbGameFound.Text = c1.Title;
                                break;
                            }
                        }
                    }
                    else
                    {
                        lbResultBinFindSerial.Text = "No serial found.";
                        tbSerialFound.Text         = String.Empty;
                        lbGameFound.Text           = String.Empty;
                    }
                }
            }
            catch (Exception ex)
            {
                lbResultBinFindSerial.Text = ex.Message;
                tbSerialFound.Text         = String.Empty;
            }
        }