Advertisement
BaSs_HaXoR

PS3Lib 4.4.8 SOURCE CODE (IPList.cs) (10-27-14)

Oct 27th, 2014
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace PS3Lib
  10. {
  11.     public partial class IPList : Form
  12.     {
  13.         public IPList()
  14.         {
  15.             InitializeComponent();
  16.         }
  17.  
  18.         public string consoleipaddress
  19.         {
  20.             set { this.label2.Text = value; }
  21.             get { return this.label2.Text; }
  22.         }
  23.  
  24.         //FUCK HOLY SHIT THIS TOOK AWHILE :p ~3 Hours for this shit
  25.         /// <summary>
  26.         /// reason: didn't realize it was saving the string array like this:
  27.         ///  { "allips and macs here" } //string[] ipmac
  28.         /// instead of being like this: { "one.ip.here + mac", "two.ip.here + mac"... and so on }
  29.         /// </summary>
  30.         CCAPI CC = new CCAPI();
  31.         public string[] ipmac;
  32.         public void clearcombo()
  33.         {
  34.             ipmac = new string[]{ "" };
  35.             comboBox1.Text = "";
  36.             comboBox1.Items.Clear();
  37.         }
  38.         private void IPList_Load(object sender, EventArgs e)
  39.         {
  40.             string[] ipmac2 = ipmac;
  41.             string publicip = "";
  42.             label2.Text = publicip;
  43.             int count = 0;
  44.             string ips = string.Join(",", ipmac2);
  45.             ips = ips.TrimEnd(',');
  46.          //   MessageBox.Show(ips);
  47.             char[] splitchar = { ',' };
  48.             ipmac2 = ips.Split(splitchar);
  49.             for (count = 0; count <= ipmac2.Length - 1; count++)
  50.             {
  51.                 string iparray = ipmac2[count];
  52.                 comboBox1.Items.Add(iparray);
  53.             }
  54.             label1.Text = "PS3Lib " + "Version: " + this.ProductVersion + "\n" + "Modified By: BaSs_HaXoR";
  55.             label1.Left = (label1.Parent.Width - label1.Width) / 2;
  56.         }
  57.         //FUCK HOLY SHIT THIS TOOK AWHILE :p ~3 Hours for this shit
  58.  
  59.         public string connection = "N/a";
  60.         public string MACaddress = "N/a";
  61.         public string consoleip()
  62.         {
  63.             string[] ipmac2 = ipmac;
  64.               //  int count = 0;
  65.             string ips = string.Join(",", ipmac);
  66.             ips = ips.TrimEnd(',');
  67.             //   MessageBox.Show(ips);
  68.             char[] splitchar = { ',' };
  69.             ipmac2 = ips.Split(splitchar);
  70.           /*  for (count = 0; count <= ipmac.Length - 1; count++)
  71.             {*/
  72.                 string iparray = ipmac2[1];
  73.            // }
  74.             //comboBox1.SelectedIndex = 1;
  75.                 connection = iparray;// comboBox1.Text;
  76.             //   MACaddress = comboBox1.Text;
  77.             connection = connection.Split('-')[0];
  78.             //  MACaddress = MACaddress.Substring(MACaddress.LastIndexOf(@"-") + 1);
  79.             connection = connection.Replace(" ", "");
  80.             return connection;
  81.         }
  82.         public void quickconnvoid(int icon, string yourmessage)
  83.         {
  84.           //  int count = 0;
  85.             string[] ipmac2 = ipmac;
  86.             string ips = string.Join(",", ipmac2);
  87.             ips = ips.TrimEnd(',');
  88.             //   MessageBox.Show(ips);
  89.             char[] splitchar = { ',' };
  90.             ipmac2 = ips.Split(splitchar);
  91.           /*  for (count = 0; count <= ipmac.Length - 1; count++)
  92.             {*/
  93.             string iparray;
  94.             try
  95.             {
  96.                 iparray = ipmac2[1];
  97.             }
  98.             catch
  99.             {
  100.                 iparray = ipmac2[0];
  101.             }
  102.            // }
  103.             //comboBox1.SelectedIndex = 1;
  104.                 connection = iparray;// comboBox1.Text;
  105.             //   MACaddress = comboBox1.Text;
  106.             connection = connection.Split('-')[0];
  107.             //  MACaddress = MACaddress.Substring(MACaddress.LastIndexOf(@"-") + 1);
  108.             connection = connection.Replace(" ", "");
  109.             CC.ConnectTarget(connection);
  110.             CC.RingBuzzer(CCAPI.BuzzerMode.Single);
  111.             CC.Notify(icon, yourmessage);
  112.            
  113.             //return connection;
  114.         }
  115.         private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  116.         {
  117.             connection = comboBox1.Text;
  118.             //   MACaddress = comboBox1.Text;
  119.             connection = connection.Split('-')[0];
  120.             //  MACaddress = MACaddress.Substring(MACaddress.LastIndexOf(@"-") + 1);
  121.             connection = connection.Replace(" ", "");
  122.             //IPList ipz = new IPList();
  123.            // ConsoleInfo ci = new ConsoleInfo();
  124.            // ci.myip = connection;
  125.         }
  126.  
  127.         private void label1_Click(object sender, EventArgs e)
  128.         {
  129.  
  130.         }
  131.  
  132.         private void btnConnect_Click(object sender, EventArgs e)
  133.         {
  134.             if (comboBox1.SelectedIndex == 0)
  135.             {
  136.                 MessageBox.Show("Please Select a Console to connect to!");
  137.             }
  138.             try
  139.             {
  140.                 PS3API PS3 = new PS3API();
  141.                 PS3.CCAPI.ConnectTarget(connection);
  142.                 PS3.CCAPI.RingBuzzer(CCAPI.BuzzerMode.Double);
  143.                 PS3.CCAPI.Notify(CCAPI.NotifyIcon.FRIEND, "Connected To: " + consoleip());
  144.                 label2.Text = connection;
  145.                 CC.CCAPIConnection = true;
  146.                 System.Threading.Thread.Sleep(100);
  147.                 if (consolecheck.Checked)
  148.                 {
  149.              //       PS3.CCAPI.ShowConsole();
  150.                 }
  151.                 else
  152.                 {
  153.                     //
  154.                 }
  155.             }
  156.             catch
  157.             {
  158.                 label2.Text = ". . . .";
  159.                 CC.CCAPIConnection = false;
  160.             }
  161.             this.Hide();
  162.         }
  163.  
  164.         private void checkBox1_CheckedChanged(object sender, EventArgs e)
  165.         {
  166.            
  167.         }
  168.  
  169.         private void groupConnect_Enter(object sender, EventArgs e)
  170.         {
  171.  
  172.         }
  173.     }
  174. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement