当前位置: 首页 > news >正文

网站商城html模板php免费网站空间

网站商城html模板,php免费网站空间,青岛 外语网站建设,网页模板下载在线点击上方蓝字关注“汪宇杰博客”在 Visual Studio 中#xff0c;如果我们在一个 .NET Core 工程里加入了一个资源文件#xff08;.resx#xff09;#xff0c;那么你会发现有个对应的 .Designer.cs 文件被自动生成了#xff0c;每次资源文件的内容有变化#xff0c;这个设… 点击上方蓝字关注“汪宇杰博客”在 Visual Studio 中如果我们在一个 .NET Core 工程里加入了一个资源文件.resx那么你会发现有个对应的 .Designer.cs 文件被自动生成了每次资源文件的内容有变化这个设计器文件都会刷新。它本质上就是对应资源文件里的键值对自动生成访问这些资源的方法。生成的代码就像这样private static global::System.Resources.ResourceManager resourceMan;private static global::System.Globalization.CultureInfo resourceCulture;[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(Microsoft.Performance, CA1811:AvoidUncalledPrivateCode)]internal DataResource() {}/// summary///   Returns the cached ResourceManager instance used by this class./// /summary[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]internal static global::System.Resources.ResourceManager ResourceManager {    get {        if (object.ReferenceEquals(resourceMan, null)) {            global::System.Resources.ResourceManager temp new global::System.Resources.ResourceManager(Moonglade.Setup.Data.DataResource, typeof(DataResource).Assembly);            resourceMan temp;        }        return resourceMan;    }}/// summary///   Overrides the current threads CurrentUICulture property for all///   resource lookups using this strongly typed resource class./// /summary[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]internal static global::System.Globalization.CultureInfo Culture {    get {        return resourceCulture;    }    set {        resourceCulture value;    }}对于资源文件里的每个Key都会有个方法来读它的值/// summary///   Looks up a localized string similar to {quot;Namequot;:quot;Adminquot;,quot;Descriptionquot;:quot;MoongladeAdminquot;,quot;ShortDescriptionquot;:quot;Moonglade Adminquot;,quot;AvatarBase64quot;:quot;quot;}./// /summaryinternal static string BlogOwnerSettings {    get {        return ResourceManager.GetString(BlogOwnerSettings, resourceCulture);    }}但是我不希望使用这些代码来读取资源文件。因此我需要禁用自动生成Desinger.cs文件。事实上这个Designer.cs文件的生产方式是通过CustomTool生成的就像EF4-6时候通过T4模板生成代码一样也是一种CustomTool。给资源文件.resx生成对应的 .Designer.cs 文件的CustomTool叫做ResXFileCodeGenerator在 Visual Studio 中你可以在RESX文件的属性窗口里将它设置为 reset to default 从而关闭这货如果你用的是 Visual Studio Code可以手工编辑csproj文件删除这段ItemGroup  Compile UpdateData\DataResource.Designer.cs    DesignTimeTrue/DesignTime    AutoGenTrue/AutoGen    DependentUponDataResource.resx/DependentUpon  /Compile/ItemGroupItemGroup  EmbeddedResource UpdateData\DataResource.resx    GeneratorResXFileCodeGenerator/Generator    LastGenOutputDataResource.Designer.cs/LastGenOutput  /EmbeddedResource/ItemGroup那么现在我们如何从资源文件里读取字符串呢很简单ResourceManager rm new ResourceManager(Moonglade.Setup.Data.DataResource, Assembly.GetExecutingAssembly());rm.GetString(Your_Resource_Key);
http://www.zqtcl.cn/news/640627/

相关文章:

  • 冻品网站建设网站头图设计
  • 手机网站分辨率做多大h5微网站建设多少钱
  • 网站制作软件下载公司怎么注册邮箱帐号
  • 做婚纱网站的图片园林设计
  • 濮阳公司建站淮北城市住建网
  • 建设银行网站打不开 显示停止工作专门做地图的网站
  • 有没有人一起做网站app网站建设方案
  • 洛阳网站建设兼职企业网站建设文案
  • 动漫制作贵州seo策略
  • asp网站建设项目实训该怎么跟程序员谈做网站
  • 网站软件资源iis不能新建网站
  • 网站设计的发展趋势西安市建设工程交易网
  • 做外贸收费的服装网站武钢建设公司网站
  • wordpress 全文搜索企业网站优化策略
  • 犀牛云做网站如何网站备案需要什么东西
  • wordpress星座网站建设与优化计入什么科莫
  • 外贸网站优化方案绵阳网站建设怎么做
  • 黑龙江省网站建设电商的运营推广
  • 惠州建站模板wordpress更换主题帖子封面不显示
  • 网站开发为什么不用cgi了营销型网站案例
  • 网站怎么做飘窗电子商城网站建设的实训内容
  • 怎样申请建网站做it公司网站
  • 一个网站费用给人做ppt的网站吗
  • 免费简历在线制作网站杭州市网站建设公司
  • 用家庭宽带做网站 没有8080端口可以吗汕头教育学会网站建设
  • 南通seo公司网站广东涂料网站建设
  • 杭州哪家公司可以做网站苏州公司官网制作
  • 建一个网站大约多少钱做社区网站怎么做
  • 安阳建设网站企业单位网站建设内容需要什么
  • 网站如何被谷歌收录wordpress搭建企业官网