{"id":3323,"date":"2014-03-20T10:41:28","date_gmt":"2014-03-20T01:41:28","guid":{"rendered":"http:\/\/auctionpro.co.kr\/?p=3323"},"modified":"2021-07-07T10:32:01","modified_gmt":"2021-07-07T01:32:01","slug":"c-registry-%eb%a9%94%ec%84%9c%eb%93%9c","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=3323","title":{"rendered":"C# Registry  \uba54\uc11c\ub4dc"},"content":{"rendered":"<p>\uc18c\uc2a4<\/p>\n<pre class=\"lang:c# decode:true \">public static void RegistrySet() { \/\/ \/\/ This code example produces output similar to the following: \/\/ \/\/NoSuchName: Return this default if NoSuchName does not exist. \/\/(Default): 5280 \/\/TestLong: 12345678901234 \/\/TestArray(0): One \/\/TestArray(1): Two \/\/TestArray(2): Three \/\/TestExpand: My path: %path% \/\/TestExpand2: My path: D:\\Program Files\\Microsoft.NET\\\u2026 \/\/ \/\/Use the registry editor to examine the key. \/\/Press the Enter key to delete the key\r\n\r\n\/\/ The name of the key must include a valid root.\r\nconst string userRoot = \"HKEY_CURRENT_USER\";\r\nconst string subkey = \"RegistrySetValueExample\";\r\nconst string keyName = userRoot + \"\\\\\" + subkey;\r\n\r\n\/\/ An int value can be stored without specifying the\r\n\/\/ registry data type, but long values will be stored\r\n\/\/ as strings unless you specify the type. Note that\r\n\/\/ the int is stored in the default name\/value\r\n\/\/ pair.\r\nRegistry.SetValue(keyName, \"\", 5280);\r\nRegistry.SetValue(keyName, \"TestLong\", 12345678901234,\r\nRegistryValueKind.QWord);\r\n\r\n\/\/ Strings with expandable environment variables are\r\n\/\/ stored as ordinary strings unless you specify the\r\n\/\/ data type.\r\nRegistry.SetValue(keyName, \"TestExpand\", \"My path: %path%\");\r\nRegistry.SetValue(keyName, \"TestExpand2\", \"My path: %path%\",\r\nRegistryValueKind.ExpandString);\r\n\r\n\/\/ Arrays of strings are stored automatically as\r\n\/\/ MultiString. Similarly, arrays of Byte are stored\r\n\/\/ automatically as Binary.\r\nstring[] strings = { \"One\", \"Two\", \"Three\" };\r\nRegistry.SetValue(keyName, \"TestArray\", strings);\r\n\r\n\/\/ Your default value is returned if the name\/value pair\r\n\/\/ does not exist.\r\nstring noSuch = (string)Registry.GetValue(keyName,\r\n\"NoSuchName\",\r\n\"Return this default if NoSuchName does not exist.\");\r\nConsole.WriteLine(\"\\r\\nNoSuchName: {0}\", noSuch);\r\n\r\n\/\/ Retrieve the int and long values, specifying\r\n\/\/ numeric default values in case the name\/value pairs\r\n\/\/ do not exist. The int value is retrieved from the\r\n\/\/ default (nameless) name\/value pair for the key.\r\nint tInteger = (int)Registry.GetValue(keyName, \"\", -1);\r\nConsole.WriteLine(\"(Default): {0}\", tInteger);\r\nlong tLong = (long)Registry.GetValue(keyName, \"TestLong\",\r\nlong.MinValue);\r\nConsole.WriteLine(\"TestLong: {0}\", tLong);\r\n\r\n\/\/ When retrieving a MultiString value, you can specify\r\n\/\/ an array for the default return value.\r\nstring[] tArray = (string[])Registry.GetValue(keyName,\r\n\"TestArray\",\r\nnew string[] { \"Default if TestArray does not exist.\" });\r\nfor (int i = 0; i &lt; tArray.Length; i++)\r\n{\r\nConsole.WriteLine(\"TestArray({0}): {1}\", i, tArray[i]);\r\n}\r\n\r\n\/\/ A string with embedded environment variables is not\r\n\/\/ expanded if it was stored as an ordinary string.\r\nstring tExpand = (string)Registry.GetValue(keyName,\r\n\"TestExpand\",\r\n\"Default if TestExpand does not exist.\");\r\nConsole.WriteLine(\"TestExpand: {0}\", tExpand);\r\n\r\n\/\/ A string stored as ExpandString is expanded.\r\nstring tExpand2 = (string)Registry.GetValue(keyName,\r\n\"TestExpand2\",\r\n\"Default if TestExpand2 does not exist.\");\r\nConsole.WriteLine(\"TestExpand2: {0}\u2026\",\r\ntExpand2.Substring(0, 40));\r\n\r\nConsole.WriteLine(\"\\r\\nUse the registry editor to examine the key.\");\r\nConsole.WriteLine(\"Press the Enter key to delete the key.\");\r\nConsole.ReadLine();\r\nRegistry.CurrentUser.DeleteSubKey(subkey);\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>\uc18c\uc2a4 public static void RegistrySet() { \/\/ \/\/ This code example produces output similar to the following: \/\/ \/\/NoSuchName: Return this default if NoSuchName does <a class=\"mh-excerpt-more\" href=\"https:\/\/www.auctionpro.co.kr\/?p=3323\" title=\"C# Registry  \uba54\uc11c\ub4dc\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-3323","post","type-post","status-publish","format-standard","hentry","category-devc"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C# Registry \uba54\uc11c\ub4dc - AuctionPro<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.auctionpro.co.kr\/?p=3323\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C# Registry \uba54\uc11c\ub4dc - AuctionPro\" \/>\n<meta property=\"og:description\" content=\"\uc18c\uc2a4 public static void RegistrySet() { \/\/ \/\/ This code example produces output similar to the following: \/\/ \/\/NoSuchName: Return this default if NoSuchName does [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.auctionpro.co.kr\/?p=3323\" \/>\n<meta property=\"og:site_name\" content=\"AuctionPro\" \/>\n<meta property=\"article:published_time\" content=\"2014-03-20T01:41:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-07T01:32:01+00:00\" \/>\n<meta name=\"author\" content=\"golgol\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"golgol\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=3323#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=3323\"},\"author\":{\"name\":\"golgol\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\"},\"headline\":\"C# Registry \uba54\uc11c\ub4dc\",\"datePublished\":\"2014-03-20T01:41:28+00:00\",\"dateModified\":\"2021-07-07T01:32:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=3323\"},\"wordCount\":3,\"commentCount\":0,\"articleSection\":[\"[Dev]C#\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=3323#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=3323\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=3323\",\"name\":\"C# Registry \uba54\uc11c\ub4dc - AuctionPro\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#website\"},\"datePublished\":\"2014-03-20T01:41:28+00:00\",\"dateModified\":\"2021-07-07T01:32:01+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=3323#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=3323\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?p=3323#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C# Registry \uba54\uc11c\ub4dc\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#website\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/\",\"name\":\"AuctionPro\",\"description\":\"\uc625\uc158\ud504\ub85c\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/#\\\/schema\\\/person\\\/d3dbae599b06cd55f5b14a3e2116f7a2\",\"name\":\"golgol\",\"url\":\"https:\\\/\\\/www.auctionpro.co.kr\\\/?author=6\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C# Registry \uba54\uc11c\ub4dc - AuctionPro","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.auctionpro.co.kr\/?p=3323","og_locale":"ko_KR","og_type":"article","og_title":"C# Registry \uba54\uc11c\ub4dc - AuctionPro","og_description":"\uc18c\uc2a4 public static void RegistrySet() { \/\/ \/\/ This code example produces output similar to the following: \/\/ \/\/NoSuchName: Return this default if NoSuchName does [...]","og_url":"https:\/\/www.auctionpro.co.kr\/?p=3323","og_site_name":"AuctionPro","article_published_time":"2014-03-20T01:41:28+00:00","article_modified_time":"2021-07-07T01:32:01+00:00","author":"golgol","twitter_card":"summary_large_image","twitter_misc":{"\uae00\uc4f4\uc774":"golgol","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.auctionpro.co.kr\/?p=3323#article","isPartOf":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=3323"},"author":{"name":"golgol","@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2"},"headline":"C# Registry \uba54\uc11c\ub4dc","datePublished":"2014-03-20T01:41:28+00:00","dateModified":"2021-07-07T01:32:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=3323"},"wordCount":3,"commentCount":0,"articleSection":["[Dev]C#"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.auctionpro.co.kr\/?p=3323#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.auctionpro.co.kr\/?p=3323","url":"https:\/\/www.auctionpro.co.kr\/?p=3323","name":"C# Registry \uba54\uc11c\ub4dc - AuctionPro","isPartOf":{"@id":"https:\/\/www.auctionpro.co.kr\/#website"},"datePublished":"2014-03-20T01:41:28+00:00","dateModified":"2021-07-07T01:32:01+00:00","author":{"@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2"},"breadcrumb":{"@id":"https:\/\/www.auctionpro.co.kr\/?p=3323#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.auctionpro.co.kr\/?p=3323"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.auctionpro.co.kr\/?p=3323#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/www.auctionpro.co.kr\/"},{"@type":"ListItem","position":2,"name":"C# Registry \uba54\uc11c\ub4dc"}]},{"@type":"WebSite","@id":"https:\/\/www.auctionpro.co.kr\/#website","url":"https:\/\/www.auctionpro.co.kr\/","name":"AuctionPro","description":"\uc625\uc158\ud504\ub85c","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.auctionpro.co.kr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Person","@id":"https:\/\/www.auctionpro.co.kr\/#\/schema\/person\/d3dbae599b06cd55f5b14a3e2116f7a2","name":"golgol","url":"https:\/\/www.auctionpro.co.kr\/?author=6"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/3323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3323"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/3323\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}