.


:




:

































 

 

 

 


.




..

C#. . .: ͻ, 2007. 94 .

 

C#, , - . Microsoft Visual Studio 2005 - .

, .

 

 

.., 2007

ͻ, 2007


.. 6

1. C#. 7

1.1. .. 7

1.2. . 8

1.3. . 10

1.4. . 11

1.5. / . 12

1.6. . 14

1.7. .. 14

1.8. . 16

1.9. . 18

... 19

2. .. 20

2.1. .. 20

2.2. C#. 21

... 24

3. - C# 25

3.1. .. 25

3.2. . 25

3.3. . 28

3.4. .. 31

3.5. . 34

3.6. . 36

3.7. . 39

3.8. . 41

3.9. .. 43

3.10. . 44

3.11. .. 46

3.12. .. 48

3.13. .. 49

3.14. . 51

3.15. . 58

... 61

4. Microsoft Visual Studio 2005. 61

4.1. . 61

4.2. .. 62

4.3. .. 63

4.4. / . 64

4.4.1. / -. 65

4.4.2. / -. 66

4.4.3. / . 67

4.4.4. / . 68

4.5. . 71

4.5.1. SDI . 72

4.5.2. MDI . 75

... 80

5. - Microsoft Visual Studio 2005. 81

5.1. 81

5.2. . 84

5.3. .. 87

5.4. . 89

... 91

.. 91

.. 92

 


 

 

++ . # . , . , , # .

# ( Microsoft .NET Framework) . # , Windows, Internet, .

. , . " " , , . . #. # "" . ( C++) Pascal, , Delphi, .

# , Microsoft .Net Framework Microsoft. C# , , C++, Java, Delphi, Modula-2 Smalltalk. , Turbo Pascal Borland Delphi, . , # , , ; , , - .

, . ++ Delphi

1. C#

Microsoft Studio 2005. , , , . C# , . Studio 2005 :

- File New Project;

- Visual C#, Windows, Console Application;

- (Location) (Name), ConsApp.

:

using System; //

using System.Collections.Generic;

using System.Text;

 

namespace ConsApp

{

//

class Program

{

//

static void Main(string[] args)

{

// ,

Console.WriteLine(" );

Console.ReadLine();

}

}

}

( ), (Program), (Main). . . Console.ReadLine(); . , / Pascal. .

 

C#

 

sbyte 1 , -128 127
byte 1, 0 255
char 2 , Unicode 0000 FFFF
short 2 , -32768 32767
ushort 2 , 0 65535
int 4 , -2 147 483 646 2 147 483 647
uint 4 , 0 4 294 967 295
long 8 , -9 223 372 036 854 775 808 9 223 372 036 854 775 807
ulong 8 , 0 18 446 744 073 709 551 615
decimal 28, 29 10e-28 7.9e+28
float 7 1.5e-45 3.4e38
double 15-16 5.0e-324 1.7e308
bool   true false
string  

 

C#, ++ , , .

.

int i, k;

float x, y;

decimal d1;

short n;

string s1;

char c1;

bool b1;

i = 3;

n=9;

x = -6.7f; // x = -456.43F;

double z;

z = 5.76; // z = 5.34D; z = -76.45d;

d1 = 123.43m; // d1 = 154.65M;

s1 = "ABCDEF";

c1 = '?';

b1=true;

, -6.7 double x = -6.7; ! d1 = 123.43; float, double, decimal. decimal Currency (): ( ).

.

: , . bool, double, decimal . float double; int long, float, double, decimal; long float, double, decimal.

(__)

( - . ).

x=(float)56.3; // double

// float

d1 = (decimal)25.6; // double

// decimal

i = (int)8.6; // i=8

. , :

x=(float)56.6e+300; , float. . , short n=123456789; n=(short)123456789; .

C# , . !

: ; , int, double, bool, string.

 





:


: 2016-11-24; !; : 437 |


:

:

: , .
==> ...

2010 - | 1637 -


© 2015-2024 lektsii.org - -

: 0.025 .