elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


  Mostrar Temas
Páginas: 1 2 3 4 5 [6] 7
51  Seguridad Informática / Seguridad / Ayuda -Entrar a un foro que he sido baneado en: 9 Enero 2011, 22:37 pm
Bueno, no se si es la sección correcta pero fue la q mas me parecio logica. La cosa es que me banearon de un foro y quisiera saber como funciona eso, me banearon la cuenta, eso lo entenderia pero q mas pueden hacer? banearme la ip? como es eso si mi ip es dinamica? Borre las cookies pero me sigue poniendo el mensaje: "XXX-ZERO-XXX, tienes negado el permiso a este foro, Eres un mentiroso" xD

Sera qe no borre bien?
Como es lo del baneo de las ip?, por rango? como es eso?
52  Programación / .NET (C#, VB.NET, ASP) / Me pueden dar consejos para optimizar mi code? C# en: 22 Diciembre 2010, 20:41 pm
Bueno resulta q logre hacer un proyecto q tanto queria, ahora quiero ver si puedo optimizarlo y quede mas corto y mas profesional, quiero ver si me ayudan con eso, critiquen todo lo q sea, lo mas minimo critiquen.
Bueno aca dejo, es largo perdonen:

Código
  1.  
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.    class Program
  10.    {
  11.        private static int[] Mazo = new int[21];
  12.        private static int[] SegundaR = new int[21];
  13.        private static int[] TerceraR = new int[21];
  14.        private static int[] CuartaR = new int[21];
  15.        private static int[] QuintaR = new int[21];
  16.        private static int[] Pozo1 = new int[7];
  17.        private static int[] Pozo2 = new int[7];
  18.        private static int[] Pozo3 = new int[7];
  19.  
  20.  
  21.        private static int opc;
  22.        private static int j = 0;
  23.        private static int g = 0;
  24.        private static int h = 0;
  25.        private static int f = 20;
  26.        private static int k = 0;
  27.  
  28.  
  29.        public static void Mostrar2(int[] mazito1, int[] mazito2, int[] mazito3, int nummazo)
  30.  
  31.        {
  32.  
  33.            int warning = 0;
  34.            do
  35.            {
  36.                Console.Clear();
  37.                Console.WriteLine();
  38.                Console.WriteLine("  - Elegiste el pozo numero {0}", nummazo);
  39.                Console.WriteLine();
  40.                try
  41.                {
  42.                    Console.WriteLine("-  POZO 1  -");
  43.                    Console.WriteLine();
  44.                    for (int i = 0; i < mazito1.Length; i++)
  45.                    {
  46.                        Console.WriteLine("Carta Nº: {0}", mazito1[i]);
  47.  
  48.  
  49.                    }
  50.                    Console.WriteLine(); Console.WriteLine();
  51.                    Console.WriteLine("-  POZO 2  -");
  52.                    Console.WriteLine();
  53.                    for (int i = 0; i < mazito2.Length; i++)
  54.                    {
  55.                        Console.WriteLine("Carta Nº: {0}", mazito2[i]);
  56.  
  57.  
  58.                    }
  59.  
  60.                    Console.WriteLine(); Console.WriteLine();
  61.                    Console.WriteLine("-  POZO 3  -");
  62.                    Console.WriteLine();
  63.                    for (int i = 0; i < mazito3.Length; i++)
  64.                    {
  65.                        Console.WriteLine("Carta Nº: {0}", mazito3[i]);
  66.  
  67.  
  68.                    }
  69.  
  70.                    Console.WriteLine(); Console.WriteLine();
  71.  
  72.                    Console.Write("  - Vuelve a escribir el pozo donde se encuentra tu numero: ");
  73.  
  74.                    opc = int.Parse(Console.ReadLine());
  75.  
  76.                    if ((opc != 1) && (opc != 2) && (opc != 3))
  77.                    {
  78.                        Console.Clear();
  79.                        Console.WriteLine();
  80.                        Console.WriteLine("  - NUMERO INCORRECTO, SON 3 POZOS SOLAMENTE xD");
  81.                        warning = 0;
  82.                        Console.WriteLine();
  83.                        Console.WriteLine(" Presione una tecla para volver..");
  84.                        Console.ReadKey();
  85.                    }
  86.                    else warning = 1;
  87.  
  88.                }
  89.                catch
  90.                { }
  91.            } while (warning == 0);
  92.  
  93.  
  94.            switch (opc)
  95.            {
  96.                case 1:
  97.                    f = 20;
  98.                    h = 0;
  99.                    g = 0;
  100.                    k = 0;
  101.  
  102.                    for (int i = 0; i < mazito2.Length; i++)
  103.                    {
  104.                        CuartaR[k] = mazito2[i];
  105.                        k++;
  106.                    }
  107.  
  108.                    for (int i = 0; i < mazito1.Length; i++)
  109.                    {
  110.                        CuartaR[k] = mazito1[i];
  111.                        k++;
  112.                    }
  113.  
  114.                    for (int i = 0; i < mazito3.Length; i++)
  115.                    {
  116.                        CuartaR[k] = mazito3[i];
  117.                        k++;
  118.                    }
  119.  
  120.                    for (int i = 0; i < 7; i++)
  121.                    {
  122.  
  123.                        Pozo1[i] = CuartaR[f];
  124.                        f--;
  125.  
  126.                        Pozo2[g] = CuartaR[f];
  127.                        f--;
  128.                        Pozo3[h] = CuartaR[f];
  129.  
  130.                        g++;
  131.                        h++;
  132.                        f--;
  133.  
  134.  
  135.                    }
  136.  
  137.  
  138.                    Console.Clear();
  139.                    Console.WriteLine("Elegiste la carta Nº {0}, no?", CuartaR[10]);
  140.                    Console.Read();
  141.                    Console.WriteLine("Lo sabia, soy un genio!!!!!!");
  142.  
  143.  
  144.                    break;
  145.  
  146.  
  147.                case 2:
  148.  
  149.                    f = 20;
  150.                    h = 0;
  151.                    g = 0;
  152.                    k = 0;
  153.  
  154.                    for (int i = 0; i < mazito3.Length; i++)
  155.                    {
  156.                        CuartaR[k] = mazito3[i];
  157.                        k++;
  158.                    }
  159.  
  160.  
  161.  
  162.  
  163.                    for (int i = 0; i < mazito2.Length; i++)
  164.                    {
  165.                        CuartaR[k] = mazito2[i];
  166.                        k++;
  167.                    }
  168.  
  169.  
  170.  
  171.  
  172.                    for (int i = 0; i < mazito1.Length; i++)
  173.                    {
  174.                        CuartaR[k] = mazito1[i];
  175.                        k++;
  176.                    }
  177.  
  178.  
  179.                    for (int i = 0; i < 7; i++)
  180.                    {
  181.  
  182.                        Pozo1[i] = CuartaR[f];
  183.                        f--;
  184.  
  185.                        Pozo2[g] = CuartaR[f];
  186.                        f--;
  187.                        Pozo3[h] = CuartaR[f];
  188.  
  189.                        g++;
  190.                        h++;
  191.                        f--;
  192.  
  193.  
  194.                    }
  195.                    Console.Clear();
  196.                    Console.WriteLine("Elegiste la carta Nº {0}, no?", CuartaR[10]);
  197.                    Console.Read();
  198.                    Console.WriteLine("Lo sabia, soy un genio!!!!!!");
  199.                    break;
  200.  
  201.                case 3:
  202.                    f = 20;
  203.                    h = 0;
  204.                    g = 0;
  205.                    k = 0;
  206.  
  207.                    for (int i = 0; i < mazito1.Length; i++)
  208.                    {
  209.                        CuartaR[k] = mazito1[i];
  210.                        k++;
  211.                    }
  212.  
  213.  
  214.                    for (int i = 0; i < mazito3.Length; i++)
  215.                    {
  216.                        CuartaR[k] = mazito3[i];
  217.                        k++;
  218.                    }
  219.  
  220.                    for (int i = 0; i < mazito2.Length; i++)
  221.                    {
  222.                        CuartaR[k] = mazito2[i];
  223.                        k++;
  224.                    }
  225.  
  226.                    for (int i = 0; i < 7; i++)
  227.                    {
  228.  
  229.                        Pozo1[i] = CuartaR[f];
  230.                        f--;
  231.  
  232.                        Pozo2[g] = CuartaR[f];
  233.                        f--;
  234.                        Pozo3[h] = CuartaR[f];
  235.  
  236.                        g++;
  237.                        h++;
  238.                        f--;
  239.  
  240.  
  241.                    }
  242.  
  243.                    Console.Clear();
  244.                    Console.WriteLine("Elegiste la carta Nº {0}, no?", CuartaR[10]);
  245.                    Console.Read();
  246.                    Console.WriteLine("Lo sabia, soy un genio!!!!!!");
  247.                    break;
  248.  
  249.            }
  250.  
  251.        }
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.        public static void Mostrar(int[] pozito1, int[] pozito2, int[] pozito3, int numpozo)
  266.        {
  267.  
  268.            int mistake = 0;
  269.            do
  270.            {
  271.                Console.Clear();
  272.                Console.WriteLine();
  273.                Console.WriteLine("  - Elegiste el pozo numero {0}", numpozo);
  274.                Console.WriteLine();
  275.                try
  276.                {
  277.                    Console.WriteLine("-  POZO 1  -");
  278.                    Console.WriteLine();
  279.                    for (int i = 0; i < pozito1.Length; i++)
  280.                    {
  281.                        Console.WriteLine("Carta Nº: {0}", pozito1[i]);
  282.  
  283.  
  284.                    }
  285.                    Console.WriteLine(); Console.WriteLine();
  286.                    Console.WriteLine("-  POZO 2  -");
  287.                    Console.WriteLine();
  288.                    for (int i = 0; i < pozito2.Length; i++)
  289.                    {
  290.                        Console.WriteLine("Carta Nº: {0}", pozito2[i]);
  291.  
  292.  
  293.                    }
  294.  
  295.                    Console.WriteLine(); Console.WriteLine();
  296.                    Console.WriteLine("-  POZO 3  -");
  297.                    Console.WriteLine();
  298.                    for (int i = 0; i < pozito3.Length; i++)
  299.                    {
  300.                        Console.WriteLine("Carta Nº: {0}", pozito3[i]);
  301.  
  302.  
  303.                    }
  304.  
  305.                    Console.WriteLine(); Console.WriteLine();
  306.  
  307.                    Console.Write("  - Vuelve a escribir el pozo donde se encuentra tu numero: ");
  308.  
  309.                    opc = int.Parse(Console.ReadLine());
  310.  
  311.                    if ((opc != 1) && (opc != 2) && (opc != 3))
  312.                    {
  313.                        Console.Clear();
  314.                        Console.WriteLine();
  315.                        Console.WriteLine("  - NUMERO INCORRECTO, SON 3 POZOS SOLAMENTE xD");
  316.                        mistake = 0;
  317.                        Console.WriteLine();
  318.                        Console.WriteLine(" Presione una tecla para volver..");
  319.                        Console.ReadKey();
  320.                    }
  321.                    else mistake = 1;
  322.  
  323.                }
  324.                catch
  325.                { }
  326.            } while (mistake == 0);
  327.  
  328.  
  329.            switch (opc)
  330.            {
  331.                case 1:
  332.  
  333.                    f = 20;
  334.                    h = 0;
  335.                    g = 0;
  336.                    j = 0;
  337.  
  338.                    for (int i = 0; i < pozito2.Length; i++)
  339.                    {
  340.                        TerceraR[j] = pozito2[i];
  341.                        j++;
  342.                    }
  343.  
  344.                    for (int i = 0; i < pozito1.Length; i++)
  345.                    {
  346.                        TerceraR[j] = pozito1[i];
  347.                        j++;
  348.                    }
  349.  
  350.                    for (int i = 0; i < pozito3.Length; i++)
  351.                    {
  352.                        TerceraR[j] = pozito3[i];
  353.                        j++;
  354.                    }
  355.  
  356.                    for (int i = 0; i < 7; i++)
  357.                    {
  358.  
  359.                        Pozo1[i] = TerceraR[f];
  360.                        f--;
  361.  
  362.                        Pozo2[g] = TerceraR[f];
  363.                        f--;
  364.                        Pozo3[h] = TerceraR[f];
  365.  
  366.                        g++;
  367.                        h++;
  368.                        f--;
  369.  
  370.  
  371.                    }
  372.  
  373.  
  374.  
  375.  
  376.                    Mostrar2(Pozo1, Pozo2, Pozo3, 1);
  377.  
  378.                    break;
  379.  
  380.  
  381.                case 2:
  382.                    f = 20;
  383.                    h = 0;
  384.                    g = 0;
  385.                    j = 0;
  386.  
  387.                    for (int i = 0; i < pozito3.Length; i++)
  388.                    {
  389.                        TerceraR[j] = pozito3[i];
  390.                        j++;
  391.                    }
  392.  
  393.  
  394.  
  395.  
  396.                    for (int i = 0; i < pozito2.Length; i++)
  397.                    {
  398.                        TerceraR[j] = pozito2[i];
  399.                        j++;
  400.                    }
  401.  
  402.  
  403.  
  404.  
  405.                    for (int i = 0; i < pozito1.Length; i++)
  406.                    {
  407.                        TerceraR[j] = pozito1[i];
  408.                        j++;
  409.                    }
  410.  
  411.  
  412.                    for (int i = 0; i < 7; i++)
  413.                    {
  414.                        Pozo1[i] = TerceraR[f];
  415.                        f--;
  416.                        Pozo2[g] = TerceraR[f];
  417.                        f--;
  418.                        Pozo3[h] = TerceraR[f];
  419.  
  420.  
  421.                        g++;
  422.                        h++;
  423.                        f--;
  424.  
  425.  
  426.  
  427.  
  428.                    }
  429.  
  430.  
  431.  
  432.                    Mostrar2(Pozo1, Pozo2, Pozo3, 2);
  433.                    break;
  434.  
  435.                case 3:
  436.  
  437.  
  438.                    f = 20;
  439.                    h = 0;
  440.                    g = 0;
  441.                    j = 0;
  442.  
  443.  
  444.                    for (int i = 0; i < pozito1.Length; i++)
  445.                    {
  446.                        TerceraR[j] = pozito1[i];
  447.                        j++;
  448.                    }
  449.  
  450.  
  451.                    for (int i = 0; i < pozito3.Length; i++)
  452.                    {
  453.                        TerceraR[j] = pozito3[i];
  454.                        j++;
  455.                    }
  456.  
  457.                    for (int i = 0; i < pozito2.Length; i++)
  458.                    {
  459.                        TerceraR[j] = pozito2[i];
  460.                        j++;
  461.                    }
  462.  
  463.                    for (int i = 0; i < 7; i++)
  464.                    {
  465.                        Pozo1[i] = TerceraR[f];
  466.                        f--;
  467.  
  468.                        Pozo2[g] = TerceraR[f];
  469.                        f--;
  470.                        Pozo3[h] = TerceraR[f];
  471.  
  472.                        g++;
  473.                        h++;
  474.                        f--;
  475.  
  476.  
  477.                    }
  478.  
  479.                    Mostrar2(Pozo1, Pozo2, Pozo3, 3);
  480.                    break;
  481.  
  482.            }
  483.  
  484.        }
  485.  
  486.        public static bool NumExists(int Num, int MaxPos)
  487.        {
  488.            bool resultado = false;
  489.            for (int i = 0; i < MaxPos; i++)
  490.                if (Mazo[i] == Num)
  491.                {
  492.                    resultado = true;
  493.                    break;
  494.                }
  495.            return resultado;
  496.        }
  497.  
  498.  
  499.  
  500.        public static void RandomNumbers()
  501.        {
  502.            Random Rnd = new Random(unchecked((int)DateTime.Now.Ticks));
  503.            for (int i = 0; i < Mazo.Length; i++)
  504.                do
  505.                {
  506.                    Mazo[i] = Rnd.Next(1,22);
  507.                } while (NumExists(Mazo[i], i) == true);
  508.            Rnd = null;
  509.        }
  510.  
  511.  
  512.  
  513.  
  514.        static void Main(string[] args)
  515.        {
  516.            Console.BackgroundColor = ConsoleColor.Black;
  517.            Console.ForegroundColor = ConsoleColor.Green;
  518.            Console.Title = "Adivinador";
  519.            Console.WindowHeight = 40;
  520.            Console.WindowWidth = 90;
  521.  
  522.            int error = 0;
  523.  
  524.            do
  525.            {
  526.  
  527.            RandomNumbers();
  528.  
  529.                Console.Clear();
  530.                Console.WriteLine();
  531.                Console.WriteLine("  - Se han repartido las cartas, piensa en una y recuerdala que tratare de adivinarla");
  532.                Console.WriteLine(); Console.WriteLine();
  533.                Console.WriteLine("-  POZO 1  -");
  534.                Console.WriteLine();
  535.  
  536.                try
  537.                {
  538.                    for (int i = 0; i < 7; i++)
  539.                        Console.WriteLine("Carta Nº: {0}", Mazo[i]);
  540.                    Console.WriteLine(); Console.WriteLine();
  541.                    Console.WriteLine("-  POZO 2  -");
  542.                    Console.WriteLine();
  543.  
  544.                    for (int i = 7; i < 14; i++)
  545.                        Console.WriteLine("Carta Nº: {0}", Mazo[i]);
  546.                    Console.WriteLine(); Console.WriteLine();
  547.                    Console.WriteLine("-  POZO 3  -");
  548.                    Console.WriteLine();
  549.  
  550.                    for (int i = 14; i < 21; i++)
  551.                        Console.WriteLine("Carta Nº: {0}", Mazo[i]);
  552.                    Console.WriteLine(); Console.WriteLine();
  553.  
  554.                    Console.Write("  - Tu carta elegida esta en el pozo numero: ");
  555.  
  556.                    int opc = int.Parse(Console.ReadLine());
  557.                    error = 1;
  558.  
  559.  
  560.                    switch (opc)
  561.                    {
  562.                        case 1:
  563.  
  564.                            f = 20;
  565.                            h = 0;
  566.                            g = 0;
  567.                            j = 0;
  568.  
  569.                            for (int i = 7; i < 14; i++)
  570.                            {
  571.                                SegundaR[j] = Mazo[i];
  572.                                j++;
  573.                            }
  574.  
  575.                            for (int i = 0; i < 7; i++)
  576.                            {
  577.                                SegundaR[j] = Mazo[i];
  578.                                j++;
  579.                            }
  580.  
  581.                            for (int i = 14; i < 21; i++)
  582.                            {
  583.                                SegundaR[j] = Mazo[i];
  584.                                j++;
  585.                            }
  586.  
  587.                            for (int i = 0; i < 7; i++)
  588.                            {
  589.  
  590.                                Pozo1[i] = SegundaR[f];
  591.                                f--;
  592.  
  593.                                Pozo2[g] = SegundaR[f];
  594.                                f--;
  595.                                Pozo3[h] = SegundaR[f];
  596.  
  597.                                g++;
  598.                                h++;
  599.                                f--;
  600.  
  601.  
  602.                            }
  603.  
  604.  
  605.  
  606.  
  607.                            Mostrar(Pozo1, Pozo2, Pozo3, 1);
  608.  
  609.                            break;
  610.  
  611.  
  612.                        case 2:
  613.                            f = 20;
  614.                            h = 0;
  615.                            g = 0;
  616.                            j = 0;
  617.  
  618.                            for (int i = 14; i < 21; i++)
  619.                            {
  620.                                SegundaR[j] = Mazo[i];
  621.                                j++;
  622.                            }
  623.  
  624.  
  625.  
  626.  
  627.                            for (int i = 7; i < 14; i++)
  628.                            {
  629.                                SegundaR[j] = Mazo[i];
  630.                                j++;
  631.                            }
  632.  
  633.  
  634.  
  635.  
  636.                            for (int i = 0; i < 7; i++)
  637.                            {
  638.                                SegundaR[j] = Mazo[i];
  639.                                j++;
  640.                            }
  641.  
  642.  
  643.                            for (int i = 0; i < 7; i++)
  644.                            {
  645.                                Pozo1[i] = SegundaR[f];
  646.                                f--;
  647.                                Pozo2[g] = SegundaR[f];
  648.                                f--;
  649.                                Pozo3[h] = SegundaR[f];
  650.  
  651.  
  652.                                g++;
  653.                                h++;
  654.                                f--;
  655.  
  656.  
  657.  
  658.  
  659.                            }
  660.  
  661.  
  662.  
  663.                            Mostrar(Pozo1, Pozo2, Pozo3, 2);
  664.                            break;
  665.  
  666.                        case 3:
  667.  
  668.  
  669.                            f = 20;
  670.                            h = 0;
  671.                            g = 0;
  672.                            j = 0;
  673.  
  674.  
  675.                            for (int i = 0; i < 7; i++)
  676.                            {
  677.                                SegundaR[j] = Mazo[i];
  678.                                j++;
  679.                            }
  680.  
  681.  
  682.                            for (int i = 14; i < 21; i++)
  683.                            {
  684.                                SegundaR[j] = Mazo[i];
  685.                                j++;
  686.                            }
  687.  
  688.                            for (int i = 7; i < 14; i++)
  689.                            {
  690.                                SegundaR[j] = Mazo[i];
  691.                                j++;
  692.                            }
  693.  
  694.                            for (int i = 0; i < 7; i++)
  695.                            {
  696.                                Pozo1[i] = SegundaR[f];
  697.                                f--;
  698.  
  699.                                Pozo2[g] = SegundaR[f];
  700.                                f--;
  701.                                Pozo3[h] = SegundaR[f];
  702.  
  703.                                g++;
  704.                                h++;
  705.                                f--;
  706.  
  707.  
  708.                            }
  709.  
  710.                            Mostrar(Pozo1, Pozo2, Pozo3, 3);
  711.                            break;
  712.  
  713.                        default:
  714.                            Console.Clear();
  715.                            Console.WriteLine();
  716.                            Console.WriteLine("  - NUMERO INCORRECTO, SON 3 POZOS SOLAMENTE xD");
  717.                            error = 0;
  718.                            Console.WriteLine();
  719.                            Console.WriteLine(" Presione una tecla para volver..");
  720.                            break;
  721.                    }
  722.                    Console.ReadKey();
  723.  
  724.  
  725.                }
  726.                catch
  727.                { }
  728.                } while (error == 0);
  729.  
  730.  
  731.  
  732.  
  733.        }
  734.    }
  735. }
  736.  
  737.  
