:

:

1.

1.1

1.2. C#

1.3. /

1.4.

1.5.

2.

3.

3.1 StudyProgram

3.2 StudyProgram


, , -, .

: C#.

: . .

C# Microsoft, Visual Studio .Net (v.7).


1.

 

1.1

, . #, Visual Studio .Net (v.7), , . , C# - .NET-, .NET Framework.

C# Microsoft, .NET Framework. Microsoft C# , , ++ Java- . C# , ++ Java, .

C# ++, . , ++, C#, ( - ).

# - , .NET Framework .

, .NET Framework (FCL) (CLR) .NET- (, .NET). : Microsoft Visual Basic .NET (VB .NET), Microsoft Visual C++ .NET , COBOL, Eiffel, Jscript, RPG . , C# .NET Framework , .

, , C# C++ Visual Basic, .

C# C ( , , .), Java ( , ) ( ), .

, . [7] , , . , , , .
C# - , .NET[7].

, - , XML . .

C# , Java. , . , .

, , ( Java), .

- , C# - , [6]. , C# Web - Web , Internet . C# Web , : XML (Extensible Markup Language) SOAP (Simple Object Access Protocol). Web Web , C# , Web - [6].

, .

1.2. C#

- . , . - , , . , , # - C++ Java, , .

#, , C++ Java. class, , , :

class Employee

{

private long employeeld;

}

, Employee employeeld. : private (access modifier).

, CIS (Common Type System) # .

  . -, . . , . static, readonly const.

  . , ( ).

  . "" (smart fields), , . , , -.

  . , , , .

  . "" , - "" , - get set. .

  . . Microsoft Windows. , , . # / (publish/subscribe), MSMQ (Microsoft Message Queuing) +, . # , .

  . #, , .

C# C++. C# : , (jagged):
:

.

C++:

int[] array = new int[10];

int[] array = {1, 2, 3, 4, 5};

[]:

int element = array[0];

0 N - 1, N - .
. - "" . , . , (Java), , .


:

int[,] array = new int[10, 20];

int[,] array = {{1, 2}, {3, 4}};

[], :

int element = array[0, 2];

, 0 N - 1, N - .

- , . if, for, while goto. C# : switch, do foreach.

if..else

if..else, , .

if (a > b)

{

Console.WriteLine("a > b");

}

else

{

Console.WriteLine("a <= b");

}

bool ( C/C++, ). , , - . - , [8]:

if (serverObject != null)

serverObject.Initialize();

:

// , 0

if (x != 0)

{

d /= x;

}

else

return;

// , , , null

if (command.Parameters["RETURN_VALUE"].Value != Convert.DBNull)

return command.Parameters["RETURN_VALUE"].Value;

else

return null;

for

for , .

ArrayList items = new ArrayList(); //

CreateArray(items); //

for (int i = 0; i < items.Count; i++)

{

Console.WriteLine("i[{0}] = {1}", i, items[i]);

}

: , : , , , , - .

for :

//

for (int i = 0; i < 10; i++)

sum += array[i];

, , ( 10) .

while

while : , . while :

//

int num = 678;

// - 0

int len = 0;

//

while (num > 0)

{

len++;

num /= 10;

}

Console.WriteLine(len);

: . , , - .

switch

switch , . , if, .

switch :

int a = 1;

switch (a)

{

case 0:

//, a = 0

Console.WriteLine("A = 0");

break;

case 1:

//, a = 1

Console.WriteLine("A = 1");

break;

default:

//, ,

Console.WriteLine("A <> 0 A <> 1");

break;

}

case x , , switch x. default - case- . switch .

goto case goto default.

do

do . while, , . .

string s = "A, B, C, D";

do

{

s = s.Substring(s.IndexOf(",") + 1);

} while (s.Length > 0);

, , .

:

<_> <> <_>;

. public. . f , , , fSpeed.

, fMaxFloor. , :

public int fLevel;

public int fPassenger;

public float fSpeed;

:

<_><__><_>(<_>opt)

{

<_>

}

, . <__>.

, void.

. , . . , :

<_><__> <_> (<__>)

{

<_>

}

<__>::=<><>,<><>opt ..

, public void Move (byte level)

, , , .. [9].

, , .

, 1 , 2, 3 .. , , ref. ref, .

1.3. /

, . , , . 0 1. .

, . - , , , . . .

, . , .

k, , m .

. [4].

. / ? , , , , , . . , , , .

.

( =0,17) , - , , .

(, ), . ( ) .

/ - , .

/ . . , . . . , 10 . , , .

. , . 1 0 , 2 0 1 . / . , .

:

10101011 1 0
11001010 0 0
10010001 1 0
11001011 0 1

/ . , n . k, :

, , .

: 1000111011010101110010101 , :

1 0 0 0 1 0
1 1 0 1 1 0
0 1 0 1 0 0
1 1 1 0 0 1
1 0 1 0 1 1
0 1 0 0 1

, :

1 0 0 0 1 0
1 1 0 1 1 0
0 1 0 0 0 0
1 1 1 0 0 1
1 0 1 0 1 1
0 1 0 0 1

, . , , , . , 0 1.


1.4.

, , , .

, , . , . . . , , . :

e N, (CjN )[3].

, .

, , , . ( -), .. .

. n , . , :

,

;

;

.

n, :

2.2.a

n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

0 0 1 1 2 3 4 4 5 6 7 8 9 10 11 11

1 2 2 3 3 3 3 4 4 4 4 4 4 4 4 5

, , m k . , , k , . , , . k . , 0, , 1. , k . . k- 2k . , m+k . :

2k  (m+k+1)

m k .

n 1,2,3,4 8,,15 16,31
m 0,0,1,1 4,11 11,26
k 1,2,2,3 44 55

, 16- 5 . , 8 . , 1,2,4,8, , (1- ).

1 1,3,5,7,9,11,13,15,
2 2,3,6,7,10,11,14,15,18,19,22,23,
3 4,5,6,7,12,13,14,15,20,21,22,23,
4 8,9,10,11,12,13,14,15,24,

, , 9 , , 1- 1,3,5,7,9 . 2- 2,3,6,7 . 3- 4,5,6,7 4- 8,9 . 1, 0, . .

: . , 0,43. , . . .

5- 10011. , , 1- 1,3, 5- . 2- 2 3- . 3- 4 5- . 1- 0 (101), 2- 0 (00), 3- 0 (11).

