久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='bk4Vy'></small><noframes id='bk4Vy'>

    <tfoot id='bk4Vy'></tfoot>

    1. <legend id='bk4Vy'><style id='bk4Vy'><dir id='bk4Vy'><q id='bk4Vy'></q></dir></style></legend>
        <bdo id='bk4Vy'></bdo><ul id='bk4Vy'></ul>

      <i id='bk4Vy'><tr id='bk4Vy'><dt id='bk4Vy'><q id='bk4Vy'><span id='bk4Vy'><b id='bk4Vy'><form id='bk4Vy'><ins id='bk4Vy'></ins><ul id='bk4Vy'></ul><sub id='bk4Vy'></sub></form><legend id='bk4Vy'></legend><bdo id='bk4Vy'><pre id='bk4Vy'><center id='bk4Vy'></center></pre></bdo></b><th id='bk4Vy'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bk4Vy'><tfoot id='bk4Vy'></tfoot><dl id='bk4Vy'><fieldset id='bk4Vy'></fieldset></dl></div>

        使用資源管理器

        Using ResourceManager(使用資源管理器)

                <bdo id='YRbQI'></bdo><ul id='YRbQI'></ul>

                <small id='YRbQI'></small><noframes id='YRbQI'>

                    <tbody id='YRbQI'></tbody>

                  <legend id='YRbQI'><style id='YRbQI'><dir id='YRbQI'><q id='YRbQI'></q></dir></style></legend>

                • <tfoot id='YRbQI'></tfoot>
                  <i id='YRbQI'><tr id='YRbQI'><dt id='YRbQI'><q id='YRbQI'><span id='YRbQI'><b id='YRbQI'><form id='YRbQI'><ins id='YRbQI'></ins><ul id='YRbQI'></ul><sub id='YRbQI'></sub></form><legend id='YRbQI'></legend><bdo id='YRbQI'><pre id='YRbQI'><center id='YRbQI'></center></pre></bdo></b><th id='YRbQI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='YRbQI'><tfoot id='YRbQI'></tfoot><dl id='YRbQI'><fieldset id='YRbQI'></fieldset></dl></div>
                  本文介紹了使用資源管理器的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試在 C# 類中使用 ResourceManager,但在創建 ResourceManager 類的新實例時不知道用什么替換基本名稱.

                  I'm trying to use the ResourceManager in a C# class, but don't know what to substitute for the basename when creating a new instance of the ResourceManager class.

                  我有一個單獨的項目,其中包含我上面的項目引用的資源文件,命名如下:

                  I have a separate project that contains the resource files which is referenced by my project above named as the following:

                  • Resources.resx
                  • Resources.es-ES.resx

                  如果我有如下代碼片段,當我想使用英語或西班牙語版本的資源時,我應該用什么代替基本名稱?

                  If I have a code snippet as follows, what should I substitute for the basename when I want to use the English or Spanish version of the resources?

                  ResourceManager RM = new ResourceManager(basename,Assembly.GetExecutingAssembly());
                  

                  我嘗試了 Tom 建議的方法,但遇到了臭名昭著的錯誤

                  I tried the approach suggested by Tom, but am getting the infamous error

                  找不到任何適合指定文化或中立文化的資源.

                  Could not find any resources appropriate for the specified culture or the neutral culture.

                  我的解決方案有兩個項目,其中項目 YeagerTech 是一個 Web 應用程序,項目 YeagerTechResources 包含所有資源.Project YeagerTech 參考了 YeagerTechResources.

                  My solution has two projects where project YeagerTech is a web application and project YeagerTechResources contains all the resources. Project YeagerTech has a reference to YeagerTechResources.

                  我在創建資源管理器時使用以下語法:

                  I have the following syntax when creating my Resource Manager:

                  ResourceManager RM = new ResourceManager("YeagerTechResources.Resources",
                      Assembly.GetExecutingAssembly());
                  

                  顯然,這是不正確的.

                  YeagerTechResources 項目中的資源文件的 BuildAction 設置為 Embedded Resource.

                  The resource files in the YeagerTechResources project have their BuildAction set to Embedded Resource.

                  我的資源文件的名稱是:Resources.resx 和 Resources.es-ES.resx.

                  The name of my resource files are: Resources.resx and Resources.es-ES.resx.

                  如果有人可以在實例化資源管理器時根據我的項目和資源文件名簡單地告訴我要使用的確切語法,我將不勝感激......

                  If someone can simply tell me the exact syntax to use based on my project and resource file names when instantiating the resource manager, I would greatly appreciate it...

                  我已盡我所能解決此問題,但無法....

                  I've done everything I can think of to resolve this and can't....

                  這是我最后一次嘗試在這里解決它......

                  This is my last attempt to resolve it here...

                  ResourceManager RM = new ResourceManager("YeagerTechResources.Resources", Assembly.GetExecutingAssembly());
                  
                  sb.Append(RM.GetString("RegisterThanks"));
                  

                  執行上述代碼后出現以下錯誤:

                  I am getting the following error after executing the code above:

                  找不到任何適合指定文化或中性文化的資源.確保YeagerTechResources.Resources.resources"在編譯時已正確嵌入或鏈接到程序集YeagerTech"中,或者所有所需的附屬程序集都是可加載且完全簽名的.

                  Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "YeagerTechResources.Resources.resources" was correctly embedded or linked into assembly "YeagerTech" at compile time, or that all the satellite assemblies required are loadable and fully signed.

                  我可以毫無問題地使用 HTML 標記中的資源,但是在控制器中使用 C# 代碼時,我不斷收到上述錯誤.

                  I am able to use the resources in the HTML markup with absolutely no issues, but when coming to the C# code in the Controller, I keep on getting the above error.

                  任何關于我需要的基于我的項目的確切語法的幫助將不勝感激.

                  Any help for the exact syntax I need based on my projects would be greatly appreciated.

                  推薦答案

                  通過字符串讀取資源的方法非常簡單:

                  There's surprisingly simple way of reading resource by string:

                  ResourceNamespace.ResxFileName.ResourceManager.GetString("ResourceKey")
                  

                  在不能使用點符號"的情況下(例如,當資源鍵被持久保存在數據庫中時),它是一種簡潔而優雅的解決方案.

                  It's clean and elegant solution for reading resources by keys where "dot notation" cannot be used (for instance when resource key is persisted in the database).

                  這篇關于使用資源管理器的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                  XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                  Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                  Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                  delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                  Parse malformed XML(解析格式錯誤的 XML)

                      <small id='PAskE'></small><noframes id='PAskE'>

                      <tfoot id='PAskE'></tfoot>
                        <bdo id='PAskE'></bdo><ul id='PAskE'></ul>
                        <legend id='PAskE'><style id='PAskE'><dir id='PAskE'><q id='PAskE'></q></dir></style></legend>
                          <tbody id='PAskE'></tbody>
                        <i id='PAskE'><tr id='PAskE'><dt id='PAskE'><q id='PAskE'><span id='PAskE'><b id='PAskE'><form id='PAskE'><ins id='PAskE'></ins><ul id='PAskE'></ul><sub id='PAskE'></sub></form><legend id='PAskE'></legend><bdo id='PAskE'><pre id='PAskE'><center id='PAskE'></center></pre></bdo></b><th id='PAskE'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PAskE'><tfoot id='PAskE'></tfoot><dl id='PAskE'><fieldset id='PAskE'></fieldset></dl></div>

                          • 主站蜘蛛池模板: 欧美区日韩区 | 欧美 日本 国产 | 欧美精品一区二区在线观看 | 精品国产免费一区二区三区演员表 | 国产一区二区电影网 | 男女羞羞视频网站 | 久久天天综合 | 中文成人无字幕乱码精品 | 国产成人精品一区二区三区视频 | 曰韩一二三区 | 国产精品一区二区av | 国产精品视频97 | 久久久噜噜噜www成人网 | 日韩一区二区在线视频 | 99精品在线 | 伊人二区 | 中文字幕一区二区在线观看 | 欧美日韩久 | 欧美日韩网站 | 国产一区二区三区免费观看在线 | 亚洲成人免费视频在线观看 | 亚洲精品电影在线观看 | 99精品欧美一区二区三区综合在线 | 99精品国产一区二区青青牛奶 | 农村真人裸体丰满少妇毛片 | 啪啪免费网站 | 国产在线高清 | 亚洲av毛片| 久久久www成人免费无遮挡大片 | 欧日韩在线 | 国产不卡一区 | 久久精品91久久久久久再现 | 亚洲成人第一页 | 日韩视频在线一区 | 91一区二区在线观看 | 久久久久国产精品 | 久久久区 | 日韩精品999| 青娱乐一区二区 | 日韩在线视频免费观看 | 欧美精品在线一区二区三区 |