title: C# How to create and save resx files
body: <p>Acording to Microsoft Developer Network, resx files can be generated in this way.
  (<a href="http://msdn.microsoft.com/en-us/library/gg418542%28v=vs.110%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/gg418542%28v=vs.110%29.aspx</a>)</p>
  
  <pre><code>using (ResXResourceWriter resx = new ResXResourceWriter("filename.resx"))
    {
       resx.AddResource("KeyString", "ValueString");         
    }
  resx.Generate();
  </code></pre>
  
  <p>However, I cannot find the newly generated resx file. (I thought the generated file was set in the local machine, but it doesn't seem to be there.)</p>
  
  <p>I've been searching for (1) how to check where the generated resx file is, and (2) how to save it into a file folder. (i.e.To save a programmatically generated resx file into a folder, as we can create and save xml files by using "XmlDocument.Save("FileName")" method.)</p>
  
  <p>Here is a part of my coding.</p>
  
  <pre><code>    if (saveFileDialog.ShowDialog() == DialogResult.OK) {
          using (ResXResourceWriter resx = new ResXResourceWriter("resxfile.resx")) {                   
  
              for (int i = 0; i &lt; rowArray.Length; i++) {                    
                  string keyStrings = rowArray[i][Key].ToString();     
                  string valueStrings = rowArray[i][Value].ToString();
                  resx.AddResource(keystrings, valueStrings);
              }
              resx.Generate();
          }                                     
      }
  </code></pre>
  
  <p>This doesn't save the resx file which is supposed to be generated from the "for" loop.
  I'd appreciate it if you would give any insight.        </p>