: ""

: ""

. . .

:

:

2007


3

1. 4

1.1.

1.2.

2.

2.1. .

2.2. C#.

2.2.1.

2.2.2.

3.

3.1.

3.2. .

. :

¾        Windows ;

¾        2D Windows #;

¾        .

.

, Windows 2D , , ( ).


1.

1.1.

. .

() , , .[1]

- . .

(PRBG) , . , . , .

() , - . - .

, . , - , , .

"". " " , -. .

ז "" . "" - ". , , - , 100 . .

" -". / .

"" , ... .

, :

¾        /

¾       

¾        ,

¾       

¾       

, , , , .

. . 1948 . . .

(1):

(1)

a > 0, c > 0, M > 0 . X0 . , Xj . , , , , m. m , :

1.         (c, m) = 1 ( c m );

2.         a - 1 p p m;

3.         a - 1 4, m 4.

m = 2e, e , .

(2) n- , 0-

(2)


.

, , , .[2]

, , .

, , .

(3):

X(k) = \left\{ \begin{matrix} X(k-a)-X(k-b), & \mbox{if } X(k-a)\geq X(k-b); \\ X(k-a)-X(k-b)+1, & \mbox{if } X(k-a) < X(k-b);\end{matrix}\right. (3)

X(k) [0, 1),

a, b , .

max(a, b) . . max(a, b) , .

: a = 55, b = 24; a = 17, b = 5;

a = 97, b = 33.

, (Blum Blum Shub, BBS)

1986 .

BBS (4):

xn+1 = (xn)2 mod M (4)

M=p*q p q.

xn , xn.

, p q, 3 4 (φ(p-1), φ(q-1)) .

, xn n - 1 , x0 p q. n- "" (5):

xn = x0 (2 ^ n) mod ((p-1)(q-1)) mod M (5)

(Mersenne twister)

1997 . , , .

, . Mersenne Twister MT 19937.

MT 19937 :

1.         , 219937 − 1.

2.         .

3.         , , - .

4.         .

Random #.

, Random. , Random .

Random :

public Random()

public Random(int seed)

Random, . seed.

Random ()

//

Random ()

Random(int );

//

int Next () ;

int Next(int _) ;

int Next(int _, int _) ;

double NextDouble() ;

, . Next , , . NextDouble 0.0 1.0.

, , , Random, , , :

¾        , ;

¾        , .

 

1.2.

, . , . :

1.         Windows .

2.        

3.        

4.        

5.         .

, . . . . .

, .

: , .

. -, .. .

-, . , .

, .

- - , (Visual Basic, C++Builder, #, Delphi) Borland C++ , , OWL MFC. [3]

, , " ", Borland Delphi , Microsoft Visual Basic. Visual Basic Windows , ( ).

Windows, , , C++Builder. , Windows, . . Borland C++ for Windows, , . C++ Builder , , , C++ Builder - . ++ .

Delphi , Delphi. Delphi - , Object Pascal. Borland Delphi 7 Studio : . Delphi- , .

, #, Visual Studio .Net , , .

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

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

# - , .NET Framework .

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

C# - , .NET[7].

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

- , C# .

.Net :

1.      .Net , , C#. .Net .

2.         .Net , .

3.         .Net , .

4.         .Net .

5.         .Net , , . , . , , Microsoft.

6.         .Net .

7.         .Net , . .Net , .

# , , .


2.

2.1. .

:

¾        Form1.cs , , ;

¾        Form1.resx , ;

¾        Form2.cs - , , ;

¾        Form2.resx , ;

¾        AboutBox1.cs - , , ;

¾        AboutBox1.resx , ;

¾        .htm HTML-, ;

¾        .jpg

¾        .exe - , debug, bin

2.2. C#.

, \Microsoft Visual Studio .NET 2005\Microsoft Visual Studio .NET 2005. Open Project , .sln. . Design. , Toolbox. HelpProvider MenuStrip , Label, TextBox Button . , View Properties Windows :

//

this.Text = String.Format(" ");

this.labelProductName.Text = "C";

this.labelVersion.Text = String.Format(" {0}", AssemblyVersion);

this.labelCopyright.Text = " ";

this.labelCompanyName.Text = " ..., -31";

this.textBoxDescription.Text =" Microsoft Visual Studio

Properties , .


2.2.1.

, , , , . , Windows .

public partial class Form1 : Form //

{

public Form1() //

{

InitializeComponent();

//

MR = 10;

MC = 10;

NM = 10;

W = 40;

H = 40;

this.newGame(1);// newGame(int r)

}

}

public partial class Form2 : Form //

{

public Form2()//

{

InitializeComponent();

}

}

partial class AboutBox1 : Form //

{

public AboutBox1()//

{

InitializeComponent();

//

this.Text = String.Format(" ");

this.labelProductName.Text = "C";

this.labelVersion.Text = String.Format (" {0}", AssemblyVersion);

this.labelCopyright.Text = " ";

this.labelCompanyName.Text = " ..., -31";

this.textBoxDescription.Text =" Microsoft Visual Studio 2005 .NET Framework";

}

}

2.2.2.

-, . .

public partial class Form1 : Form

public partial class Form2 : Form

:

private int

MR,//-

MC,//-

NM,//-

W,//

H;//

private int

nMin,//-

nFlag;//-

private int status;/* :

0- ,

1-,

2- */

private int[,] Pole;/*

0-8 -- ,

9 - ,

100-109 - ,

200-209 - */

, Pole . C# : .

- "" . , .

Pole = new int[MR + 2, MC + 2];

private void newGame(int r)

{

}

.

[ ], . :

private void newGame(int r)

{

/*

-3 */

for (row = 0; row <= MR + 1; row++)

{

Pole[row, 0] = -3;

Pole[row, MC + 1] = -3;

}

for (col = 0; col <= MC + 1; col++)

{

Pole[0, col] = -3;

Pole[MR + 1, col] = -3;

}

//

for (row = 1; row <= MR; row++)

{

for (col = 1; col <= MC; col++)

{

Pole[row, col] = 0;

}

}

}

.

, ( ). :

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

{

<_>

}

, . , void.

, :

private void newGame(int r)//,

{

//

int random = r;

if (random == 1)

{

this.Rand();// Rand()

}

if (random == 2)

{

this.Lin();// Lin()

}

if (random == 3)

{

this.BBS();// BBS()

}

}

//

private void Rand()//, Random

{

int n = 0;//-

int row, col;

Random rnd = new Random();//

//

do

{

row = rnd.Next(MR) + 1;

col = rnd.Next(MC) + 1;

if (Pole[row, col] != 9)

{

Pole[row, col] = 9;

n++;

}

}

while (n != NM);

}

private void Lin()//,

{

int n = 0;

int row, col;

double a = Convert.ToInt64(Math.Exp((double)5 * Math.Log(7))),

m = Convert.ToInt64(Math.Exp((double)31 * Math.Log(2))) - 1;

int x = 27011989, c = 19;

//

do

{

//

x(k+1)=(a * x(k) + c) mod m

x = (int)((a * x + c) % m);

// [0,MR]

row =Convert.ToInt32( Math.Ceiling((double) MR * x / (m-1)));

x = (int)((a * x + c) % m);

// [0,M]

col = Convert.ToInt32(Math.Ceiling((double)MC * x / (m-1)));

if (Pole[row, col] != 9)

{

Pole[row, col] = 9;

n++;

}

}

while (n != NM);

}

private void BBS()//, ,

{

int n = 0;

int row, col;

int x = 2701;

int p=2047,q=8191;

int M = p * q;

//

do

{

//

x(k+1)=(x(k)^2) mod m

x = Math.Abs((int)((x * x) % M));

// [0,MR]

row = Convert.ToInt32(Math.Ceiling((double)MR * x / (M-1)));

x = Math.Abs((int)((x * x) % M));

// [0,M]

col = Convert.ToInt32(Math.Ceiling((double)MC * x / (M-1)));

if (Pole[row, col] != 9)

{

Pole[row, col] = 9;

n++;

}

}

while (n != NM);

}

private void showPole(Graphics g, int status)//,

{

for (int row = 1; row <= MR; row++)

{

for (int col = 1; col <= MC; col++)

{

this.kletka(g, row, col, status);// kletka()

}

}

}

private void kletka(Graphics g, int row, int col, int status)

//,

{

//

if (Pole[row, col] >= 200)

this.flag(g, x, y);

//

g.DrawRectangle(Pens.Black, x - 1, y - 1, x + W, y + H);

// (status=2),

if ((status == 2) && ((Pole[row, col] % 10) == 9))

this.mina(g, x, y);

}

private void open(int row, int col)//,

,

{

//

if (Pole[row, col] == 0)

{

Pole[row, col] = 100;

//

this.Invalidate(new Rectangle(x, y, W, H));

// , , ,

this.open(row, col - 1);

this.open(row - 1, col);

this.open(row, col + 1);

this.open(row + 1, col);

//

this.open(row - 1, col - 1);

this.open(row - 1, col + 1);

this.open(row + 1, col - 1);

this.open(row + 1, col + 1);

}

}

, :

private void mina(Graphics g, int x, int y)//,

{

//

g.FillRectangle(Brushes.Green, x + 16, y + 26, 8, 4);

g.FillRectangle(Brushes.Green, x + 8, y + 30, 24, 4);

g.DrawPie(Pens.Black, x + 6, y + 28, 28, 16, 0, -180);

g.FillPie(Brushes.Green, x + 6, y + 28, 28, 16, 0, -180);

//

g.DrawLine(Pens.Black, x + 12, y + 32, x + 28, y + 32);

// ""

g.DrawLine(Pens.Black, x + 20, y + 22, x + 20, y + 26);

// ""

g.DrawLine(Pens.Black, x + 8, y + 30, x + 6, y + 28);

g.DrawLine(Pens.Black, x + 32, y + 30, x + 34, y + 28);

}

private void flag(Graphics g, int x, int y)//,

{

Point[] p = new Point[3];

Point[] m = new Point[5];

//

p[0].X = x + 4;

p[0].Y = y + 4;

p[1].X = x + 30;

p[1].Y = y + 12;

p[2].X = x + 4;

p[2].Y = y + 20;

g.FillPolygon(Brushes.Red, p);

//

g.DrawLine(Pens.Black, x + 4, y + 4, x + 4, y + 35);

//

m[0].X = x + 8;

m[0].Y = y + 14;

m[1].X = x + 8;

m[1].Y = y + 8;

m[2].X = x + 10;

m[2].Y = y + 10;

m[3].X = x + 12;

m[3].Y = y + 8;

m[4].X = x + 12;

m[4].Y = y + 14;

g.DrawLines(Pens.White, m);

}

. Microsoft Windows. , , . , :

private void _MouseDown(object sender, MouseEventArgs e)//

{

}

private void ToolStripMenuItem1_Click(object sender, EventArgs e) //

{

this.newGame(1);

this.Invalidate();

}

// , -

private void ToolStripMenuItem_Click(object sender, EventArgs e)

{

}

private void ToolStripMenuItem1_Click(object sender, EventArgs e)

{

}

private void ToolStripMenuItem2_Click(object sender, EventArgs e)

{

}

private void ToolStripMenuItem3_Click(object sender, EventArgs e)

{

}

private void ToolStripMenuItem4_Click(object sender, EventArgs e)

{

}

private void ToolStripMenuItem5_Click(object sender, EventArgs e)

{

}

private void ToolStripMenuItem_Click(object sender, EventArgs e) //

{

settings = new ();//

settings.ShowDialog();//

//

MR = settings.MR;

MC = settings.MC;

NM = settings.NM;

W = 30;

H = 30;

this.newGame(1);

this.Invalidate();

}

// ,

private void randomToolStripMenuItem_Click(object sender, EventArgs e)

{

}

private void ToolStripMenuItem_Click(object sender, EventArgs e)

{

}

private void ToolStripMenuItem_Click(object sender, EventArgs e)

{

}

private void ToolStripMenuItem_Click(object sender, EventArgs e)

//

{

this.Close();

}

private void ToolStripMenuItem_Click(object sender, EventArgs e) //

{

Help.ShowHelp(this, this.helpProvider1.HelpNamespace);//

}

private void ToolStripMenuItem_Click(object sender, EventArgs e) //

{

AboutBox1 saper = new AboutBox1();//

saper.ShowDialog();//

}

Paint, . Paint , (invalid) . , , . Paint, - . , , Windows , . , , . Paint. , Paint.

private void Form1_Paint(object sender, PaintEventArgs e)//

Paint

{

this.showPole(e.Graphics, status); // showPole

}


3.

3.1.

:

1.         Pentium 3.

2.         800 .

3.         256 .

4.         Radeon 9600 .

5.         Visual Studio 2003 2005.

6.         Windows 2000

3.2. .

:

1. ., . -31. .

2.

-

-

-

3. (. .3.1)

4. .NET Microsoft .NET Framework 3.0 dotnetfx3.exe

5.

, , .

(.3.2).

, . , .

, , , .

, , .

(.3.2), :

¾        10 * 10 20 *20, 10, 15, 20, 40, 60

, , . (.3.3)

, , :

¾        Random

¾       

¾        , .

, ,


: , , , , .

: , Random, , , .

, , , #.

. # .

, .

.

1.  . , . 2. -.: , 2007. . 832.

2.  . . - ,

29 (2003)

3.  . #/. . . : "c", 2004. 752 .

4.  . #. .: "", 2005

5.  . Microsoft .NET Framework. - .: - , 2003.-464 .

6.  . . . . #. . - : -Ȼ, 2003. - 560 .

1

public partial class Form1 : Form //

{

private int

MR,//-

MC,//-

NM,//-

W,//

H;//

private int

nMin,//-

nFlag;//-

private int status;/* :

0- ,

1-,

2- */

private int[,] Pole;/*

0-8 -- ,

9 - ,

100-109 - ,

200-209 - */

private void newGame(int r)/*, ;

r

1- Random,

2- ,

3- , */

{

this.ClientSize = new Size(W * MC + 1, H * MR + 1+25);/*

*/

int row, col;//

int k;//-

Pole = new int[MR + 2, MC + 2];//

/* -3

*/

for (row = 0; row <= MR + 1; row++)

{

Pole[row, 0] = -3;

Pole[row, MC + 1] = -3;

}

for (col = 0; col <= MC + 1; col++)

{

Pole[0, col] = -3;

Pole[MR + 1, col] = -3;

}

//

for (row = 1; row <= MR; row++)

{

for (col = 1; col <= MC; col++)

{

Pole[row, col] = 0;

}

}

//

int random = r;

if (random == 1)

{

this.Rand();// Rand()

}

if (random == 2)

{

this.Lin();// Lin()

}

if (random == 3)

{

this.BBS();// BBS()

}

// -

for (row = 1; row <= MR; row++)

{

for (col = 1; col <= MC; col++)

{

if (Pole[row, col] != 9)

{

k = 0;

if (Pole[row - 1, col - 1] == 9)

k++;

if (Pole[row - 1, col] == 9)

k++;

if (Pole[row - 1, col + 1] == 9)

k++;

if (Pole[row, col - 1] == 9)

k++;

if (Pole[row, col + 1] == 9)

k++;

if (Pole[row + 1, col - 1] == 9)

k++;

if (Pole[row + 1, col] == 9)

k++;

if (Pole[row + 1, col + 1] == 9)

k++;

Pole[row, col] = k;

}

status = 0;//

nMin = 0;//

nFlag = 0;//

}

}

}

//

private void Rand()//, Random,

{

int n = 0;//-

int row, col;

Random rnd = new Random();//

//

do

{

row = rnd.Next(MR) + 1;

col = rnd.Next(MC) + 1;

if (Pole[row, col] != 9)

{

Pole[row, col] = 9;

n++;

}

}

while (n != NM);

}

private void Lin()//,

{

int n = 0;

int row, col;

double a = Convert.ToInt64(Math.Exp((double)5 * Math.Log(7))), m = Convert.ToInt64(Math.Exp((double)31 * Math.Log(2))) - 1;

int x = 27011989, c = 19;

//

do

{

// x(k+1)=(a * x(k) + c) mod m

x = (int)((a * x + c) % m);

// [0,MR]

row =Convert.ToInt32( Math.Ceiling((double) MR * x / (m-1)));

x = (int)((a * x + c) % m);

// [0,M]

col = Convert.ToInt32(Math.Ceiling((double)MC * x / (m-1)));

if (Pole[row, col] != 9)

{

Pole[row, col] = 9;

n++;

}

}

while (n != NM);

}

private void BBS()//, ,

{

int n = 0;

int row, col;

int x = 2701;

int p=2047,q=8191;

int M = p * q;

//

do

{

// x(k+1)=(x(k)^2) mod m

x = Math.Abs((int)((x * x) % M));

// [0,MR]

row = Convert.ToInt32(Math.Ceiling((double)MR * x / (M - 1)));

x = Math.Abs((int)((x * x) % M));

// [0,M]

col = Convert.ToInt32(Math.Ceiling((double)MC * x / (M - 1)));

if (Pole[row, col] != 9)

{

Pole[row, col] = 9;

n++;

}

}

while (n != NM);

}

private void showPole(Graphics g, int status)//,

{

for (int row = 1; row <= MR; row++)

{

for (int col = 1; col <= MC; col++)

{

this.kletka(g, row, col, status);// kletka(Graphics g, int row, int col, int status)

}

}

}

private void kletka(Graphics g, int row, int col, int status)//,

{

//

int x = (col - 1) * W + 1, y = (row - 1) * H + 1 + 25;

// -

if (Pole[row, col] < 100)

{

g.FillRectangle(SystemBrushes.ControlLight, x - 1, y - 1, x + W, y + H);

}

//

if (Pole[row, col] >= 100)

{

// , -

if (Pole[row, col] != 109)

g.FillRectangle(Brushes.White, x - 1, y - 1, x + W, y + H);

// ,

else

g.FillRectangle(Brushes.Red, x - 1, y - 1, x + W, y + H);

// , -

if ((Pole[row, col] >= 101) && (Pole[row, col] <= 108))

g.DrawString((Pole[row, col] - 100).ToString(), new Font("Tahoma", 20, FontStyle.Bold), Brushes.Blue, x + 3, y + 2);

}

//

if (Pole[row, col] >= 200)

this.flag(g, x, y);

//

g.DrawRectangle(Pens.Black, x - 1, y - 1, x + W, y + H);

// (status=2),

if ((status == 2) && ((Pole[row, col] % 10) == 9))

this.mina(g, x, y);

}

private void open(int row, int col)//, ,

{

//

int x = (col - 1) * W + 1, y = (row - 1) * H + 1 + 25;

if (Pole[row, col] == 0)

{

Pole[row, col] = 100;

//

this.Invalidate(new Rectangle(x, y, W, H));

// , , ,

this.open(row, col - 1);

this.open(row - 1, col);

this.open(row, col + 1);

this.open(row + 1, col);

//

this.open(row - 1, col - 1);

this.open(row - 1, col + 1);

this.open(row + 1, col - 1);

this.open(row + 1, col + 1);

}

else

if ((Pole[row, col] < 100) && (Pole[row, col] != -3))

{

Pole[row, col] += 100;

//

this.Invalidate(new Rectangle(x, y, W, H));

}

}

private void mina(Graphics g, int x, int y)//,

{

//

g.FillRectangle(Brushes.Green, x + 16, y + 26, 8, 4);

g.FillRectangle(Brushes.Green, x + 8, y + 30, 24, 4);

g.DrawPie(Pens.Black, x + 6, y + 28, 28, 16, 0, -180);

g.FillPie(Brushes.Green, x + 6, y + 28, 28, 16, 0, -180);

//

g.DrawLine(Pens.Black, x + 12, y + 32, x + 28, y + 32);

// ""

g.DrawLine(Pens.Black, x + 20, y + 22, x + 20, y + 26);

// ""

g.DrawLine(Pens.Black, x + 8, y + 30, x + 6, y + 28);

g.DrawLine(Pens.Black, x + 32, y + 30, x + 34, y + 28);

}

private void flag(Graphics g, int x, int y)//,

{

Point[] p = new Point[3];

Point[] m = new Point[5];

//

p[0].X = x + 4;

p[0].Y = y + 4;

p[1].X = x + 30;

p[1].Y = y + 12;

p[2].X = x + 4;

p[2].Y = y + 20;

g.FillPolygon(Brushes.Red, p);

//

g.DrawLine(Pens.Black, x + 4, y + 4, x + 4, y + 35);

//

m[0].X = x + 8;

m[0].Y = y + 14;

m[1].X = x + 8;

m[1].Y = y + 8;

m[2].X = x + 10;

m[2].Y = y + 10;

m[3].X = x + 12;

m[3].Y = y + 8;

m[4].X = x + 12;

m[4].Y = y + 14;

g.DrawLines(Pens.White, m);

}

public Form1()//

{

InitializeComponent();

//

MR = 10;

MC = 10;

NM = 10;

W = 40;

H = 40;

this.newGame(1);// newGame(int r)

}

private void Form1_Paint(object sender, PaintEventArgs e)// Paint

{

this.showPole(e.Graphics, status);// showPole(Graphics g, int status)

}

private void ToolStripMenuItem_Click(object sender, EventArgs e)//

{

Help.ShowHelp(this, this.helpProvider1.HelpNamespace);//

}

private void _MouseDown(object sender, MouseEventArgs e)//

{

// ,

if (status == 2)

return;

//

if (status == 0)

status = 1;

// ,

int row = (int)((e.Y - 25)/ H) + 1, col = (int)(e.X / W) + 1;

//

int x = (col - 1) * W + 1, y = (row - 1) * H + 1 + 25;

//

if (e.Button == MouseButtons.Left)

{

// ,

if (Pole[row, col] == 9)

{

Pole[row, col] += 100;

status = 2;//

this.Invalidate();//

}

else

{

if (Pole[row, col] < 9)

this.open(row, col);

}

}

//

if (e.Button == MouseButtons.Right)

{

// ,

if (Pole[row, col] <= 9)

{

nFlag += 1;

if (Pole[row, col] == 9)

nMin += 1;

Pole[row, col] += 200;

//

if ((nMin == NM) && (nFlag == NM))

{

status = 2;//

this.Invalidate();//

}

else

this.Invalidate(new Rectangle(x, y, W, H));//

}

else

{

// ,

if (Pole[row, col] >= 200)

{

nFlag -= 1;

Pole[row, col] -= 200;

this.Invalidate(new Rectangle(x, y, W, H));//

}

}

}

}

// , -

private void ToolStripMenuItem_Click(object sender, EventArgs e)

{

MR = 10;

MC = 10;

NM = 10;

W = 40;

H = 40;

this.newGame(1);

this.Invalidate();

}

private void ToolStripMenuItem1_Click(object sender, EventArgs e)

{

MR = 10;

MC = 10;

NM = 15;

W = 40;

H = 40;

this.newGame(1);

this.Invalidate();

}

private void ToolStripMenuItem2_Click(object sender, EventArgs e)

{

MR = 10;

MC = 10;

NM = 20;

W = 40;

H = 40;

this.newGame(1);

this.Invalidate();

}

private void ToolStripMenuItem3_Click(object sender, EventArgs e)

{

MR = 20;

MC = 20;

NM = 20;

W = 30;

H = 30;

this.newGame(1);

this.Invalidate();

}

private void ToolStripMenuItem4_Click(object sender, EventArgs e)

{

MR = 20;

MC = 20;

NM = 40;

W = 30;

H = 30;

this.newGame(1);

this.Invalidate();

}

private void ToolStripMenuItem5_Click(object sender, EventArgs e)

{

MR = 20;

MC = 20;

NM = 60;

W = 30;

H = 30;

this.newGame(1);

this.Invalidate();

}

private void ToolStripMenuItem_Click(object sender, EventArgs e)//

{

AboutBox1 saper = new AboutBox1();// 堠

saper.ShowDialog();//

}

private void ToolStripMenuItem_Click(object sender, EventArgs e)//

{

Form2 settings = new Form2();//

settings.ShowDialog();//

//

MR = settings.MR;

MC = settings.MC;

NM = settings.NM;

W = 30;

H = 30;

this.newGame(1);

this.Invalidate();

}

private void ToolStripMenuItem_Click(object sender, EventArgs e)//

{

this.Close();

}

private void ToolStripMenuItem1_Click(object sender, EventArgs e)//

{

this.newGame(1);

this.Invalidate();

}

// ,

private void randomToolStripMenuItem_Click(object sender, EventArgs e)

{

this.newGame(1);

this.Invalidate();

}

private void ToolStripMenuItem_Click(object sender, EventArgs e)

{

this.newGame(2);

this.Invalidate();

}

private void ToolStripMenuItem_Click(object sender, EventArgs e)

{

this.newGame(3);

this.Invalidate();

}

}

public partial class Form2 : Form //

{

public int MR,MC,NM;

public Form2()//

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)//

{

// ,

if (((textBox1.Text == "") || (textBox2.Text == "")) || (textBox3.Text == ""))

{

MessageBox.Show(" !");

}

// , -

else

{

MR = Convert.ToInt32(textBox1.Text);

MC = Convert.ToInt32(textBox2.Text);

NM = Convert.ToInt32(textBox3.Text);

this.Close();

}

}

}

partial class AboutBox1 : Form //

{

public AboutBox1()//

{

InitializeComponent();

// Initialize the AboutBox to display the product information from the assembly information.

// Change assembly information settings for your application through either:

// - Project->Properties->Application->Assembly Information

// - AssemblyInfo.cs

//

this.Text = String.Format(" ");

this.labelProductName.Text = "C";

this.labelVersion.Text = String.Format(" {0}", AssemblyVersion);

this.labelCopyright.Text = " ";

this.labelCompanyName.Text = " ..., -31";

this.textBoxDescription.Text = " Microsoft Visual Studio 2005 .NET Framework";

}

}





2010