k1 = 1 + 0 + 1 = 0 ;

k2 = 0 + 0 =0 ;

k3 = 1 + 1 = 0 .

, . , , , 4- 0. 1, 2 3- 0, 0, 1.

k1 = 1 + 0 + 1 = 0 ;

k2 = 0 + 0 =0 ;

k3 = 0 + 1 = 1 .

100 , .. 4.


1.5.

, - ; . , - , - , ( ). , , . , , , , , .

( ).

: (. 13).

, . , . , , : , , , , , . , , , , .

, , , . , ..., -3,-2,-1,0,1, 2,3, ... (. 14).

, , , , - , , . (, , , , , , )

( ), V ( ) (. 15).

, , , . , . , .

. , ); , , .

, , , .

, , . ( ) . , () () , , , [2].

, . , . . , .

. , ( i, j, j1, j2 1, 2, 3, 4, 5, ):

. .

. .

. .

. .

. .

. .

,

,

- ,

- .

i, , . , 137, 25 6386. j, ( - j1, j2), ( j1, j2 ). . , 1, 32, 25, 32 , 25 .

(. . ) , :

1) 1, ( ) 2 . .; k- k.

2) ( ) ( : . , ).

, :

, :

. [1].

, , -, , -, () , . . - ( , ) . , , (.. ) () . .

, , . ( ) . . , , ( ) ( , ) . , , . , : k- i, , j, k+1- j; j1 j2, k+1- j1 ; , , k- , k + 1- : . , - - .

, . , . , ; , ; , . , ; , ; , . j1 j2 : , ( , , ); , , , j1, , j2 ( , , , , ). , .

, - , , :

1) ( ); , ; .

2) ; , ; .

3) , ; , ; [5].


2.

IBM . : Pentium , 16MB, 800x600, 256 , Windows 95 , .NET Framework.

*.cs ( ).

, :

     Even_ueven.cs , , \;

     Even_ueven.resx , \;

     Hemming.cs - , , ;

     Hemming.resx , ;

     Post.cs - , , ;

     Post.resx , ;

     Error.cs - , , Error;

     Error.resx , Error;

     Help.cs - , , ;

     Help.resx , ;

     Start.cs - , , Start;

     Start.resx , Start;

     AssemblyInfo.cs - , , , ;

     StudyProgram.exe - , debug, bin.

. , . .2.

, Visual Studio .Net, .

.3 Visual Studio .Net. , \Microsoft Visual Studio .NET 2003\Microsoft Visual Studio .NET 2003. Open Project , Study_Programs.sln. . Design. , Toolbox. . .

, - , : int Prav; int ch; int ChVoprosov=1 ( ). Prav- , ch , ChVoprosov- ( 1) .

Even_ueven Generation(); . , , textBox1 ( ), textBox2. , d 0, 1( d=r.Next(0,2); ), 7 for( for (int i=0; i<7; i++) ). , , . ( g=r.Next(0,2); ). ch: for (ch+=d; - 7 ), g (ch+=g;).

button1 ( ) ChangeChVoposov(); textBox3. Prav( ) textBox4( 0), if (ch==0 || ch==2 || ch==4 || ch==6) : ch - 0. 1 ( Prav++; ). ChangePrav();, textBox4. ch ( ch=0; ) , Generation();.

button2 ( ) , if (ch==1 || ch==3 || ch==5 || ch==7) , ch .

, , , . .

: int ChVoprosov=1,

int X; int Nomer; int [] x=new int[10] . X , Nomer , , int [] x=new int[10] , , , ChVoprosov- ( 1). .

Hemming Generation(); Number(); . , , textBox1. , , ( ). , .

, d 0, 1( d=r.Next(0,2); ), 9 for( for (int i=1; i<10; i++) ). , , . int [] x ( x[i]=d; ), .. , . X 1, , .

Number() , . 4, , x1, x2, x3, x4.

(Nomer=x4*1000+x3*100+x2*10+x1;)

button1 ( ) , (textBox2.Text="";), .. , . if ( if(textBox1.Text.Length!=textBox3.Text.Length) , X : X=1;) if , X (if (X==1) , , ). X=1. , if, Nomer (if (Nomer==0)). (.. , ) ( Prav++; ), Otvet(); . textBox3 ( ) , int [] x :

textBox3.Text=x[1]+""+x[2]+""+x[3]+""+x[4]+""+x[5]+""+[6]+""+x[7]+""+x[8]+""+x[9];

, .. textBox3 , , textBox1 (, ).

Nomer , Sravnenie();. ( X ) X (if (X==1)) : i (int i=0;). Nomer , 0 9 (: if (Nomer == 101) Nomer 101, 5). Nomer - , i ( 101, i 5 (i = 5;)). i - 1 9, if (i!=0) (i ) : x[i] 0, , x[i] , .. 1, Otvet(); ( textBox3 , , textBox1 (, ), , i.). x[i] 0( 1), else , x [i] 0.

Sravnenie(); ( Otvet();), , Nomer - , 9. , . textBox3 (if(textBox3.Text.Length==0)) , . , 1 Otvet();, textBox3 , , textBox1 (, ).

textBox5, X , , , .

button2 ( ) Proverka();. , (0 1). if , textBox3 ( ): if(textBox2.Text.Length! =textBox1.Text.Length && textBox1.Text.Length! = textBox3.Text.Length)

, , 9 , , , , : , , (A5=new Error(" 9- "); A5.ShowDialog(); )

, else. if(textBox1.Text.Length!=textBox3.Text.Length) (for(int i=0; i<textBox2.Text.Length; i++)) , 0 1. C# Substring(i,1) (string d=textBox2.Text.Substring(i,1); - d , i- ( i 0 , .. 9 )). d 9 0 1 (if(d!=b && d!=a)) , , d 1 0 , , (A5=new Error(" 9- "); A5.ShowDialog(); ), , .. i textBox2.Text.Length. X 0. X 1. Proverka(); . X=1, if (X==1). if, Nomer (if (Nomer==0)). (.. , ), , , . Otvet(), textBox3, .

Sravnenie(); ( , Nomer==0). Nomer Sravnenie(); textBox3,, , , Nomer , , 9. , textBox3 . , , textBox3: if (textBox3.Text.Length==0) Otvet();. Moe , textBox2, Pravilnoe textBox3. 1: if (Moe==Pravilnoe) Prav++; . X , , .

button3 , . button3 ( ) , : Generation() Number();

