{"id":247,"date":"2017-01-02T15:25:08","date_gmt":"2017-01-02T15:25:08","guid":{"rendered":"https:\/\/ibex.tech\/csharp\/?p=247"},"modified":"2022-02-17T06:24:14","modified_gmt":"2022-02-17T06:24:14","slug":"create-random-string","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/random\/create-random-string","title":{"rendered":"Create Random String"},"content":{"rendered":"<h4>\n\tCreate A Random String<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\t\/\/********************************************\r\n\t\/\/********************************************\r\n\t\/\/********** GENERATE RANDOM STRING **********\r\n\t\/\/********************************************\r\n\t\/\/********************************************\r\n\tprivate string GenerateRandomString (int length)\r\n\t{\r\n\t\tint Count;\r\n\t\tconst string STRING_CHARACTER_SET = &quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&quot;;\r\n\t\tstring OutputString = &quot;&quot;;\r\n\r\n\t\tSystem.Random rand = new System.Random();\t\t\/\/Creates seed value from system clock if no seed supplied\r\n\r\n\t\tfor (Count = 0; Count &lt; length; Count++)\r\n\t\t{\r\n\t\t\tOutputString += STRING_CHARACTER_SET[rand.Next(0, STRING_CHARACTER_SET.Length)];\r\n\t\t}\r\n\r\n\t\treturn (OutputString);\r\n\t}\r\n<\/code><\/pre>\n<p>\n\t&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create A Random String \/\/******************************************** \/\/******************************************** \/\/********** GENERATE RANDOM STRING ********** \/\/******************************************** \/\/******************************************** private string GenerateRandomString (int length) { int Count; const string STRING_CHARACTER_SET = &quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&quot;; string OutputString = &quot;&quot;; System.Random rand = new System.Random(); \/\/Creates seed value from system clock if no seed supplied for (Count = 0; Count &lt; length; Count++) { OutputString [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"class_list":["post-247","post","type-post","status-publish","format-standard","hentry","category-random"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=247"}],"version-history":[{"count":4,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/247\/revisions"}],"predecessor-version":[{"id":265,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/247\/revisions\/265"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}