Пример #1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            Button button1 = sender as Button;

            if (button1.Text == "Iniciar")
            {
                string i = button1.Tag.ToString();

                Label ipYPuertoN = Form1.listaDeIpYPuerto[Convert.ToInt32(i)];
                ipYPuertoN.ForeColor = System.Drawing.Color.Red;
                ipYPuertoN.Text      = ipYPuertoN.Text.Substring(0, ipYPuertoN.Text.IndexOf(":")) + ":" + (int.Parse(i) + 30000).ToString();
                Label ipTor = Form1.listaDeIpTor[Convert.ToInt32(i)];
                ipTor.ForeColor = System.Drawing.Color.Red;

                ProxyTor.ProxyTor_N(i);
                ipYPuertoN.ForeColor = System.Drawing.Color.Yellow;
                ipTor.ForeColor      = System.Drawing.Color.Yellow;
                string IpTor = ProxyTor.CualEsNiIp(i);
                while (IpTor.Length < "0.0.0.0".Length)
                {
                    IpTor = ProxyTor.CualEsNiIp(i);
                }
                ipYPuertoN.ForeColor            = System.Drawing.Color.Green;
                ipTor.ForeColor                 = System.Drawing.Color.Green;
                listaDeIpTor[int.Parse(i)].Text = IpTor;
                button1.Text = "Parar";
            }
            else
            {
                string i = button1.Tag.ToString();
                ProxyTor.KillPolipoYTor_N(i);
                button1.Text = "Iniciar";

                Label ipYPuertoN = Form1.listaDeIpYPuerto[Convert.ToInt32(i)];
                ipYPuertoN.ForeColor = System.Drawing.Color.Red;
                ipYPuertoN.Text      = ipYPuertoN.Text.Substring(0, ipYPuertoN.Text.IndexOf(":")) + ":" + (int.Parse(i) + 30000).ToString();
                Label ipTor = Form1.listaDeIpTor[Convert.ToInt32(i)];
                ipTor.ForeColor = System.Drawing.Color.Red;
                ipYPuertoN.Text = "127.0.0.1:00000";
                ipTor.Text      = "0.0.0.0";


                ipYPuertoN.ForeColor = System.Drawing.Color.Red;
                ipTor.ForeColor      = System.Drawing.Color.Red;
            }
        }
Пример #2
0
        private void CheckBox4_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox checkBox4 = sender as CheckBox;

            int   i          = Convert.ToInt32(checkBox4.Tag);
            Label ipYPuertoN = Form1.listaDeIpYPuerto[Convert.ToInt32(i)];

            if (checkBox4.Checked == true)
            {
                ProxyTor.EjecutarFirefoxProxy(ipYPuertoN.Text);
                checkBox4.Text = "Conectado";
            }
            else
            {
                checkBox4.Text = "Desconectado";
            }
        }
Пример #3
0
        private void CheckBox1_CheckedChanged(object sender, EventArgs e)
        {
            CheckBox checkBox1 = sender as CheckBox;

            int   i          = Convert.ToInt32(checkBox1.Tag);
            Label ipYPuertoN = Form1.listaDeIpYPuerto[Convert.ToInt32(i)];


            if (checkBox1.Checked)
            {
                string puerto = ipYPuertoN.Text.Substring(ipYPuertoN.Text.IndexOf(":") + 1);

                ProxyTor.ConectarGlobalAProxy("localhost", puerto);
                checkBox1.Text = "Conectado";
            }
            else
            {
                ProxyTor.ResetearGlobalProxy();

                checkBox1.Text = "Desconectado";
            }
        }
Пример #4
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     ProxyTor.ResetearGlobalProxy();
     ProxyTor.ResetearGlobalProxyWinhttp();
     ProxyTor.KillPolipoYTorTodos();
 }