, , (. ).

private void button2_Click(object sender, System.EventArgs e) , .

private void help_Click(object sender, System.EventArgs e) - , .

private void button3_Click(object sender, System.EventArgs e) - , GO.

public static byte first() , m1.

public static byte second() , m1.

public static byte third() , m1..

public static byte fourth() , m1..

public void fifth() , , . , m1, , m2..

bool check_string(string str) , .

.

char input[] command[][]. GO input[]. , , 0 1, . check_string(string str), , , command[][]. , . .


3.

StudyProgram IBM . : Pentium , 16MB, 800x600, 256 , Windows 95 , .NET Framework.

3.1 StudyProgram

StudyProgram . . StudyProgram, .4.:

StudyProgram :

\

\ .

\. . .

: , , . , . , , . . , . , . , . : , , . . , \ . , , Help(. .6)

, .

( ) 9- , . 5 : , , , , . : , , , . , , , . . , 1. , , , , . , 9 . , . .8:

, , . , , , . . , .

3.2 StudyProgram

StudyProgram , . . StudyProgram, .4. 3 . 1- .

.

: GO, . . . , 0 - , 1 . , 1- . , , . 4- . 1- , 2- , 3- 4- . , 4- . , .

:

1) , , . , 1- , , , , .. .

2) , .

3) GO, , .

: n,K,m1,m2; n , , m1, m2 . , 1 6. .

1 m1
2 m1
3 m1
4 m1
5 , . , m1, , m2
6

: 1,1,2,0;. 1, 1 ( ). , 2.

, , . , . .

          1, 5, 2, 4; 1-

          2, 1, 3, 0; 2-

          3, 5, 2, 4; 3-

          4, 4, 5, 0; 4-

          5, 6, 0, 0; 5-

. 1- 5, .. . , 2, 4- . 2- 3- . 3- . , 4- . 4- (, , .. 4- ) 5- , .

.

.

, .11.

, .

 

, , - .

:

          , , , C#, / , , .

          , , .

          , : StudyProgram ; StudyProgram .

.


1.         .., .. . , -, 2005

2.         .. . , , 1988

3.         http://computer-museum.ru

4.         http://pascalstudy.narod.ru

5.         http://de.uspu.ru

6.         http://c-sharp.ru

7.         http://dotsite.spb.ru

8.         http://i-u.ru

9.         http://mf.grsu.by

10.      . # .NET.


Start

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;

namespace Study_Programs

{

public class Start : System.Windows.Forms.Form

{

private System.Windows.Forms.Label label1;

private System.Windows.Forms.GroupBox groupBox1;

private System.ComponentModel.Container components = null;

Post A1;

Even_uneven A2;

Hemming A3;

private System.Windows.Forms.Button even_uneven_button;

private System.Windows.Forms.Button hemming_button;

private System.Windows.Forms.Button exit_button;

private System.Windows.Forms.Button post_button;

public Start(){InitializeComponent();}

protected override void Dispose( bool disposing )

{

if(disposing) if (components != null) components.Dispose();

base.Dispose( disposing );

}

#region Windows Form Designer generated code

private void InitializeComponent()

#endregion

[STAThread]

static void Main() {Application.Run(new Start());}

private void exit_button_Click(object sender, System.EventArgs e){this.Close();}

private void post_button_Click(object sender, System.EventArgs e)

{

A1 = new Post();

A1.ShowDialog();

}

private void even_uneven_button_Click(object sender, System.EventArgs e)

{

A2 = new Even_uneven();

A2.ShowDialog();

}

private void hemming_button_Click(object sender, System.EventArgs e)

{

A3 = new Hemming();

A3.ShowDialog();

}

}

}

Post

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

namespace Study_Programs

