Программирование - это просто
Advertisement
arrow C# arrow Visual C# arrow Visual C# . 13. . .
01.02.2023 .
1:
C#
Delphi
Web-
Excel-
.
Visual C# . 13. . . E-mail
megabax   
13.05.2012 .
Delphi

Visual C# . 13. . .

, . . , , . , , . - .

C# , . , , . , . .  , , , . :

        public interface MyDriver

        {

            string receiv();

            void send(string data);

        }

:

        public class FirstDriver : MyDriver

        {

            public string receiv()

            {

                return "This is first driver";

            }

            public void send(string data)

            {

                MessageBox.Show("Send data to first driver " + data);

            }

        }

:

        public class SecondDriver : MyDriver

        {

            public string receiv()

            {

                return "This is second driver";

            }

            public void send(string data)

            {

                MessageBox.Show("Send data to second driver " + data);

            }

        }

, , () MyDriver, , , , :

        private void btnStart_Click(object sender, EventArgs e)

        {

            list = new List<MyDriver>();

            list.Add(new FirstDriver());

            list.Add(new SecondDriver());

            label1.Text = list[0].receiv();

            label2.Text = list[1].receiv();

            list[0].send("Proba");

            list[1].send("Proba");

        }

:

Visual C#  .  13.  .   .

, , , :

        public class Proba

        {

            public string receiv()

            {

                return "This is proba class";

            }

            public void send(string data)

            {

                MessageBox.Show("Send data toproba class " + data);

            }

 

        }

, :

Visual C#  .  13.  .   .

( , - ):

Visual C#  .  13.  .   .

, , .


, *,   "Microsoft Visual Studio 2010 Professional", Microsoft.. 


 

()

 

( 12.02.2014 . )
 
« .   . »
 
© 2023 Программирование - это просто
Joomla! - , GNU/GPL.
© 2005-2008 Joom.Ru - Joomla!
Design by Mamboteam.com | Powered by Mambobanner.de
  .