{"id":606,"date":"2026-07-31T02:59:11","date_gmt":"2026-07-31T02:59:11","guid":{"rendered":"https:\/\/iotnoob.com\/wordpress\/?p=606"},"modified":"2026-07-31T02:59:12","modified_gmt":"2026-07-31T02:59:12","slug":"c-%e0%b8%ad%e0%b9%88%e0%b8%b2%e0%b8%99%e0%b9%84%e0%b8%9f%e0%b8%a5%e0%b9%8c-ini-%e0%b9%81%e0%b8%a5%e0%b9%89%e0%b8%a7-set-%e0%b8%84%e0%b9%88%e0%b8%b2%e0%b8%a5%e0%b8%87%e0%b9%83%e0%b8%99-object","status":"publish","type":"post","link":"https:\/\/iotnoob.com\/wordpress\/2026\/07\/31\/c-%e0%b8%ad%e0%b9%88%e0%b8%b2%e0%b8%99%e0%b9%84%e0%b8%9f%e0%b8%a5%e0%b9%8c-ini-%e0%b9%81%e0%b8%a5%e0%b9%89%e0%b8%a7-set-%e0%b8%84%e0%b9%88%e0%b8%b2%e0%b8%a5%e0%b8%87%e0%b9%83%e0%b8%99-object\/","title":{"rendered":"[C#] \u0e2d\u0e48\u0e32\u0e19\u0e44\u0e1f\u0e25\u0e4c INI \u0e41\u0e25\u0e49\u0e27 set \u0e04\u0e48\u0e32\u0e25\u0e07\u0e43\u0e19 Object \u0e15\u0e23\u0e07\u0e46 [\u0e43\u0e0a\u0e49 Reflection]"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0e16\u0e49\u0e32\u0e40\u0e23\u0e32\u0e21\u0e35\u0e44\u0e1f\u0e25\u0e4c INI \u0e2b\u0e23\u0e37\u0e2d \u0e2d\u0e30\u0e44\u0e23\u0e0b\u0e31\u0e01\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e48\u0e40\u0e01\u0e47\u0e1a\u0e04\u0e48\u0e32 \u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13<br>A = 1<br>B = 2<br>\u0e41\u0e25\u0e49\u0e27\u0e2d\u0e22\u0e32\u0e01\u0e08\u0e30\u0e14\u0e36\u0e07\u0e02\u0e36\u0e49\u0e19\u0e21\u0e32\u0e43\u0e0a\u0e49 <br>\u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e14\u0e36\u0e07\u0e21\u0e31\u0e19\u0e02\u0e36\u0e49\u0e19\u0e21\u0e32\u0e40\u0e01\u0e47\u0e1a\u0e44\u0e27\u0e49\u0e43\u0e19 MAP \u0e2b\u0e23\u0e37\u0e2d DICTIONARY \u0e44\u0e14\u0e49<br>\u0e41\u0e15\u0e48\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e30\u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 \u0e40\u0e23\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e08\u0e33\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e31\u0e19\u0e40\u0e1b\u0e47\u0e19 string \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 \u0e40\u0e0a\u0e48\u0e19 map.get(&#8220;A&#8221;)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e41\u0e15\u0e48\u0e16\u0e49\u0e32\u0e40\u0e23\u0e32\u0e23\u0e31\u0e1a\u0e04\u0e48\u0e32\u0e08\u0e32\u0e01 INI \u0e14\u0e49\u0e27\u0e22 Object \u0e44\u0e14\u0e49 \u0e40\u0e27\u0e25\u0e32\u0e40\u0e23\u0e32\u0e2d\u0e22\u0e32\u0e01\u0e44\u0e14\u0e49\u0e04\u0e48\u0e32\u0e44\u0e2b\u0e19 \u0e40\u0e23\u0e32\u0e01\u0e47\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49 obj.getA() \u0e44\u0e14\u0e49 \u0e0b\u0e36\u0e48\u0e07\u0e21\u0e31\u0e19\u0e19\u0e48\u0e32\u0e08\u0e30\u0e0a\u0e48\u0e27\u0e22\u0e43\u0e2b\u0e49\u0e40\u0e23\u0e32\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e44\u0e1b\u0e08\u0e33\u0e27\u0e48\u0e32\u0e21\u0e35 string \u0e2d\u0e30\u0e44\u0e23\u0e1a\u0e49\u0e32\u0e07 \u0e40\u0e27\u0e25\u0e32\u0e17\u0e33\u0e07\u0e32\u0e19\u0e01\u0e47\u0e19\u0e48\u0e32\u0e08\u0e30\u0e2a\u0e30\u0e14\u0e27\u0e01\u0e01\u0e27\u0e48\u0e32 (\u0e21\u0e31\u0e49\u0e07)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">VRSTVY=   \t1\nVRTAKY=   \t1\nDUPLICATE_DRILL=\t1\nORIENT =\t1\nAU_B  = \t3.868\nAU_A  = \t4.194\nNEP_MASKA_A= \tYES\nBARVA_NM_A= \tGREEN<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class Vyr\n{\n    public Vyr()\n    {\n        ReadComplete = false;\n    }\n\n    public bool ReadComplete {  get; set; }\n    public string VRSTVY { get; set; }\n    public string VRTAKY {  get; set; }\n    public string DUPLICATE_DRILL { get; set; }\n    public string ORIENT { get; set; }\n    public string AU_B  { get; set; }\n    public int AU_A  { get; set; }\n    public int NEP_MASKA_A { get; set; }\n    public bool BARVA_NM_A {  get; set; }\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class VyrReader\n{\n    public string VyrFileName { get; set; }\n\n    public Vyr readVbr()\n    {\n        if (!System.IO.File.Exists(VyrFileName))\n        {\n            throw new Exception(\"File VYR is not exists, Please check before continue\");\n        }\n        Vyr vyr = new Vyr();\n        vyr.InputFileName = VyrFileName;\n\n        using (StreamReader reader = new StreamReader(VyrFileName))\n        {\n            string line;\n            while ((line = reader.ReadLine()) != null)\n            {\n                if (line.StartsWith(\"#\")) continue;\n\n                \/\/Console.WriteLine(decryptedString);\n                Match match = Regex.Match(line.Trim(), @\"(.*)\\s*=\\s*(.*)\");\n                if (match.Success)\n                {\n\n                    string propertyName = match.Groups[1].Value.Trim().Replace(\" \", \"_\");\n                    string propertyValue = match.Groups[2].Value.Trim();\n\n                    \/\/ 1. \u0e14\u0e36\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 Property \u0e1c\u0e48\u0e32\u0e19 Reflection (\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e43\u0e2b\u0e49 ignore case \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e44\u0e21\u0e48\u0e43\u0e2b\u0e49\u0e1e\u0e31\u0e07\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e15\u0e31\u0e27\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e40\u0e25\u0e47\u0e01\/\u0e43\u0e2b\u0e0d\u0e48)\n                    PropertyInfo prop = typeof(Vyr).GetProperty(\n                        propertyName,\n                        BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance\n                    );\n\n                    \/\/ 2. \u0e16\u0e49\u0e32\u0e40\u0e08\u0e2d Property \u0e17\u0e35\u0e48\u0e0a\u0e37\u0e48\u0e2d\u0e15\u0e23\u0e07\u0e01\u0e31\u0e19 \u0e43\u0e2b\u0e49\u0e40\u0e0b\u0e47\u0e15\u0e04\u0e48\u0e32\u0e25\u0e07\u0e44\u0e1b\n                    if (prop != null &amp;&amp; prop.CanWrite)\n                    {\n                        Type targetType = Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType;\n                        object convertedValue;\n\n                        if (targetType == typeof(bool))\n                        {\n                            convertedValue = ParseBoolean(propertyValue);\n                            \/\/Console.WriteLine($\"Prope {propertyName} = {propertyValue} -> {prop.PropertyType} => {convertedValue}\");\n                        } else\n                        {\n                            convertedValue = string.IsNullOrWhiteSpace(propertyValue) ? null : Convert.ChangeType(propertyValue, targetType);\n                            \/\/Console.WriteLine($\"Prope {propertyName} = {propertyValue} -> {prop.PropertyType} => {convertedValue}\");\n                        }\n                        prop.SetValue(vyr, convertedValue, null);\n                    } else\n                    {\n                        Console.WriteLine(\"Cannot get property for: \" + propertyName + \" = \" + propertyValue);\n                    }\n                }\n            }\n\n        }\n\n        vyr.ReadComplete = true;\n        return vyr;\n    }\n\n    public static bool ParseBoolean(string input)\n    {\n        if (string.IsNullOrWhiteSpace(input)) return false;\n\n        switch (input.Trim().ToLower())\n        {\n            case \"yes\":\n            case \"y\":\n            case \"true\":\n            case \"1\":\n            case \"ano\":\n                return true;\n\n            default:\n                return false;\n        }\n    }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0e16\u0e49\u0e32\u0e40\u0e23\u0e32\u0e21\u0e35\u0e44\u0e1f\u0e25\u0e4c INI \u0e2b\u0e23\u0e37\u0e2d \u0e2d\u0e30\u0e44\u0e23\u0e0b\u0e31\u0e01\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e17\u0e35\u0e48\u0e40\u0e01\u0e47\u0e1a\u0e04\u0e48\u0e32 \u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13A = 1B = 2\u0e41\u0e25\u0e49\u0e27\u0e2d\u0e22\u0e32\u0e01\u0e08\u0e30\u0e14\u0e36\u0e07\u0e02\u0e36\u0e49\u0e19\u0e21\u0e32\u0e43\u0e0a\u0e49 \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e14\u0e36\u0e07\u0e21\u0e31\u0e19\u0e02\u0e36\u0e49\u0e19\u0e21\u0e32\u0e40\u0e01\u0e47\u0e1a\u0e44\u0e27\u0e49\u0e43\u0e19 MAP \u0e2b\u0e23\u0e37\u0e2d DICTIONARY \u0e44\u0e14\u0e49\u0e41\u0e15\u0e48\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e30\u0e17\u0e35\u0e48\u0e40\u0e23\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19 \u0e40\u0e23\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e08\u0e33\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e31\u0e19\u0e40\u0e1b\u0e47\u0e19&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-606","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts\/606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/comments?post=606"}],"version-history":[{"count":1,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts\/606\/revisions"}],"predecessor-version":[{"id":607,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts\/606\/revisions\/607"}],"wp:attachment":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/media?parent=606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/categories?post=606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/tags?post=606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}