title: RadioButton to string, string to array
body: <p>I tried that way</p>
  
  <pre><code>string value;
  if(radioButton1.Checked)
  {
  value = "1";
  }
  </code></pre>
  
  <p>But when I wanted to use value variable to push it to array, error appeared. It was because value wasn't declared in this scope. It's my fault, since I totally forgot about get/set metods. I tried something like this:(I could probably use boolean thou)</p>
  
  <pre><code>string[] value = new string[] { value };
  </code></pre>
  
  <p>And it didn't worked. So my question is: how or what's the easiest way to put information about radiobox (If it's checked or not) in array?</p>
  
  <p>edit: Sure. That's how I tried to make it work. Also tried to change value from string to int and convert it afterwards, but without luck. It's whole code for this button. My plan was to check which radiobox was selected and then convert it to array and store in .txt file.</p>
  
  <pre><code>        private void button1_Click(object sender, EventArgs e)
          {
          bool value;
          if (radioButton1.Checked)
          {
              value = true;
          }
          else if (radioButton2.Checked)
          {
              value = false;
          }
  
          string[] radiobox = new string[] { value };
          System.IO.File.WriteAllLines(@"C:\test.txt", radiobox);
          }
  </code></pre>
  
  <p>another edit:
  So after I changed string to boolean, I'm getting this error:</p>
  
  <pre><code>Cannot implicitly convert type 'bool' to 'string'
  </code></pre>
  
  <p>And when I'm trying to convert it to string (Because array doesn't want to accept bool)</p>
  
  <pre><code>string[] radiobox = new string[] { value.ToString() };
  </code></pre>
  
  <p>I'm getting another error:</p>
  
  <pre><code>Use of unassigned local variable 'value'
  </code></pre>