{

public class Post : System.Windows.Forms.Form

{

private System.Windows.Forms.Label label1;

private System.Windows.Forms.TextBox textBox1;

private System.Windows.Forms.Label label2;

private System.Windows.Forms.TextBox textBox2;

private System.Windows.Forms.Label label3;

private System.Windows.Forms.TextBox textBox3;

private System.Windows.Forms.Button button2;

private System.Windows.Forms.Button button3;

private System.ComponentModel.Container components = null;

private System.Windows.Forms.Button help;

Help A4;Error A5;

static char []input;

static char [][] command;

static byte l,finish,k;

static sbyte position;

static bool chk=true;

public Post(){InitializeComponent();}

protected override void Dispose(bool disposing)

{

if( disposing )if(components != null) components.Dispose();

base.Dispose(disposing);

}

#region Windows Form Designer generated code

private void InitializeComponent()

{

this.label1 = new System.Windows.Forms.Label();

this.textBox1 = new System.Windows.Forms.TextBox();

this.label2 = new System.Windows.Forms.Label();

this.textBox2 = new System.Windows.Forms.TextBox();

this.label3 = new System.Windows.Forms.Label();

this.textBox3 = new System.Windows.Forms.TextBox();

this.help = new System.Windows.Forms.Button();

this.button2 = new System.Windows.Forms.Button();

this.button3 = new System.Windows.Forms.Button();

this.SuspendLayout();

//

// label1

//

this.label1.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.label1.Location = new System.Drawing.Point(8, 8);

this.label1.Name = "label1";

this.label1.Size = new System.Drawing.Size(192, 16);

this.label1.TabIndex = 0;

this.label1.Text = " ";

//

// textBox1

//

this.textBox1.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.textBox1.Location = new System.Drawing.Point(8, 24);

this.textBox1.Name = "textBox1";

this.textBox1.Size = new System.Drawing.Size(224, 21);

this.textBox1.TabIndex = 1;

this.textBox1.Text = " , 0 1";

//

// label2

//

this.label2.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.label2.Location = new System.Drawing.Point(8, 56);

this.label2.Name = "label2";

this.label2.Size = new System.Drawing.Size(216, 16);

this.label2.TabIndex = 2;

this.label2.Text = " ";

//

// textBox2

//

this.textBox2.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.textBox2.Location = new System.Drawing.Point(8, 72);

this.textBox2.Name = "textBox2";

this.textBox2.Size = new System.Drawing.Size(224, 21);

this.textBox2.TabIndex = 3;

this.textBox2.Text = " ";

//

// label3

//

this.label3.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.label3.Location = new System.Drawing.Point(8, 104);

this.label3.Name = "label3";

this.label3.Size = new System.Drawing.Size(112, 16);

this.label3.TabIndex = 4;

this.label3.Text = " ";

//

// textBox3

//

this.textBox3.BorderStyle = System.Windows.Forms.BorderStyle.None;

this.textBox3.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.textBox3.Location = new System.Drawing.Point(8, 120);

this.textBox3.Name = "textBox3";

this.textBox3.ReadOnly = true;

this.textBox3.Size = new System.Drawing.Size(224, 14);

this.textBox3.TabIndex = 5;

this.textBox3.Text = "";

//

// help

//

this.help.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.help.Location = new System.Drawing.Point(136, 144);

this.help.Name = "help";

this.help.Size = new System.Drawing.Size(72, 24);

this.help.TabIndex = 8;

this.help.Text = "";

this.help.Click += new System.EventHandler(this.help_Click);

//

// button2

//

this.button2.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.button2.Location = new System.Drawing.Point(40, 176);

this.button2.Name = "button2";

this.button2.Size = new System.Drawing.Size(168, 24);

this.button2.TabIndex = 9;

this.button2.Text = " ";

this.button2.Click += new System.EventHandler(this.button2_Click);

//

// button3

//

this.button3.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.button3.Location = new System.Drawing.Point(40, 144);

this.button3.Name = "button3";

this.button3.Size = new System.Drawing.Size(72, 24);

this.button3.TabIndex = 10;

this.button3.Text = "GO";

this.button3.Click += new System.EventHandler(this.button3_Click);

//

// Post

//

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

this.BackColor = System.Drawing.SystemColors.InactiveBorder;

this.ClientSize = new System.Drawing.Size(242, 208);

this.ControlBox = false;

this.Controls.Add(this.button3);

this.Controls.Add(this.button2);

this.Controls.Add(this.help);

this.Controls.Add(this.textBox3);

this.Controls.Add(this.label3);

this.Controls.Add(this.textBox2);

this.Controls.Add(this.label2);

this.Controls.Add(this.textBox1);

this.Controls.Add(this.label1);

this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;

this.MaximizeBox = false;

this.Name = "Post";

this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

this.Text = "Post";

this.TopMost = true;

this.ResumeLayout(false);

}

#endregion

public static byte first()

{

position++;

return(k=Convert.ToByte(char.GetNumericValue(command[k][2])-1));

}

public static byte second()

{

position--;

return(k=Convert.ToByte(char.GetNumericValue(command[k][2])-1));

}

public static byte third()

{

input[position]='1';

return(k=Convert.ToByte(char.GetNumericValue(command[k][2])-1));

}

public static byte fourth()

{

input[position]='0';

return(k=Convert.ToByte(char.GetNumericValue(command[k][2])-1));

}

public void fifth()

{

if(position<input.Length)

{

if (input[position]=='0') k=Convert.ToByte(char.GetNumericValue(command[k][2])-1);

else k=Convert.ToByte(char.GetNumericValue(command[k][3])-1);

}

else

{

A5=new Error(" ");

A5.ShowDialog();

finish=1;chk=false;

}

}

bool check_string(string str)

{

int i,s=0,cnt=0;

for (i=0;i<str.Length;i++) if(str[i]==';')cnt++;

for (i=0;i<cnt;i++)

s++;

if(s!=str.Length) return(false);

return(true);

}

private void button2_Click(object sender, System.EventArgs e){this.Close();}

private void help_Click(object sender, System.EventArgs e)

{

A4 = new Help(0);

A4.ShowDialog();

}

private void button3_Click(object sender, System.EventArgs e)

{

l=1;k=0;position=0;finish=0;textBox3.Text="";chk=true;

int i,j;

//

input = new char [textBox1.Text.Length];

command = new char [textBox2.Text.Length/8][];

for (i=0;i<textBox1.Text.Length;i++)

{

if (textBox1.Text[i]!='0' && textBox1.Text[i]!='1')

{

A5 = new Error(" ");

A5.ShowDialog();

i=textBox1.Text.Length;

chk=false;

}

else input[i]=textBox1.Text[i];

}

//

if (check_string(textBox2.Text))

{

for (i=0;i<textBox2.Text.Length/8;i++)

{

command [i]=new char[4];

for (j=0;j<4;j++) command[i][j]=textBox2.Text[i*8+j*2];

}

}

else

{

A5 = new Error(" ");

A5.ShowDialog();

chk=false;

}

if (chk)

{

do

{

switch(command[k][l])

{

case('1'):

{

first();

break;

}

case('2'):

{

second();

break;

}

case('3'):

{

third();

break;

}

case('4'):

{

fourth();

break;

}

case('5'):

{

fifth();

break;

}

case('6'):

{

finish=1;

break;

}

}

}while (finish!=1);

}

if(chk) for(i=0;i<input.Length;i++) textBox3.Text+=input[i];

}

}

}

Hemming

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

namespace Study_Programs

