Visual Studio, : Visual Studio 2015.
(. . 1.1):
. 1.1. Microsoft Visual Studio 2015
: , , . .
... (. 1.2).
. 1.2.
Windows Forms C #. .
:
Visual C #;
;
: Example1;
, , ;
;
, .
Ok.
(. 1.3).
. .
. .
( ) , . Visual Studio 2015 30 . ().
. 1.3.
, . . . , , web ‑, Windows Forms, . . (, , ) . . , .
, ( 1.4). ‑, , Example1 Example1. , :
- AssemblyInfo.cs (, , IL ‑ );
|
|
- System, System.Core, System.Data . . ;
- Program.cs C #.
C # C #. . Program. cs (. 1.5).
(). , , , . , . () .
. , . , . .
. , , , , . .
. , .
IntelliSense. . ( ).
( ) , ( ).
Program.cs Example1. , Visual Studio (, ) . .
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Example1
{
class Program
{
static void Main(string[] args)
{
}
}
}
using System, System.Collections.Generic , .
namespace , ( Example1), . , . , , .
. Program, Main (). , , . . .
|
|
Main () , :
static void Main(string[] args)
{
Console.WriteLine(" !");
}
Console System. WriteLine () , .
, , F 5.
, , . , < Ctrl+F 5> . (. 1.6):
.
, , Main () :
static void Main(string[] args)
{
Console.WriteLine("!"); //
Console.ReadKey();
}
(, F 5) , :
ReadKey () Console , ‑ , .
, . Visual Studio .
, (< Shift+F 5>).
, , < Alt+F 4>, , , ReadKey (). , , .
, (, ).
. , , !.
F 5 , , , , (. 1.7.).
, , , .
‑
C # . , Console, System. .
Console Write () WriteLine (). , , , .
:
Console.WriteLine(15.8); //
int i = 10; //
Console.WriteLine(i); //
Console.WriteLine(i * 2 + 5); //
:
, ( ), . , , . , ToString () :
|
|
Console.Write(i);
Console.Write(i.ToString());
:
Console.WriteLine("i= " + i + " i^2= " + i * i);
, i = , i, i ^2= i * i. i 10, :
, .
:
int i = 10;
Console.WriteLine(i * 4 + 34);
Console.Write("Result is " + i * 4 + 34);
?
WriteLine () 74. Write () Result is 4034! ?
. , , . :
int x = 10;
Console.WriteLine("F({0})={1}", x, x * x);
:
, , {0} x, {1} x * x.
, , , . .
, , . :
Console.Write("{0} {1} {2}", x, y); //
Write () WriteLine () . .
, (, ), , ‑ (, ). , , . . 1.1.
1.1