开发者

Getting strings from resx into an array without looping - C#.net

开发者 https://www.devze.com 2023-01-08 05:46 出处:网络
I want to read all the strings from a resx file and load it into an array without looping. I\'m working in an asp.net web application and i\'m using C#. How can i get the strings?

I want to read all the strings from a resx file and load it into an array without looping. I'm working in an asp.net web application and i'm using C#. How can i get the strings?

T开发者_开发百科hank you

NLV


string[] allStrings;
using (var reader = new ResXResourceReader(fileName))
{
    allStrings = reader.Cast<DictionaryEntry>().Select(o => o.Value).OfType<string>().ToArray();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消