{

public class Hemming : System.Windows.Forms.Form

{

int ChVoprosov=1;

int X=0;

int Nomer=0;

int [] x=new int[10];

Help A4; Error A5;

private System.Windows.Forms.TextBox textBox1;

private System.Windows.Forms.TextBox textBox2;

private System.Windows.Forms.TextBox textBox3;

private System.Windows.Forms.TextBox textBox4;

private System.Windows.Forms.TextBox textBox5;

private System.Windows.Forms.Button button1;

private System.Windows.Forms.Button button2;

private System.Windows.Forms.Button button3;

private System.Windows.Forms.Button button4;

private System.Windows.Forms.Button button5;

private System.Windows.Forms.Label label3;

private System.Windows.Forms.Label label4;

private System.Windows.Forms.Label label1;

private System.Windows.Forms.Label label2;

private System.Windows.Forms.Label label5;

private System.Windows.Forms.GroupBox groupBox1;

private System.Windows.Forms.ToolTip toolTip1;

private System.ComponentModel.IContainer components;

public Hemming(){InitializeComponent();}

protected override void Dispose( bool disposing )

{

if(disposing) if(components != null) components.Dispose();

base.Dispose(disposing);

}

public void Generation()

{

X=1;

textBox1.Text="";

Random r=new System.Random();

int d;

for (int i=1; i<10; i++)

{

d=r.Next(0,2);

textBox1.Text+=d;

x[i]=d;

}

}

public void Number()

public void Otvet(){textBox3.Text = x[1] + "" + x[2] + "" + x[3] + "" + x[4] + "" + x[5] + "" + x[6] + "" + x[7] + "" + x[8] + "" + x[9];}

public void Sravnenie()

{

if (X==1)

{

int i=0;

if (Nomer == 1) i = 1;

if (Nomer == 10) i = 2;

if (Nomer == 11) i = 3;

if (Nomer == 100) i = 4;

if (Nomer == 101) i = 5;

if (Nomer == 110) i = 6;

if (Nomer == 111) i = 7;

if (Nomer == 1000) i = 8;

if (Nomer == 1001) i = 9;

if (i!=0)

{

if (x[i] == 0)

{

x[i] = 1; Otvet();

}

else

{

x[i] = 0; Otvet();

}

}

}

}

public void Proverka()

{

if(textBox2.Text.Length!=textBox1.Text.Length && textBox1.Text.Length!=textBox3.Text.Length)

{

A5=new Error(" 9- ");

A5.ShowDialog();

X=0;

}

else

{

if(textBox1.Text.Length!=textBox3.Text.Length)

{

for(int i=0; i<textBox2.Text.Length; i++)

{

string a="1";

string b="0";

string d=textBox2.Text.Substring(i,1);

if(d!=b && d!=a)

{

A5=new Error(" 9- ");

A5.ShowDialog();

X=0;

i=textBox2.Text.Length;

}

else X=1;

}

}

}

}

#region Windows Form Designer generated code

private void InitializeComponent()

{

this.components = new System.ComponentModel.Container();

System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Hemming));

this.textBox1 = new System.Windows.Forms.TextBox();

this.textBox2 = new System.Windows.Forms.TextBox();

this.textBox3 = new System.Windows.Forms.TextBox();

this.textBox4 = new System.Windows.Forms.TextBox();

this.textBox5 = new System.Windows.Forms.TextBox();

this.button1 = new System.Windows.Forms.Button();

this.button2 = new System.Windows.Forms.Button();

this.button3 = new System.Windows.Forms.Button();

this.button4 = new System.Windows.Forms.Button();

this.button5 = new System.Windows.Forms.Button();

this.label3 = new System.Windows.Forms.Label();

this.label4 = new System.Windows.Forms.Label();

this.label1 = new System.Windows.Forms.Label();

this.label2 = new System.Windows.Forms.Label();

this.label5 = new System.Windows.Forms.Label();

this.groupBox1 = new System.Windows.Forms.GroupBox();

this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);

this.groupBox1.SuspendLayout();

this.SuspendLayout();

//

// textBox1

//

this.textBox1.Location = new System.Drawing.Point(216, 16);

this.textBox1.Name = "textBox1";

this.textBox1.ReadOnly = true;

this.textBox1.Size = new System.Drawing.Size(88, 20);

this.textBox1.TabIndex = 0;

this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;

//

// textBox2

//

this.textBox2.Location = new System.Drawing.Point(216, 40);

this.textBox2.MaxLength = 9;

this.textBox2.Name = "textBox2";

this.textBox2.Size = new System.Drawing.Size(88, 20);

this.textBox2.TabIndex = 1;

this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;

//

// textBox3

//

this.textBox3.Location = new System.Drawing.Point(216, 64);

this.textBox3.Name = "textBox3";

this.textBox3.ReadOnly = true;

this.textBox3.Size = new System.Drawing.Size(88, 20);

this.textBox3.TabIndex = 2;

this.textBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;

//

// textBox4

//

this.textBox4.Location = new System.Drawing.Point(104, 136);

this.textBox4.Name = "textBox4";

this.textBox4.ReadOnly = true;

this.textBox4.Size = new System.Drawing.Size(40, 20);

this.textBox4.TabIndex = 3;

this.textBox4.Text = "1";

this.textBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;

//

// textBox5

//

this.textBox5.Location = new System.Drawing.Point(272, 136);

this.textBox5.Name = "textBox5";

this.textBox5.ReadOnly = true;

this.textBox5.Size = new System.Drawing.Size(40, 20);

this.textBox5.TabIndex = 4;

this.textBox5.Text = "0";

this.textBox5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;

//

// button1

//

this.button1.Location = new System.Drawing.Point(8, 102);

this.button1.Name = "button1";

this.button1.Size = new System.Drawing.Size(88, 24);

this.button1.TabIndex = 5;

this.button1.Text = " ";

this.button1.Click += new System.EventHandler(this.button1_Click);

//

// button2

//

this.button2.Location = new System.Drawing.Point(108, 102);

this.button2.Name = "button2";

this.button2.Size = new System.Drawing.Size(88, 24);

this.button2.TabIndex = 6;

this.button2.Text = " ";

this.button2.Click += new System.EventHandler(this.button2_Click);

//

// button3

//

this.button3.Location = new System.Drawing.Point(206, 101);

this.button3.Name = "button3";

this.button3.Size = new System.Drawing.Size(112, 24);

this.button3.TabIndex = 7;

this.button3.Text = " ";

this.button3.Click += new System.EventHandler(this.button3_Click);

//

// button4

//

this.button4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));

this.button4.Location = new System.Drawing.Point(128, 160);

this.button4.Name = "button4";

this.button4.Size = new System.Drawing.Size(72, 24);

this.button4.TabIndex = 11;

this.button4.Text = "";

this.button4.Click += new System.EventHandler(this.button4_Click);

//

// button5

//

this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));

this.button5.Location = new System.Drawing.Point(80, 192);

this.button5.Name = "button5";

this.button5.Size = new System.Drawing.Size(168, 24);

this.button5.TabIndex = 12;

this.button5.Text = " ";

this.button5.Click += new System.EventHandler(this.button5_Click);

//

// label3

//

this.label3.Location = new System.Drawing.Point(8, 136);

this.label3.Name = "label3";

this.label3.Size = new System.Drawing.Size(96, 24);

this.label3.TabIndex = 13;

this.label3.Text = " :";

//

// label4

//

this.label4.Location = new System.Drawing.Point(152, 136);

this.label4.Name = "label4";

this.label4.Size = new System.Drawing.Size(120, 24);

this.label4.TabIndex = 14;

this.label4.Text = " :";

//

// label1

//

this.label1.Location = new System.Drawing.Point(8, 16);

this.label1.Name = "label1";

this.label1.Size = new System.Drawing.Size(216, 16);

this.label1.TabIndex = 15;

this.label1.Text = ", ";

//

// label2

//

this.label2.Location = new System.Drawing.Point(8, 40);

