Reputation: 2997
I am new to C# .NET.
I need to access *.resx files from my local folder and then retrieve data from each *.resx files. I am creating a windows application for that.
So first, once I give path to that folder, it found the files there, but now, how can I read those file and get data from them to a temporary database on RAM.
private void buttonBrowseSource1_Click(object sender, EventArgs e)
{
FolderBrowserDialog selectPathDialog = new FolderBrowserDialog();
if (selectPathDialog.ShowDialog() == DialogResult.OK)
{
DirectoryInfo di = new DirectoryInfo(selectPathDialog.SelectedPath);
FileInfo[] RESXFiles = di.GetFiles("*.resx");
if (RESXFiles.Length == 0)
{
UpdateStatus("No RESX files found in this directory. Please check the folder/path again.");
}
else
{
UpdateStatus("Total " + RESXFiles.Length + " RESX files found in this directory.);
textBoxSource1.Text = selectPathDialog.SelectedPath;
}
}
else
{
UpdateStatus("Missing directory! Please try again.");
}
}
Thank you so much.
Upvotes: 0
Views: 1728
Reputation: 1380
// Gets the value of associated with key "MyKey" from the local resource file for a given culture ("~/MyPage.aspx.en.resx") or from the default one ("~/MyPage.aspx.resx")
object keyValue = HttpContext.GetLocalResourceObject("~/MyPage.aspx", "MyKey", culture);
use something like this
for windows this link may useful for you
Upvotes: 0