开发者

Find resource for CultureInfo

开发者 https://www.devze.com 2022-12-27 06:15 出处:网络
I need to dete开发者_如何学Crmine whether there is a resource file for the given CultureInfo or not.

I need to dete开发者_如何学Crmine whether there is a resource file for the given CultureInfo or not.

Is there an easy way?


You can use ResourceSet ResourceManager.GetResourceSet( CultureInfo culture, bool createIfNotExists, bool tryParents )

Example:

ResourceManager resman = new ResourceManager();
CultureInfo culinfo = new CultureInfo( "RU-ru" );
if( resman.GetResourceSet( culinfo, false, false ) == null )
{
    Console.WriteLine( "Resource file for culture \"RU-ru\" does not exist." );
}
0

精彩评论

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

关注公众号