this.label2.Name = "label2";

this.label2.Size = new System.Drawing.Size(128, 16);

this.label2.TabIndex = 16;

this.label2.Text = " ";

//

// label5

//

this.label5.Location = new System.Drawing.Point(8, 64);

this.label5.Name = "label5";

this.label5.Size = new System.Drawing.Size(112, 16);

this.label5.TabIndex = 17;

this.label5.Text = " ";

//

// groupBox1

//

this.groupBox1.Controls.Add(this.label2);

this.groupBox1.Controls.Add(this.textBox3);

this.groupBox1.Controls.Add(this.label5);

this.groupBox1.Controls.Add(this.textBox1);

this.groupBox1.Controls.Add(this.textBox2);

this.groupBox1.Controls.Add(this.label1);

this.groupBox1.Location = new System.Drawing.Point(6, -1);

this.groupBox1.Name = "groupBox1";

this.groupBox1.Size = new System.Drawing.Size(312, 96);

this.groupBox1.TabIndex = 19;

this.groupBox1.TabStop = false;

this.toolTip1.SetToolTip(this.groupBox1, @"9- , . "+"\n"+" . , "+"\n"+" , . "+"\n"+", "+"\n"+" . C ");

//

// toolTip1

//

this.toolTip1.AutomaticDelay = 10;

this.toolTip1.AutoPopDelay = 100000;

this.toolTip1.InitialDelay = 10;

this.toolTip1.ReshowDelay = 2;

this.toolTip1.ShowAlways = true;

//

// Hemming

//

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

this.BackColor = System.Drawing.SystemColors.InactiveBorder;

this.ClientSize = new System.Drawing.Size(322, 224);

this.ControlBox = false;

this.Controls.Add(this.groupBox1);

this.Controls.Add(this.label4);

this.Controls.Add(this.label3);

this.Controls.Add(this.button5);

this.Controls.Add(this.button4);

this.Controls.Add(this.button3);

this.Controls.Add(this.button2);

this.Controls.Add(this.button1);

this.Controls.Add(this.textBox5);

this.Controls.Add(this.textBox4);

this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;

this.MaximizeBox = false;

this.Name = "Hemming";

this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

this.Text = "Hemming";

this.TopMost = true;

this.Load += new System.EventHandler(this.Hemming_Load);

this.groupBox1.ResumeLayout(false);

this.groupBox1.PerformLayout();

this.ResumeLayout(false);

this.PerformLayout();

}

#endregion

private void Hemming_Load(object sender, System.EventArgs e)

{

Generation();

Number();

}

private void button1_Click(object sender, System.EventArgs e)

{

textBox2.Text="";

if(textBox1.Text.Length!=textBox3.Text.Length) X=1;

if (X==1)textBox3.Text="";

int Prav=Convert.ToInt32(textBox5.Text);

if (X==1)

{

if (Nomer==0)

{

Prav++; Otvet();

}

Sravnenie();

if (textBox3.Text.Length==0)

{

Prav++; Otvet();

}

textBox5.Text=""; textBox5.Text+=Prav;

}

X=0;

}

private void button2_Click(object sender, System.EventArgs e)

{

Proverka();

if(X==1)textBox3.Text="";

int Prav=Convert.ToInt32(textBox5.Text);

if (X==1)

{

if (Nomer==0) Otvet();

Sravnenie();

if (textBox3.Text.Length==0) Otvet();

int Moe=Convert.ToInt32(textBox2.Text);

int Pravilnoe=Convert.ToInt32(textBox3.Text);

if (Moe==Pravilnoe) Prav++;

textBox5.Text="";

textBox5.Text+=Prav;

}

X=0;

}

private void button4_Click(object sender, System.EventArgs e)

{

A4 = new Help(2);

A4.ShowDialog();

}

private void button5_Click(object sender, System.EventArgs e){this.Close();}

private void button3_Click(object sender, System.EventArgs e)

{

ChVoprosov++;

textBox2.Text="";

textBox3.Text="";

textBox4.Text="";

textBox4.Text+=ChVoprosov;

Generation();

Number();

}

}

}

Even_ueven

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

namespace Study_Programs

