DevCardude's C# BitBin Tutorials: 1


SUBMITTED BY: Guest

DATE: Feb. 8, 2014, 2:08 p.m.

FORMAT: C#

SIZE: 2.7 kB

HITS: 617

  1. //Hello! Welcome to my Bitbin Tutorials!
  2. //This is something new I'm trying, so if I get enough traffic, I'll do more.
  3. //This one is also a beginner's tutorial, so only the basics will be here.
  4. //Assuming you have Visual Studio for Windows Desktop installed, which the link to 2013 is here:
  5. // http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
  6. //PLEASE, ensure you have the windows DESKTOP version. It'll also work on Surface Tablets.
  7. //Create a Console Application and name it to your liking. I'd suggest CsharpTutorial.
  8. //You can see in the Program.cs file (that's our program, and where we will be writing
  9. //our code most of the time)
  10. //We don't need to go into detail about it right now, so put your cursor inside of the Main() void
  11. //and type this:
  12. Console.WriteLine("Hello World!");
  13. //TADA! Beleive it or not, thats our very first program!
  14. //Let's analize it for a bit. The "Console" part tells which class to look for the function
  15. //"WriteLine" in. It doesn't have to be WriteLine though. There are many
  16. //functins the console class has. the string, a type of varible, is in the quotes.
  17. //The "." between console and writeline is just there. don't worry about it, becuase idk how to explain it.
  18. //PRO TIP: All lines in C# end in ; because you can have multiple lines on one line! like this:
  19. Console.WriteLine("Hello World!"); Console.WriteLine("Cheeseburger."); Console.WriteLine("The End!");
  20. //Now let's test it.
  21. //Press the F5 key, or the Play button in the middle-top of the screen to run it.
  22. //It's green or blue, depending on which version you have.
  23. //Notice how the cosole window just flashes on and off the screen. This is what we are
  24. //going to fix
  25. //We are going to create a new subroutine like this:
  26. void Pause() {
  27. }
  28. //"void" is what defines the subroutine.
  29. //"Pause" is its name.
  30. //Put this in the Squiggly brackets:
  31. Console.Readkey(true);
  32. //It should look like this
  33. void Pause() {
  34. Console.WriteLine("Press any key to continue...");
  35. Console.Readkey(true);
  36. }
  37. //Back to our Main void:
  38. Console.WriteLine("Hello World!");
  39. Pause();
  40. //Run it, and see what it looks like.
  41. //See? A lot better right?
  42. //Now I'm gonna give you this:
  43. Console.WriteLine("Enter What You Want:");
  44. Console.WriteLine(Console.ReadLine());
  45. Pause();
  46. //Feel free to run it.
  47. //The Console.ReadLine() reads inputed text. Makes sense right?
  48. //My Hands are tired so im gonna stop typing.
  49. //Give me feedback at myfrigginspam1@yahoo.com

comments powered by Disqus