How do i get the numbers from the GetKey back to the List<float>? (Reverse of what i did)
<p>This is the code for the SetKey i loop over the Lists take out the numbers convert to string and put it in to the SetKey now i need to reverse the action using GetKey and put back the numbers to the Lists  so eahc List Point_X and Point_Y will have the numbers as before.   </p>

<pre><code>string[] xFrames = new string[wocl.Count];
                string[] yFrames = new string[wocl.Count];

                string X="";
                string Y="";
                for (int i = 0; i &lt; wocl.Count; i++)
                {
                    X  = string.Format("Frame_X_{0} ", i + 1);
                    Y  = string.Format("Frame_Y_{0} ", i + 1);

                    for (int j = 0; j &lt; wocl[i].Point_X.Count; j++)
                    {
                        xFrames[i] += string.Format("{0},", wocl[i].Point_X[j]);
                        yFrames[i] += string.Format("{0},", wocl[i].Point_Y[j]);


                    }

                    string tt = xFrames[i].Trim(",".ToCharArray());
                    string yy =  yFrames[i].Trim(",".ToCharArray());



                     setting_file.SetKey(X, tt);
                     setting_file.SetKey(Y, yy);   

                }
</code></pre>

<p>Now tt is a string of number for example 122,33,44,55,121</p>

<p>Now i need to parse the numbers back. Now i need to take the string and parse the numbers and put them back to a float List:</p>

<p>List a = setting_file.GetKey(X);</p>

<p>But X is a key that present a string of numbers not a List of numbers.</p>

<p>This is the code in the OptionsFile of the functions GetKey and SetKey:</p>

<pre><code>/*----------------------------------------------------------
 * Function     : GetKey
 * Description  : gets the value of the key.
 * Parameters   : key
 * Return       : value of the key if key exist, null if not exist
 * --------------------------------------------------------*/
    public string GetKey(string key)
    {

      //  string value_of_each_key;
        string key_of_each_line;
        string line;
        int index;
        string key_value;
        key_value = null;

        sr = new StreamReader(Options_File);
        while (null != (line = sr.ReadLine()))
        {


            index = line.IndexOf("=");


           //    value_of_each_key = line.Substring(index+1);



            if (index &gt;= 1)
            {
                key_of_each_line = line.Substring(0, index);
                if (key_of_each_line == key)
                {
                    key_value = line.Substring(key.Length + 1);
                }

            }
            else
            {
            }


        }
        sr.Close();
        return key_value;
    }


/*----------------------------------------------------------
 * Function     : SetKey
 * Description  : sets a value to the specified key
 * Parameters   : key and a value
 * Return       : none
 * --------------------------------------------------------*/
    public void SetKey(string key , string value)
    {
        bool key_was_found_inside_the_loop;
        string value_of_each_key;
        string key_of_each_line ;
        string line;
        int index;
        key_was_found_inside_the_loop = false;

        temp_settings_file = "\\temp_settings_file.txt";
        temp_settings_dir = path_exe + @"\temp_settings";
        if (!Directory.Exists(temp_settings_dir))
        {
            Directory.CreateDirectory(temp_settings_dir);
        }

        sw = new StreamWriter(temp_settings_dir+temp_settings_file);
        sr = new StreamReader(Options_File);
        while (null != (line = sr.ReadLine()))
        {

            index = line.IndexOf("=");
            key_of_each_line = line.Substring(0, index);
            value_of_each_key = line.Substring( index + 1);
         //   key_value = line.Substring(0,value.Length);
            if (key_of_each_line == key)
            {
                sw.WriteLine(key + " = " + value);
                key_was_found_inside_the_loop = true;

            }
            else
            {
                sw.WriteLine(key_of_each_line+"="+value_of_each_key);
            }

        }

        if (!key_was_found_inside_the_loop)
        {
           sw.WriteLine(key + "=" + value);
        }
        sr.Close();
        sw.Close();
        File.Delete(Options_File);
        File.Move(temp_settings_dir + temp_settings_file, Options_File);
        return;

    }
</code></pre>

<p>What i need is that in the List a it will contain the numbers from the string X</p>

<p>X is like a key the result in SetKey function is a Key = Value</p>

<p>For example : Hello = 122,33,44,55,66    Hello is like the variable X its the key and on the right hand the numbers are the key values.</p>

<p>So now i need to get the key X values and put them into the List</p>

<p>Cant figure out how to do it.</p>

<hr>

<p>If before i had a List and i loop over it and took out the numbers from the List and created a string of the numbers and put them in the SetKey now i need to use the GetKey and take the numbers and put them back to the List</p>

<hr>

<p>Edit:</p>

<pre><code>public void Load(string path,string fileName)
        {
            string X = "";
            string t = path + "\\" + fileName;
            OptionsFile setting_file = new OptionsFile(t);
            for (int i = 0; i &lt;= wocl.Count ; i++)
            {
            X  = string.Format("Frame_X_{0} ", i + 1);

            }
            string test = setting_file.GetKey(X);
        }
</code></pre>

<p>Thep roblem is that if im running in the loop on the List wocl so when im running the program this List is count 0 or 1. But in the GetKey in the text file i might have 4 frames or 1 frame i mean how do i know on how much to count for in the loop ?</p>

<p>I tried with the wocl List for the test but now in the string test im getting the numbers of the first Frame_X_1 but thats it.</p>

<p>While in hte file it self it looks like:</p>

<pre><code>Frame_X_1 =332,325,336,334,332,325,333,328,332
Frame_Y_1 =218,217,202,212,211,210,204,202,204
Frame_X_2 =270,325,336,347,321,325,333,328,332
Frame_Y_2 =257,217,202,282,156,210,204,202,204
Frame_X_3 =270,325,336,347,321,336,270,371,332
Frame_Y_3 =257,217,202,282,156,250,199,135,204
</code></pre>

<p>I mean when im running the program all the Lists are empty count to 0 and yet i need to retrive each key Frame_X_1 then Frame_Y_1 and so on...And i dont know how many keys there are.</p>