{

public class Even_uneven : System.Windows.Forms.Form

{

int Prav;

int ch;

int ChVoprosov=1;

Help A4;

private System.Windows.Forms.TextBox textBox1;

private System.Windows.Forms.Button button1;

private System.Windows.Forms.TextBox textBox2;

private System.Windows.Forms.Button button2;

private System.Windows.Forms.TextBox textBox3;

private System.Windows.Forms.TextBox textBox4;

private System.Windows.Forms.Label label1;

private System.Windows.Forms.Label label2;

private System.Windows.Forms.Label label3;

private System.Windows.Forms.Label label4;

private System.Windows.Forms.Button button3;

private System.Windows.Forms.Button button4;

private System.Windows.Forms.Label label6;

private System.Windows.Forms.GroupBox groupBox1;

private System.ComponentModel.Container components = null;

public Even_uneven(){InitializeComponent();}

protected override void Dispose( bool disposing )

{

if( disposing ) if(components != null) components.Dispose();

base.Dispose( disposing );

}

public void Generation()

{

textBox1.Text="";

Random r=new System.Random();

int d;

for (int i=0; i<7; i++)

{

d=r.Next(0,2);

textBox1.Text+=d;

ch+=d;

}

textBox2.Text="";

int g=r.Next(0,2);

textBox2.Text+=g;

ch+=g;

}

public void ChangeChVoprosov()

{

ChVoprosov++;

textBox3.Text="";

textBox3.Text+=ChVoprosov;

}

public void ChangePrav()

{

textBox4.Text="";

textBox4.Text+=Prav;

}

#region Windows Form Designer generated code

private void InitializeComponent()

{

this.textBox1 = new System.Windows.Forms.TextBox();

this.button1 = new System.Windows.Forms.Button();

this.textBox2 = new System.Windows.Forms.TextBox();

this.button2 = new System.Windows.Forms.Button();

this.textBox3 = new System.Windows.Forms.TextBox();

this.textBox4 = new System.Windows.Forms.TextBox();

this.label1 = new System.Windows.Forms.Label();

this.label2 = new System.Windows.Forms.Label();

this.label3 = new System.Windows.Forms.Label();

this.label4 = new System.Windows.Forms.Label();

this.button3 = new System.Windows.Forms.Button();

this.button4 = new System.Windows.Forms.Button();

this.label6 = new System.Windows.Forms.Label();

this.groupBox1 = new System.Windows.Forms.GroupBox();

this.groupBox1.SuspendLayout();

this.SuspendLayout();

//

// textBox1

//

this.textBox1.Location = new System.Drawing.Point(192, 15);

this.textBox1.Name = "textBox1";

this.textBox1.ReadOnly = true;

this.textBox1.Size = new System.Drawing.Size(88, 20);

this.textBox1.TabIndex = 0;

this.textBox1.Text = "";

this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;

//

// button1

//

this.button1.Location = new System.Drawing.Point(7, 156);

this.button1.Name = "button1";

this.button1.Size = new System.Drawing.Size(140, 22);

this.button1.TabIndex = 1;

this.button1.Text = " ";

this.button1.Click += new System.EventHandler(this.button1_Click);

//

// textBox2

//

this.textBox2.Location = new System.Drawing.Point(192, 45);

this.textBox2.Name = "textBox2";

this.textBox2.ReadOnly = true;

this.textBox2.Size = new System.Drawing.Size(88, 20);

this.textBox2.TabIndex = 2;

this.textBox2.Text = "0";

this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;

//

// button2

//

this.button2.Location = new System.Drawing.Point(153, 156);

this.button2.Name = "button2";

this.button2.Size = new System.Drawing.Size(140, 21);

this.button2.TabIndex = 3;

this.button2.Text = " ";

this.button2.Click += new System.EventHandler(this.button2_Click);

//

// textBox3

//

this.textBox3.Location = new System.Drawing.Point(103, 186);

this.textBox3.Name = "textBox3";

this.textBox3.ReadOnly = true;

this.textBox3.Size = new System.Drawing.Size(34, 20);

this.textBox3.TabIndex = 4;

this.textBox3.Text = "1";

this.textBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;

//

// textBox4

//

this.textBox4.Location = new System.Drawing.Point(260, 186);

this.textBox4.Name = "textBox4";

this.textBox4.ReadOnly = true;

this.textBox4.Size = new System.Drawing.Size(33, 20);

this.textBox4.TabIndex = 5;

this.textBox4.Text = "0";

this.textBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;

//

// label1

//

this.label1.Location = new System.Drawing.Point(7, 16);

this.label1.Name = "label1";

this.label1.Size = new System.Drawing.Size(113, 22);

this.label1.TabIndex = 6;

this.label1.Text = " :";

//

// label2

//

this.label2.Location = new System.Drawing.Point(7, 45);

this.label2.Name = "label2";

this.label2.Size = new System.Drawing.Size(120, 22);

this.label2.TabIndex = 7;

this.label2.Text = " :";

//

// label3

//

this.label3.Location = new System.Drawing.Point(12, 189);

this.label3.Name = "label3";

this.label3.Size = new System.Drawing.Size(86, 15);

this.label3.TabIndex = 8;

this.label3.Text = " :";

//

// label4

//

this.label4.Location = new System.Drawing.Point(146, 186);

this.label4.Name = "label4";

this.label4.Size = new System.Drawing.Size(114, 14);

this.label4.TabIndex = 9;

this.label4.Text = " :";

//

// button3

//

this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.button3.Location = new System.Drawing.Point(120, 208);

this.button3.Name = "button3";

this.button3.Size = new System.Drawing.Size(60, 22);

this.button3.TabIndex = 10;

this.button3.Text = "";

this.button3.Click += new System.EventHandler(this.button3_Click);

//

// button4

//

this.button4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.button4.Location = new System.Drawing.Point(80, 238);

this.button4.Name = "button4";

this.button4.Size = new System.Drawing.Size(140, 22);

this.button4.TabIndex = 11;

this.button4.Text = " ";

this.button4.Click += new System.EventHandler(this.button4_Click);

//

// label6

//

this.label6.Location = new System.Drawing.Point(8, 88);

this.label6.Name = "label6";

this.label6.Size = new System.Drawing.Size(288, 64);

this.label6.TabIndex = 13;

this.label6.Text = " . " +

" , . " +

" , . ";

this.label6.TextAlign = System.Drawing.ContentAlignment.BottomLeft;

//

// groupBox1

//

this.groupBox1.Controls.Add(this.label1);

this.groupBox1.Controls.Add(this.textBox1);

this.groupBox1.Controls.Add(this.label2);

this.groupBox1.Controls.Add(this.textBox2);

this.groupBox1.Location = new System.Drawing.Point(7, 7);

this.groupBox1.Name = "groupBox1";

this.groupBox1.Size = new System.Drawing.Size(286, 75);

this.groupBox1.TabIndex = 14;

this.groupBox1.TabStop = false;

this.groupBox1.Text = " :";

//

// Even_uneven

//

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

this.BackColor = System.Drawing.SystemColors.InactiveBorder;

this.ClientSize = new System.Drawing.Size(301, 272);

this.ControlBox = false;

this.Controls.Add(this.groupBox1);

this.Controls.Add(this.label6);

this.Controls.Add(this.button4);

this.Controls.Add(this.button3);

this.Controls.Add(this.label4);

this.Controls.Add(this.label3);

this.Controls.Add(this.textBox4);

this.Controls.Add(this.textBox3);

this.Controls.Add(this.button2);

this.Controls.Add(this.button1);

this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;

this.Name = "Even_uneven";

this.ShowInTaskbar = false;

this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

this.Text = "Even_uneven";

this.TopMost = true;

this.Load += new System.EventHandler(this.Form1_Load);

this.groupBox1.ResumeLayout(false);

this.ResumeLayout(false);

}

#endregion

private void Form1_Load(object sender, System.EventArgs e)

{

Generation();

}

private void button1_Click(object sender, System.EventArgs e)

private void button2_Click(object sender, System.EventArgs e)

private void button4_Click(object sender, System.EventArgs e){this.Close();}

private void button3_Click(object sender, System.EventArgs e)

{

A4 = new Help(1); A4.ShowDialog();

}

}

}

Help

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

namespace Study_Programs

{

public class Help : System.Windows.Forms.Form

{

private System.Windows.Forms.Label label1;

private System.Windows.Forms.ComboBox comboBox1;

private System.Windows.Forms.RichTextBox richTextBox1;

private System.Windows.Forms.Button button1;

private System.ComponentModel.Container components = null;

public Help(byte n)

{

InitializeComponent();

comboBox1.SelectedIndex=n;

}

protected override void Dispose( bool disposing )

{

if(disposing) if(components != null)components.Dispose();

base.Dispose( disposing );

}

#region Windows Form Designer generated code

private void InitializeComponent()

{

this.label1 = new System.Windows.Forms.Label();

this.comboBox1 = new System.Windows.Forms.ComboBox();

this.richTextBox1 = new System.Windows.Forms.RichTextBox();

this.button1 = new System.Windows.Forms.Button();

this.SuspendLayout();

//

// label1

//

this.label1.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.label1.Location = new System.Drawing.Point(56, 0);

this.label1.Name = "label1";

this.label1.Size = new System.Drawing.Size(280, 24);

this.label1.TabIndex = 0;

this.label1.Text = " ";

this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

//

// comboBox1

//

this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;

this.comboBox1.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.comboBox1.Items.AddRange(new object[] {

" ",

" \\",

" "});

this.comboBox1.Location = new System.Drawing.Point(8, 24);

this.comboBox1.Name = "comboBox1";

this.comboBox1.Size = new System.Drawing.Size(376, 23);

this.comboBox1.TabIndex = 1;

this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);

//

// richTextBox1

//

this.richTextBox1.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.richTextBox1.Location = new System.Drawing.Point(8, 56);

this.richTextBox1.Name = "richTextBox1";

this.richTextBox1.ReadOnly = true;

this.richTextBox1.Size = new System.Drawing.Size(376, 184);

this.richTextBox1.TabIndex = 2;

this.richTextBox1.Text = "";

//

// button1

//

this.button1.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.button1.Location = new System.Drawing.Point(160, 248);

this.button1.Name = "button1";

this.button1.Size = new System.Drawing.Size(80, 24);

this.button1.TabIndex = 3;

this.button1.Text = "";

this.button1.Click += new System.EventHandler(this.button1_Click);

//

// Help

//

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

this.BackColor = System.Drawing.SystemColors.InactiveBorder;

this.ClientSize = new System.Drawing.Size(394, 280);

this.ControlBox = false;

this.Controls.Add(this.button1);

this.Controls.Add(this.richTextBox1);

this.Controls.Add(this.comboBox1);

this.Controls.Add(this.label1);

this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;

this.MaximizeBox = false;

this.Name = "Help";

this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

this.Text = "Help";

this.TopMost = true;

this.ResumeLayout(false);

}

#endregion

private void button1_Click(object sender, System.EventArgs e){this.Close();}

private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)

{

string temp;

switch(comboBox1.SelectedIndex)

{

case (0):

{

richTextBox1.Text="";

temp=" ( ) . , . , , , . , , , . ( ). , , ( ) ( ). . : n,K,m1,m2; n , , m1, m2 . , 1 6. .\n1 - m1.\n2 - m1.\n3 - m1.\n4 - m1.\n5 - , . , m1, , m2.\n6 - .\n : 1,1,2,0;. 1, 1 ( ). , 2.\n , , . , ";

richTextBox1.Text = temp + " . .\n 1,5,2,4; 1- .\n 2,1,3,0; 2- .\n 3,5,2,4; 3- .\n 4,4,5,0; 4- .\n 5,6,0,0; 5- .\n .\n1- 5, .. . , 2, 4- .\n2- 3- .\n3- . , 4- .\n4- (, , .. 4- ) 5- , .\n :\n1. , , . , 1- , , , , .. .\n2. , .\n3. GO, , .\n , 1- . . .";

break;

}

case (1):

{

richTextBox1.Text="";

temp=" .\n , . , , . 0 1. .\n , . - , , , . . . -. - 1 0 , 2 0 1 . ( ) . . , 10011011 , 5. , . , ( ) . . :\nI. - 1011101\n - 1\n - 0\n\nII. - 1110100\n - 0\n - 0\n\nIII.";

richTextBox1.Text = temp + " - 1000011\n - 0\n - 1\n\nIV. - 1110111\n - 1\n - 1.\n 0 , 1 - . . ( ). . , . . ( 9 6 ) , , .";

break;

}

case (2):

. , , , 4- 0.

}

}

}

}

Error

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

namespace Study_Programs

{

public class Error : System.Windows.Forms.Form

{

private System.Windows.Forms.Button button1;

private System.Windows.Forms.Label label1;

private System.Windows.Forms.PictureBox pictureBox1;

private System.ComponentModel.Container components = null;

public Error(string error)

{

InitializeComponent();

label1.Text=error;

}

protected override void Dispose( bool disposing )

{

if(disposing) if(components != null) components.Dispose();

base.Dispose( disposing );

}

#region Windows Form Designer generated code

private void InitializeComponent()

{

System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Error));

this.button1 = new System.Windows.Forms.Button();

this.label1 = new System.Windows.Forms.Label();

this.pictureBox1 = new System.Windows.Forms.PictureBox();

this.SuspendLayout();

//

// button1

//

this.button1.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.button1.Location = new System.Drawing.Point(136, 56);

this.button1.Name = "button1";

this.button1.Size = new System.Drawing.Size(72, 24);

this.button1.TabIndex = 0;

this.button1.Text = "OK";

this.button1.Click += new System.EventHandler(this.button1_Click);

//

// label1

//

this.label1.Font = new System.Drawing.Font("MS Reference Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));

this.label1.Location = new System.Drawing.Point(48, 8);

this.label1.Name = "label1";

this.label1.Size = new System.Drawing.Size(272, 40);

this.label1.TabIndex = 1;

this.label1.Text = "label1";

this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;

//

// pictureBox1

//

this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));

this.pictureBox1.Location = new System.Drawing.Point(8, 16);

this.pictureBox1.Name = "pictureBox1";

this.pictureBox1.Size = new System.Drawing.Size(32, 32);

this.pictureBox1.TabIndex = 2;

this.pictureBox1.TabStop = false;

//

// Error

//

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

this.BackColor = System.Drawing.SystemColors.InactiveBorder;

this.ClientSize = new System.Drawing.Size(338, 88);

this.ControlBox = false;

this.Controls.Add(this.pictureBox1);

this.Controls.Add(this.label1);

this.Controls.Add(this.button1);

this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;

this.Name = "Error";

this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

this.Text = "Error";

this.TopMost = true;

this.ResumeLayout(false);

}

#endregion

private void button1_Click(object sender, System.EventArgs e){this.Close();}

}

}





2010