{"id":116,"date":"2012-04-24T14:08:21","date_gmt":"2012-04-24T13:08:21","guid":{"rendered":"http:\/\/www.djhiro.at\/?p=116"},"modified":"2012-05-04T09:26:29","modified_gmt":"2012-05-04T08:26:29","slug":"simple-hello-kitty-with-c","status":"publish","type":"post","link":"https:\/\/www.djhiro.at\/?p=116","title":{"rendered":"Simple Hello Kitty with C#"},"content":{"rendered":"<p>How to create a Simple &#8220;Hello Kitty&#8221; with C# (Console Application)<\/p>\n<p>First we create a &#8220;Console-Application-Project&#8221; within the Visual C# Express Studio<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wpgallery\" title=\"New C# Console Project\" src=\"https:\/\/www.djhiro.at\/wp-content\/uploads\/2012\/04\/consoleproject.png\" alt=\"Create a new console Project within Visual Studio Express C#\" width=\"611\" height=\"575\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The Console Project Name can be anything you like (ex. HelloKitty)<\/p>\n<p>After pressing &#8220;ok&#8221; the File Program.cs will be opened.<\/p>\n<p>It will look something like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Program.cs after creating the Hello Kitty Project\" src=\"https:\/\/www.djhiro.at\/wp-content\/uploads\/2012\/04\/programcs.png\" alt=\"Program.cs\" width=\"451\" height=\"429\" \/><\/p>\n<p>With the codeline: System.Console. you can work with the console &#8220;window&#8221;, display data, read data, etc.<\/p>\n<p>To Display a normal text you use the function &#8220;WriteLine&#8221;, which writes a line of text. If you want to write just one character, you can use &#8220;Write&#8221; instead.<\/p>\n<pre class=\"lang:c# decode:true\">System.Console.WriteLine(\"Hello Kitty\");<\/pre>\n<p>If you compile the program, the console window will be closed\u00a0instantaneous, to prevent this behavior, we wait till the user enters at least one character.<\/p>\n<p>This can be achvieved with the functions &#8220;ReadKey&#8221;, &#8220;Read&#8221; or &#8220;ReadLine&#8221;. The difference between those functions is that &#8220;ReadKey&#8221;, reads exactly one character and displays this character on the console, &#8220;Read&#8221; reads just the next character and &#8220;ReadLine&#8221; reads the whole line on the console application.<\/p>\n<pre class=\"lang:c# decode:true\">System.Console.ReadKey();<\/pre>\n<p>It should look like this now:<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Text;\r\n\r\nnamespace HelloKitty\r\n{\r\n    class Program\r\n    {\r\n        static void Main(string[] args)\r\n        {\r\n            System.Console.WriteLine(\"Hello Kitty\");\r\n            System.Console.ReadKey();\r\n        }\r\n    }\r\n}<\/pre>\n<p>After compiling the program, it should open a console window and display the text which has been entered after the \u00a0&#8220;WriteLine&#8221; command:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"Hello Kitty\" src=\"https:\/\/www.djhiro.at\/wp-content\/uploads\/2012\/04\/hellokitty.png\" alt=\"Hello Kitty\" width=\"117\" height=\"100\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to create a Simple &#8220;Hello Kitty&#8221; with C# (Console Application) First we create a &#8220;Console-Application-Project&#8221; within the Visual C# Express Studio &nbsp; The Console Project Name can be anything you like (ex. HelloKitty) After pressing &#8220;ok&#8221; the File Program.cs &hellip; <a href=\"https:\/\/www.djhiro.at\/?p=116\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88,89,76],"tags":[91,98,90,94,93,92,95,137,97,96],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-english","category-languages","category-programming","tag-net","tag-98","tag-c","tag-hello","tag-hello-kitty","tag-hello-world","tag-kitty","tag-programming","tag-visual-studio","tag-world"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.djhiro.at\/index.php?rest_route=\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.djhiro.at\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.djhiro.at\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.djhiro.at\/index.php?rest_route=\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/www.djhiro.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=116"}],"version-history":[{"count":18,"href":"https:\/\/www.djhiro.at\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/www.djhiro.at\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions\/136"}],"wp:attachment":[{"href":"https:\/\/www.djhiro.at\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.djhiro.at\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.djhiro.at\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}