Ejemplo n.º 1
0
        private void btnWrite_Click(object sender, EventArgs e)
        {
            CSVListAdapter csv = new CSVListAdapter(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Gottfried Studios\MiscDataLibrary\list.csv");
            string[] primes;

                string haystack = txtBxPrimes.Text;
                char needle = ',';
                primes = haystack.Split(new char[] {needle}, haystack.Count(s => s == needle));

            string[,] primesMultiDimensional = new string[1, primes.Length];
            int iT = 0;
            int iC = 0;
            while (iT < primes.Length)
            {
                for (int i = 0; i <= 255; i++)
                {
                    if (!(iT < primes.Length))
                        break;

                    primesMultiDimensional[iC, i] = primes[iT];
                    iT++;
                }
                iC++;
            }

            //for (int i = 0; i < primes.Length; i++)
            //    primesMultiDimensional[0, i] = primes[i];

            csv.Write(primesMultiDimensional);
        }
Ejemplo n.º 2
0
        private void btnRead_Click(object sender, EventArgs e)
        {
            CSVListAdapter csv = new CSVListAdapter(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Gottfried Studios\MiscDataLibrary\list.csv");

            string[,] array2d = csv.Read();
            foreach (string s in array2d)
                dataGridView1.Rows.Add(s);
        }