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

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

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

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

    • <bdo id='TreN9'></bdo><ul id='TreN9'></ul>
    <tfoot id='TreN9'></tfoot>
    1. 嘗試為當(dāng)前語(yǔ)言設(shè)置小數(shù)點(diǎn)分隔符,得到“Inst

      Trying to set the decimal separator for the current language, getting quot;Instance is read Onlyquot;(嘗試為當(dāng)前語(yǔ)言設(shè)置小數(shù)點(diǎn)分隔符,得到“Instance is read Only;)
        <tbody id='o1MPb'></tbody>

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

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

              <bdo id='o1MPb'></bdo><ul id='o1MPb'></ul>
            • <legend id='o1MPb'><style id='o1MPb'><dir id='o1MPb'><q id='o1MPb'></q></dir></style></legend>

              <tfoot id='o1MPb'></tfoot>
              1. 本文介紹了嘗試為當(dāng)前語(yǔ)言設(shè)置小數(shù)點(diǎn)分隔符,得到“Instance is read Only";的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我的代碼最初是為英語(yǔ)市場(chǎng)編寫的,其中小數(shù)點(diǎn)分隔符是."所以它期望數(shù)值作為字符串使用."作為分隔符.但是我們現(xiàn)在在其他地方也有用戶,例如歐洲的小數(shù)點(diǎn)分隔符是,"的地方.

                I have code that was originally written for an English language market where the decimal separator is "." so it's expecting numeric values as strings to use "." as the separator. But we now have users in other places, e.g., places in Europe where the decimal separator is ",".

                因此,在我的軟件(實(shí)際上只是當(dāng)前線程)的上下文中,我想將當(dāng)前語(yǔ)言的小數(shù)分隔符覆蓋為."即使它默認(rèn)為其他內(nèi)容.

                So, in the context of my software (really just the current thread) I want to override the decimal separator for the current language to be "." even if it defaults to something else.

                我試過了

                  String sep = "."; 
                  NumberFormatInfo nfi1 = NumberFormatInfo.CurrentInfo;
                  nfi1.NumberDecimalSeparator = sep;
                

                但我在第三行收到Instance is read-only"異常.顯然 NumberFormatInfo 是不可寫的.那么如何將當(dāng)前語(yǔ)言的小數(shù)點(diǎn)分隔符設(shè)置為默認(rèn)值以外的值呢?

                But I get an "Instance is read-only" exception on the third line. Apparently NumberFormatInfo is not writable. So how DO you set the current language's decimal separator to something other than its default?

                推薦答案

                您需要?jiǎng)?chuàng)建一個(gè)新的文化,您可以使用當(dāng)前文化作為模板,只需更改分隔符.然后,您必須將當(dāng)前文化設(shè)置為新創(chuàng)建的文化,因?yàn)槟鸁o(wú)法直接更改當(dāng)前文化中的屬性.

                You need to create a new culture and you can use the current culture as a template and only change the separator. Then you must set the current culture to your newly created one as you cannot change the property within current culture directly.

                string CultureName = Thread.CurrentThread.CurrentCulture.Name;
                CultureInfo ci = new CultureInfo(CultureName);
                if (ci.NumberFormat.NumberDecimalSeparator != ".")
                {
                    // Forcing use of decimal separator for numerical values
                    ci.NumberFormat.NumberDecimalSeparator = ".";
                    Thread.CurrentThread.CurrentCulture = ci;
                 }
                

                這篇關(guān)于嘗試為當(dāng)前語(yǔ)言設(shè)置小數(shù)點(diǎn)分隔符,得到“Instance is read Only";的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                Ignore whitespace while reading XML(讀取 XML 時(shí)忽略空格)
                XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標(biāo)簽的 XML)
                Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                Parse malformed XML(解析格式錯(cuò)誤的 XML)
              2. <i id='6rRE2'><tr id='6rRE2'><dt id='6rRE2'><q id='6rRE2'><span id='6rRE2'><b id='6rRE2'><form id='6rRE2'><ins id='6rRE2'></ins><ul id='6rRE2'></ul><sub id='6rRE2'></sub></form><legend id='6rRE2'></legend><bdo id='6rRE2'><pre id='6rRE2'><center id='6rRE2'></center></pre></bdo></b><th id='6rRE2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6rRE2'><tfoot id='6rRE2'></tfoot><dl id='6rRE2'><fieldset id='6rRE2'></fieldset></dl></div>

                      <bdo id='6rRE2'></bdo><ul id='6rRE2'></ul>

                      <small id='6rRE2'></small><noframes id='6rRE2'>

                      • <tfoot id='6rRE2'></tfoot>
                      • <legend id='6rRE2'><style id='6rRE2'><dir id='6rRE2'><q id='6rRE2'></q></dir></style></legend>
                          <tbody id='6rRE2'></tbody>

                        1. 主站蜘蛛池模板: 日韩在线中文 | 欧美不卡一区 | 日韩在线免费观看视频 | av中文在线 | 日韩视频在线免费观看 | 亚洲成人av| 亚洲天码中字 | 国产激情久久久 | www激情| 国 产 黄 色 大 片 | 久久精品在线观看 | 青青国产在线 | 欧美日韩高清 | 国产精品久久免费 | 色窝| 欧美精品自拍 | 色视频www在线播放国产人成 | 黄色精品视频 | 国产精品美女久久 | 五月婷婷丁香综合 | 黄色成人小视频 | 久久99久久久 | 日本欧美久久久久免费播放网 | 日韩成人精品 | 一级黄色av | 成人福利视频在线观看 | 黄色免费大片 | 免费性网站| 国产日韩综合 | 91播放 | 国产视频网 | 污视频网站在线观看 | 日韩性生活视频 | 日韩视频一区 | 久久日av| 国产视频一区二区在线 | 四虎在线免费观看视频 | 日本不卡视频在线观看 | 国产精品美女久久 | 欧美专区在线 | www.超碰|