53  Programación / .NET (C#, VB.NET, ASP) / AYUDA y EJERCICIO - Truco de cartas en C# en: 10 Diciembre 2010, 22:43 pm
No se si conocen el truco de las cartas que vas creando 3 mazos poniendo:

                            MAZO 1 - - MAZO 2- - MAZO3

abajo                 -CartaNº1  -  CartaNº2  -  CartaNº3
arriba                 -CartaNº4  -  CartaNº5   - CartaNº6
arriba de arriba -CartaNº7  -  CartaNº8   - CartaNº9

Y el otro tiene q elegir una carta, pensarla no decirla, y decir en q mazo se encuentra la carta que penso. Entonces si por ejemplo penso la carta Nº7, dira que se encuentra en el mazo numero 1 y entonces lo q hace el repartidor es meter ese mazo en el medio de los tres para luego repartir asi:

     MAZO 1 - - MAZO 2- - MAZO3

abajo                 -CartaNº9  -  CartaNº6 -  CartaNº3
arriba                 -CartaNº7  -  CartaNº4   - CartaNº1
arriba de arriba -CartaNº8  -  CartaNº5   - CartaNº2

Eso lo haces 3 veces y aclaro q el numero de cartas con el q se tiene q hacer son con 21 cartas. Porque entonces luego de la tercera vez que fue diciendo en q mazo estaba la que pensaba y vos ibas poniendo ese mazo en el medio de los 3 para luego repartir denuevo... Ya una vez metida la ultima vez el mazo en el medio ( la tercera vez) cuentas 11 cartas empezando desde arriba claro, y esa sera la carta q nuestro amigo penso.

Ahora si no lo conocian practiquenlo con cartas primero y luego a ver si pueden hacerlo en C# modo consola xD
54  Seguridad Informática / Análisis y Diseño de Malware / Leer las Revistas Hack x Crack ? en: 9 Diciembre 2010, 15:41 pm
Bueno resulta q tengo hace mucho tiempo las revistas de HxC q son muy conocidas y tengo sus programas q usan, y cosas de seguridad a parte, me parece buena informacion para leermela todo y una vez lei hasta la revista numero 3 pero resulta q son muy viejas y quiero saber si vale la pena leerlas de todos modos.
Porque por ejemplo talvez lo que le dicen viejo es a los programas q usan, pero talvez los metodos son usados actualmente, a ver q opinan ustedes los q ya las leyeron..
55  Programación / .NET (C#, VB.NET, ASP) / Ayuda con numeros random en arrays en: 6 Diciembre 2010, 19:01 pm
Espero que entiendan el codigo, es decir.. lo q quiero hacer, y si me lo pueden corregir, y si tienen q cambiar muchas cosas para q quede mejor no importa pero lo q quiero es generar un numero al azar desde 0 hasta 7 y ponerlo en el array[0] solo si es distinto a 0 y si no se repite con los otros indices del array, parece simple pero me ha costado y ya pregunte una vez aca pero no entendi bien y ahora quiero ver si solo pueden corregirme los errores porfavor

Código:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace juego_de_cartas
{
    class Program
    {
        Random rnd = new Random(unchecked((int)DateTime.Now.Ticks));
       public int[] pozo1 = new int[7];
        public int valor = 0;
       public int ant = 0;
        
        static void Main(string[] args)
        {
            

            Repartir();
          
        }

        public static bool IsValid(int bvalor, int bant)
        
        
                {
                    if (bvalor == 0)
                    {

                        return false;
                    }
                    else
                    {
                        if (bvalor == bant)
                        {
                            return false;
                        }
                        else
                        {
                            return true;
                        }
                    }
                }

        public static void Repartir()
        
        {

            for (int i = 0; i < pozo1.Length; i++)
            {
            first:
                valor = (int)(rnd.NextDouble() * 8D);
                ant = valor;

                if (IsValid(valor, ant))
                {
                    pozo1[i] = valor;
                    Console.WriteLine("Array de indice {0}, valor: {1}", i, pozo1[i]);
                }
                else { goto first; }
            }




            Console.ReadKey();

        }


    }

 }

56  Programación / .NET (C#, VB.NET, ASP) / Cual es mejor y cual es el mas nuevo de C# o C++ ? en: 27 Noviembre 2010, 01:55 am
Eso mismo quiero saber, cual es el mas nuevo entre C# y C++ ya q en tutoriales de C# siempre hablan de las diferencias con C++ y quiero saber si es porq son cambios nuevos y si es asi es porq es algo bueno, asique pareciera q C# es mejor.. pero a ver q me dicen ustedes
57  Foros Generales / Foro Libre / Sos zurdo o derecho? encuesta en: 25 Noviembre 2010, 15:55 pm
Quiero hacer una encuesta de cuantos zurdos o derechos hay, asique porfavor le pediria si pueden comentar poniendo si son zurdo o derecho y al lado poner la sección del foro q mas usas o te interesa y al lado si te entiendes muy bien en esa sección o solo te gusta pero no entiendes xD por ejemplo empiezo yo:


zurdo - programacion y malware - no soy un experto pero aprendo bien


pd: Aca los comentarios q quieran hacer

Gracias
58  Programación / .NET (C#, VB.NET, ASP) / Problema con arrays en C# en: 21 Noviembre 2010, 14:41 pm
Bueno la cosa es q no se como hacer para llenar datos en un array pero esos datos son al azar y no se puede ni repetir ni ser 0, entonces yo lo q hice fue hacer un bucle for y una condicion entre el medio q diga q si el numero random  q se genero es distinto de 0 y distinto de array[i-1] (el index anterior) se guarde ese valor random en array

No se si me entienden ya q el codigo ahora no lo tengo pero es simple, y el error q me da es q el indice esta mal, pero me da error una vez compilado, esq la primera vez q hace esa condificion con el if, el index del array es 0 entonces cuando lee lo de i -1 quedaria Si es distinto de array[-1] y claro q esta mal, y no se como solucionar eso la verdad
59  Foros Generales / Foro Libre / Te da la cabeza para aprender muchos lenguajes? en: 12 Noviembre 2010, 23:51 pm
Bueno eso mismo.. xD, no se si me dara la cabeza para aprender muchos lenguajes de programacion, casi nadie lo hace ya q la mayoria se especializan en 1 o 2 aunque tengan la base o algo de nocion de los mas basicos q son los q yo me estoy complicando ahora, por ahora no tengo problema pero voy aprendiendo aunquesea lo basico de BATCH, VB6, VB.NET, y C#.
Y desp cuando tenga q aprender sobre Java, php, html? ni te digo si se me antojaria aprender luego desp de todo eso delphi, perl o ruby, ya q me gustaria saberlos todos pero no se si me dara la cabeza xD
60  Programación / Programación Visual Basic / Como capturar lo q me escriben en el msn? en: 25 Octubre 2010, 02:21 am
Quiero ver si me ayudan para saber q es lo q me escriben en el msn.. asi como funcionan esos bots que les dices Hola y estan programados para q si le escribes Hola contesten Hola como estas? y todo asi.. esos bots funcionan por medio de web, tamb conozco una para crear esos bots pero mi idea es q el vb6 detecte lo q me escribieron :S Capas q no se puede.. pero alguno talvez tiene una idea interesante.

Por si no han entendido lo q quiero llegar a lograr hacer es crear un programa q lo ejecuto y queda prendido en mi pc, entonces dejo mi msn prendido y me voy a la casa de un amigo por ejemplo y desde ahi con el msn de él escribo a mi msn poniendo por ejemplo Command:Apagate, y el programa al leer eso ejecutara codigo para q se apague mi pc..
Páginas: 1 2 3 4 5 [6] 7
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines