Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to.NET Microsoft announced in June 2000 A new software –development model that allows applications created in disparate programming languages.

Similar presentations


Presentation on theme: "Introduction to.NET Microsoft announced in June 2000 A new software –development model that allows applications created in disparate programming languages."— Presentation transcript:

1 Introduction to.NET Microsoft announced in June 2000 A new software –development model that allows applications created in disparate programming languages to communicate with each other Allows developers to create Web-based applications

2 Introduction to.NET One key aspect of the.NET strategy is its independence from a specific language or platform Developer can create a.NET application by using any combination of.NET- compatible languages

3 Introduction to.NET Programmers can contribute to the same software project, writing code in the.NET languages in which they are most proficient Such as Visual C++.NET, C#, Visual Basic.NET and many others

4 Visual C++.NET Known as a visual programming language-the developer uses graphical tools, such as Visual Studio.NET, to create applications Visual C++ uses MFC.NET provides an additional library for implementing GUI, networking, multithreading and other capabilities

5 Visual C++.NET Visual C++.NET introduces Managed Extensions for C++ that enable a programmer to access the.NET framework. Programmers can use the.NET to create objects that provide automatic memory management C++ -- standard C++ MC++ -- managed extension to C++ Visual C++.NET – compiler used to write both managed and unmanaged code

6 How to use Visual Studio.NET IDE( integrated development environment) From Start->program Click Microsoft visualStudio.NET Click New Project to create a new project Or select a recent project on start page Or from file->new to create new project Or from file->open to open an existing project

7 How to use VisualStudio.NET In pop-up window  select visual C++ projects in left panel  Select Console application in right panel  Give a name to the project by Name  Select a location where project will be created Click OK

8 To create an unmanaged project ( write a standard C++ code) In pop-up window, Click application setting Select empty project Click finish

9 To add a source file: From file->new->files Or from solution explore window, right click on source file and select add->add new item (If you don’t see solution explore window, from view- >solution explore) In pop-up window, click C++ file(.cpp), name the file and select a location and then click open.

10 Create a window project From File->new ->project Select Windows form application Name the project, select a location then click ok.

11 Compile, build and exectute To compile a.cpp file, Click build->compile To build the project Click build->Build Solution To execute Click Debug->start without Debugging (You can run debug when you need to)

12 A simple program #include “stdafx.h” #using #using namespace System; int _tmain() { Console::WriteLine(S”Welcome”); return 0; }// end of _tmain

13 A simple Program #include”stdsfx.h” // includes contents of stdsfx.h into this program file #using // references prepackaged Microsoft code using namespace System; // declares the use of namespace System

14 namespace A namespace groups various MC++ features into related categories. The namespace that are defined in the.NET Framework contain preexisting code known as the.NET Framework Class Library(FCL). The actual code for the classes is located in.dll files called assemblies. The using directive informs your program that you intend to use a namespace using namespace System; This using directive allows us to write Console::WriteLine(S”Hello”); rather than System::Console::WriteLine(S”Hello”);

15 Namespaces in MC++ Systemessential class and types System::Dataclasses form ADO.NET, used for database access and manipulation System::Drawingclasses used for drawing and graphic System::IOclasses for input and output of data System::Threadingclasses for multithreading, used to run multiple parts of a program simultaneously System::Windows::Formsclasses used to create GUI System::Xmlclasses used to process XML data

16 Console class A example of one of the features in namespace System is class Console The Console class enables programs to output information to the computer’s standard output. Class Console provides methods, such as method WriteLine, that allow MC++ program to display strings and other types of information in the windows console window

17 S The S prefix indicates that the string that follows is a string-literal in the Managed Extensions for C++ Write(S”..”); WriteLine(S” …”); ReadLine(); //read a string from keyboard

18 Another program int _tmain() { String *Firstnum; String *Secondnum; int num1, num2, sum; Console::Write(S”Enter first integer”); Firstnum = Console::ReadLine(); Console::Write(S”Enter second integer”); Secondnum=Console::ReadLine(); num1 = Int32::Parse(Firstnum); num2 = Int32::Parse(Secondnum); sum = num1+num2; Console::WriteLine(S”\nThe sum is {0}.”, sum.ToString()); return 0; }

19 FCL Structure/class name Int16 16 bit signed integer short Int32 32-bit signed integer int Int64 64-bit integer __int64 Single 32-bit float Double 64-bit double Boolean boolean value bool Char Unicode(16-bit)character String string of unicode characters String*


Download ppt "Introduction to.NET Microsoft announced in June 2000 A new software –development model that allows applications created in disparate programming languages."

Similar presentations


Ads by Google