内容目录
using System.Resources;
var assembly = typeof(Program).Assembly;
ResourceManager resourceManager = new ResourceManager("update.Properties.Resources", assembly);
var host = resourceManager.GetString("host");
You can retrieve a list of resource file names using typeof(Program).Assembly.GetManifestResourceNames()
, where the default Resources.resx
obtained is
update.Properties.Resources.resources
{Assembly}.{Directory}.{FileName}.resources
The ResourceManager only needs to fill in {Assembly}.{Directory}.{FileName}
.
文章评论