Unit 4
Unit 4
NET OVERVIEW
INTRODUCTION TO .NET
● OLE Technology: OLE (Object Linking and Embedding) is one of the technologies of
Microsoft’s component document. Basically, its main purpose is to link elements from
different applications with each other.
● COM Technology: The technology of the Microsoft Windows family of the operating
system, Microsoft COM (Common Object Model) enables various software components
to communicate. COM is mostly used by developers for various purposes like creating
reusable software components, linking components together to build applications, and
also taking advantage of Windows services. The objects of COM can be created with a
wide range of programming languages.
● .NET Technology: .NET technology of collection or set of technologies to develop
windows and web applications. The technology of .Net is developed by Microsoft and
was launched in Feb. 2002, by basic definition, Microsoft’s new Internet Strategy. It was
originally called NGWS (Next Generation Web Services). It is considered to be one of
the most powerful, popular, and very useful Internet Technology available today.
.NET FRAMEWORK OVERVIEWS
Main Components of .NET Framework
● Common Language Runtime(CLR):
o The CLR is the heart of the .NET Framework, acting as a virtual machine that
runs the code and manages various services such as memory management,
security, and thread management. Code that is compiled and executed within
the CLR is called “Managed Code,” while code that the CLR does not manage
is known as “Unmanaged Code.”
● .NET Framework Class Library (FCL):
o The FCL provides a large set of reusable classes and methods for application
development.
o This includes libraries for input/output operations, networking, data access, UI
controls, and more.
Overall, the .NET Framework is a powerful and versatile development platform that provides
a wide range of tools and libraries for building and running applications on Windows
operating systems.
● .NET is a software framework that is designed and developed by Microsoft. The first
version of the .Net framework was 1.0 which came in the year 2002. In easy words, it is a
virtual machine for compiling and executing programs written in different languages
like C#, VB.Net, etc.
● It is used to develop Form-based applications, Web-based applications, and Web services.
There is a variety of programming languages available on the .Net platform, VB.Net
and C# being the most common ones. It is used to build applications for Windows,
phones, web, etc. It provides a lot of functionalities and also supports industry standards.
● .NET Framework supports more than 60 programming languages of which 11
programming languages are designed and developed by Microsoft. The remaining Non-
Microsoft Languages are supported by .NET Framework but not designed and
developed by Microsoft.
Mobile (older frameworks like Compact Framework; now evolved with .NET
MAUI/Xamarin)
It provides a Common Language Runtime (CLR) and a Base Class Library (BCL), which
serve as the foundation for all .NET applications.
Portability – Initially for Windows, later evolved into .NET Core and .NET 5+ for cross-
platform support.
Security – Built-in mechanisms like Code Access Security (CAS) and validation.
Performance and Scalability – Managed execution, JIT compilation, and garbage collection
for efficient resource use.
Ease of Deployment – No need to register DLLs (no "DLL Hell"), support for side-by-side
execution.
LINQ (Language Integrated Query) – Enables querying data in a consistent way (SQL, XML, objects).
Entity Framework – An ORM (Object Relational Mapper) for interacting with databases using .NET
objects.
All .NET languages compile to a common Intermediate Language (IL) and run on the same runtime.
Enables language interoperability, i.e., components written in different languages can interact
seamlessly.
5. Namespaces
Namespaces are used to organize and group classes and other types in a logical hierarchy.
The System namespace is the root of the .NET Framework class library:
They help avoid naming conflicts and allow better code organization and reuse.
.NET FRAMEWORK BASE CLASSES
The Base Class Library is a core set of reusable classes, interfaces, and value types that provide the
most fundamental functionality in .NET. It’s part of the larger .NET Framework Class Library (FCL)
and is used by all .NET applications, regardless of the language.
Namespace Description
System Core types like Object, String, Int32, DateTime, Console, etc.
Namespace: System.Windows.Forms
Features:
Example UI:
csharp
CopyEdit
Button myButton = new Button();
myButton.Text = "Click Me";
myButton.Click += (s, e) => MessageBox.Show("Hello from WinForms!");
Web Forms
Type: Web-based UI (part of ASP.NET)
Namespace: System.Web.UI
Features:
Use Case: Web applications hosted on IIS (older tech, now mostly replaced by MVC and Razor
Pages)
Example (ASPX):
html
CopyEdit
<asp:Button ID="btnClick" runat="server" Text="Click Me" OnClick="btnClick_Click" />
Console Applications
Type: Command-line interface (CLI)
Namespace: System
Features:
Example:
csharp
CopyEdit
Console.WriteLine("Enter your name:");
string name = Console.ReadLine();
Console.WriteLine("Hello, " + name + "!");
2. Program Interface
This refers to how programs or systems interact with each other, often without direct user interaction.
Examples:
Class Libraries – Other programs can call into shared .NET assemblies (DLLs)
Web Services / APIs – Programs can interact over HTTP (WCF, Web API)
Now drag and drop the controls that you needed on created Form. For example, if you can add
TextBox, ListBox, Button etc. as shown below. By clicking on the particular dropped control you can
see and change its properties present in the right most corner of Visual Studio.
In the
above image, you can see the TextBox is selected and its properties like TextAlign, MaxLength etc.
are opened in right most corner. You can change its properties’ values as per the application need. The
code of controls will be automatically added in the background. You can check
the Form1.Designer.cs file present in the Solution Explorer Window.
To run the program you can use an F5 key or Play button present in the toolbar of Visual Studio. To
stop the program you can use pause button present in the ToolBar. You can also run the program by
going to Debug->Start Debugging menu in the menubar.
C# Windows Forms is a graphical user interface (GUI) framework that enables developers to create
desktop applications for the Windows operating system. Windows Forms applications are created
using the C# programming language and the .NET framework. They are built by dragging and
dropping controls such as buttons, text boxes, labels, and other user interface elements onto a form.
The Windows Forms framework provides a rich set of controls that developers can use to build
applications with. These controls are designed to provide a consistent and familiar user interface for
Windows users. Developers can customize the appearance and behavior of these controls by setting
various properties and handling events.
To create a Windows Forms application in C#, you can use Microsoft Visual Studio, which is an
integrated development environment (IDE) that provides a visual designer to create and layout the
user interface elements. The visual designer is a drag-and-drop interface for building your UI, and you
can easily configure each control’s properties through a user-friendly interface.
In addition to the visual designer, Visual Studio also provides a code editor that enables developers to
write the C# code for the application’s logic. Developers can handle events and perform tasks such as
data validation, data manipulation, and business logic implementation.
Windows Forms applications are versatile and can be used to create various types of applications such
as data entry, management, and reporting applications, as well as games and multimedia applications.
PROGRAMINTERFACE, WEBSERVICES
A program interface is how one program or system communicates with another. In .NET, this is often
done using:
Web Services
APIs (Application Programming Interfaces)
Class Libraries (DLLs)
COM Interop (for older Windows applications)
These interfaces are typically non-visual, used behind the scenes by applications to exchange data or
perform tasks.
Client-side usage: You can add a Web Reference in Visual Studio and call the service like a local
method.
Client usage: Can be called from browsers, mobile apps, or tools like Postman or curl.
🧠 Key Differences
Ideal Use Case Legacy systems Enterprise apps Mobile & web apps