Unit 1: Visual Basic.NET and the.net Framework

Similar documents
HCIM SUMMER WORKSHOP Introduction to C#

Developing Microsoft.NET Applications for Windows (Visual Basic.NET)

10/9/2012. Sample C# program:

Microsoft..NET Framework. Overview

2609 : Introduction to C# Programming with Microsoft.NET

EEE-425 Programming Languages (2013) 1

New programming language introduced by Microsoft contained in its.net technology Uses many of the best features of C++, Java, Visual Basic, and other

INTRODUCTION TO.NET. Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.)

Introduction to.net Framework

M Introduction to C# Programming with Microsoft.NET - 5 Day Course

C# Syllabus. MS.NET Framework Introduction

Creating and Running Your First C# Program

EEE-425 Programming Languages (2013) 1

An Introduction to.net for the J2EE Programmer

Getting started 7. Setting properties 23

Part I. Integrated Development Environment. Chapter 2: The Solution Explorer, Toolbox, and Properties. Chapter 3: Options and Customizations

ASP.NET Web Forms Programming Using Visual Basic.NET

Introduction to Programming Microsoft.NET Framework Applications with Microsoft Visual Studio 2005 (C#)

The Microsoft.NET Framework

Introduction to Microsoft.NET Framework Programming using VS 2005 (C#)

This web service can be available to any user on the internet regardless of who developed it.

Introduction to.net Framework Week 1. Tahir Nawaz

Department of Computer Applications

VB.NET. Exercise 1: Creating Your First Application in Visual Basic.NET

Microsoft.NET: The Overview

Apex TG India Pvt. Ltd.

A NET Refresher

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net

Part I. The.NET Framework. Chapter 1: The.NET Foundation. Chapter 2: The Technologies of.net

2559 : Introduction to Visual Basic.NET Programming with Microsoft.NET

INFORMATICS LABORATORY WORK #2

DOT NET SYLLABUS FOR 6 MONTHS

Getting started 7. Setting properties 23

DOT NET Syllabus (6 Months)

Visual Studio.NET for AutoCAD Programmers

Yoon Joong Kim. Department of computer Engineering Hanbat National University

Developing Microsoft.NET Applications for Windows (Visual Basic.NET)

Fig 1.1.NET Framework Architecture Block Diagram

Microsoft Visual Basic 2005: Reloaded

Developing Classic Windows Forms applications using Visual Studio 2010 and.net QASMTNET4

Model Question Paper. Credits: 4 Marks: 140. Part A (One mark questions)

OUTLINE DELPHI 2005 FOR.NET JUMP START

Vision V sion o n I n n 1975 V sion o n T o T d o a d y A c o c m o pu p t u er e o n o n e v e e v r e y E po p w o er e p e p o e p o l p e

.Net Interview Questions

CHAPTER 7 COM and.net

Saikat Banerjee Page 1

Introduction to.net Framework and Visual Studio 2013 IDE MIT 31043, Visual Programming By: S. Sabraz Nawaz

Introduction to.net Framework and Visual Studio 2013 IDE MIT 31043, Rapid Application Development By: S. Sabraz Nawaz

.NET-6Weeks Project Based Training

CHAPTER 1: A QUICK TOUR 3

Darshan Institute of Engineering & Technology for Diploma Studies

TRAINING GUIDE FOR OPC SYSTEMS.NET. Simple steps to successful development and deployment. Step by Step Guide

Yoon Joong Kim. Department of computer Engineering Hanbat National University

Introduction to.net. The path. The Distributed Group University of Seville Spain - España. Introduction The elements of.net. Assessments Conclusions

CT862 Section 1 Introduction

CIS 3260 Intro. to Programming with C#

Mastering VB.NET using Visual Studio 2010 Course Length: 5 days Price: $2,500

Appendix G: Writing Managed C++ Code for the.net Framework

Chapter 12 Microsoft Assemblies. Software Architecture Microsoft Assemblies 1

Introduction to the Visual Studio.NET Integrated Development Environment IDE. CSC 211 Intermediate Programming

DOT NET COURSE BROCHURE

AC I Sem 5_TYCS. ASP.NET application codes can be written in any of the following languages:

.NET. Inf 5040, Outline. Gyrd Brændeland, Sharath Babu Musunoori, Åshild Grønstad Solheim

C# Programming Syllabus

Introducing C# After this discussion, we'll move on to a simple description of C# itself, including its origins and similarities to C++.

Chapter 1:- Introduction to.net. Compiled By:- Ankit Shah Assistant Professor, SVBIT.

Programming in C# for Experienced Programmers

Top 40.NET Interview Questions & Answers

Comparing.NET and Java.

Microsoft.NET Programming (C#, ASP.NET,ADO.NET, VB.NET, Crystal Report, Sql Server) Goal: Make the learner proficient in the usage of MS Technologies

Unit-1. Components of.net Framework. 1. Introduction to.net Framework

Part I: Programming Access Applications. Chapter 1: Overview of Programming for Access. Chapter 2: Extending Applications Using the Windows API

M Introduction to Visual Basic.NET Programming with Microsoft.NET 5 Day Course

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio

10267A CS: Developing Web Applications Using Microsoft Visual Studio 2010

Trusted Components. Reuse, Contracts and Patterns. Prof. Dr. Bertrand Meyer Dr. Karine Arnout

Developing Data Access Solutions with Microsoft Visual Studio 2010

MCP, MCTS (ASP.Net, C#) Get the rewards, respect, and recognition you deserve, Become a Microsoft Certified Professional.

Solution overview VISUAL COBOL BUSINESS CHALLENGE SOLUTION OVERVIEW BUSINESS BENEFIT

การสร างเว บเซอร ว สโดยใช Microsoft.NET

A Quick Tour GETTING STARTED WHAT S IN THIS CHAPTER?

Skill Area 336 Explain Essential Programming Concept. Programming Language 2 (PL2)

Creating.NET Add-ins for ArcGIS for Desktop

Level: M.Ed. Credit Hour: 3 (2+1) Semester: Third Teaching Hour: 80(32+48)

TRAINING GUIDE FOR OPC SYSTEMS.NET. Simple steps to successful development and deployment. Step by Step Guide

.NET FRAMEWORK. Visual C#.Net

Introduction to.net, C#, and Visual Studio. Part I. Administrivia. Administrivia. Course Structure. Final Project. Part II. What is.net?

Windows Presentation Foundation Programming Using C#


Introduction to Programming Microsoft.NET Applications with Visual Studio 2008 (C#)

To get started with Visual Basic 2005, I recommend that you jump right in

The C# Language PART I. CHAPTER 1: Introducing C# CHAPTER 2: Writing a C# Program. CHAPTER 3: Variables and Expressions. CHAPTER 4: Flow Control

Overview of the Microsoft.NET Framework

SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM ( )

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU

C# is intended to be a simple, modern, general-purpose, objectoriented programming language. Its development team is led by Anders Hejlsberg.

Developing Windows Applications with Microsoft Visual Studio 2010

2310C VB - Developing Web Applications Using Microsoft Visual Studio 2008 Course Number: 2310C Course Length: 5 Days

Getting started 7. Storing values 21. Creating variables 22 Reading input 24 Employing arrays 26 Casting data types 28 Fixing constants 30 Summary 32

Introduction to Microsoft.NET Programming Using Microsoft Visual Studio 2008 (C#) Course Overview. Prerequisites. Audience.

Transcription:

1 Chapter1: Visual Basic.NET and the.net Framework Unit 1: Visual Basic.NET and the.net Framework Contents Introduction to.net framework Features Common Language Runtime (CLR) Framework Class Library(FCL) Visual Studio.Net IDE, Languages Supported, Features. Visual Programming, VB.net- Components of IDE- Menu System, Toolbars, Code Designer, Solution Explorer, Object Browser, Toolbox, Class View Window, Properties Window, Server Explorer, Task List, Output Window, Command Window. Introduction to.net framework The.NET Framework defines an environment that supports the development and execution of highly distributed, component-based applications. It enables differing computer languages to work together and provides for security, program portability, and a common programming model for the Windows platform. As it relates to VB, the.net Framework defines two very important entities. The first is the Common Language Runtime (CLR). This is the system that manages the execution of your program. Along with other benefits, the Common Language Runtime is the part of the.net Framework that enables programs to be portable, supports mixed-language programming, and provides for secure execution. The second entity is the.net class library. This library gives your program access to the runtime environment. For example, if you want to perform I/O, such as displaying something on the screen, you will use the.net class library to do it.

2 Chapter1: Visual Basic.NET and the.net Framework Design Features Interoperability Because computer systems commonly require interaction between newer and older applications, the.net Framework provides means to access functionality implemented in newer and older programs that execute outside the.net environment. Access to COM components is provided in the System.Runtime.InteropServices and System.EnterpriseServices namespaces of the framework. Common Language Runtime engine The Common Language Runtime (CLR) serves as the execution engine of the.net Framework. All.NET programs execute under the supervision of the CLR, guaranteeing certain properties and behaviours in the areas of memory management, security, and exception handling. Language independence The.NET Framework introduces a Common Type System, or CTS. The CTS specification defines all possible datatypes and programming constructs supported by the CLR and how they may or may not interact with each other conforming to the Common Language Infrastructure (CLI) specification. Because of this feature, the.net Framework supports the exchange of types and object instances between libraries and applications written using any conforming.net language. Base Class Library The Base Class Library (BCL), part of the Framework Class Library (FCL), is a library of functionality available to all languages using the.net Framework. The BCL provides classes that encapsulate a number of common functions, including file reading and writing, graphic rendering, database interaction, XML document manipulation, and so on. It consists of classes, interfaces of reusable types that integrates with CLR (Common Language Runtime). Simplified deployment The.NET Framework includes design features and tools which help manage the installation of computer software to ensure it does not interfere with previously installed software, and it conforms to security requirements. Security The design addresses some of the vulnerabilities, such as buffer overflows, which have been exploited by malicious software. Additionally,.NET provides a common security model for all applications. Portability While Microsoft has never implemented the full framework on any system except Microsoft Windows, it has engineered the framework to be platform-agnostic, and cross-platform implementations are available for other operating systems. Microsoft submitted the specifications for the Common Language Infrastructure (which includes the core class libraries, Common Type System, and the Common Intermediate Language), the C# language, and the C++/CLI language to both ECMA and the ISO, making them available as official standards. This makes it possible for third parties to create compatible implementations of the framework and its languages on other platforms.

3 Chapter1: Visual Basic.NET and the.net Framework The Common Language Runtime The Common Language Runtime (CLR) is the heart of.net. CLR takes your.net application, compiles it into native processor code, and runs it. Any Visual Basic.NET applications, class libraries, and components live in two realities. The design me reality is where you write source code, create classes and objects, design applica ons, debug, and compile your code. The runtime reality is an external environment and for.net managed code applica ons, this environment is the common language run me, be er known as the CLR. It is the runtime and managed execu on environment in which all.net applica ons are allowed to process. Code that targets the CLR is called managed code, indicating that its execution in the runtime environment is managed by the CLR. The CLR is the execution environment provided by the Microsoft.NET Framework. It provides many services such as Automatic garbage collection Code access security Simplified versioning Simple and reliable deployment Deep cross-language interoperability Debugging across different languages Performance Scalability Microsoft Intermediate Language When you compile your Visual Basic.NET source code, it is changed to an intermediate language (IL) that the CLR and all other.net development environments understand. All.NET languages compile code to this IL, which is known as Microsoft Intermediate Language, MSIL, or IL. Figure 1-1 (on the next page) shows what happens to your code from its inception in Visual Studio to execution. Figure 1-1

4 Chapter1: Visual Basic.NET and the.net Framework Framework Class Library (FCL) The Framework Class Libraries (FCL) provides the fundamental building blocks for any application you develop, be it an ASP.Net application, a Windows Forms application, or a Web Service. The FCL generally serves as your main point of interaction with the runtime. FCL classes include System-Includes essential classes and base classes that define commonly used data types, events and event handlers, interfaces, attributes, exceptions, and so on. System.Collections-Includes interfaces and classes that define various collections of objects, including such collections as lists, queues, arrays, hash tables, and dictionaries. System.Data-Includes classes that make up ADO.NET. ADO.NET lets you build data-handling components that manage data from multiple distributed data sources. System.Drawing-Provides access to the GDI+ graphics packages that give you access to drawing methods. System.IO-Includes types that support synchronous and asynchronous reading from and writing to both data streams and files. System.Net-Provides an interface to many of the protocols used on the Internet. System.Threading-Includes classes and interfaces that enable multithreaded programming. System.Web-Includes classes and interfaces that support browser/server communication. Included in this namespace are the HTTPRequest class that provides information about HTTP requests, the HTTPResponse class that manages HTTP output to the client, and the HTTPServerUtility class that provides access to server-side utilities and processes. You can also use cookies, support file transfer, and more with these classes. System.Web.Services-Includes classes that let you build and use Web services, programmable entities on Web Server that code can communicate with using standard Internet protocols. System.Windows.Forms-Includes classes for creating Windows-based forms that make use of the user interface controls and other features available in the Windows operating system. System.Xml-Includes classes that support processing of XML. The Visual Basic Integrated Development Environment Microsoft Visual Studio is an Integrated Development Environment (IDE) provided by Microsoft to create and develop Windows-based, console-based, and mobile based applications for.net Framework. It provides various development tools to design and create the applications without remembering the syntax. Following are the benefits of using Visual Studio: 1. Helps in minimising the development time 2. Simplifies the process of testing applications 3. Provides different toolsets for integrating graphics designers into overall development process 4. Support multiple versions of.net Framework 5. Enhancements in data retrieval and data binding 6. Inspects code to find sections of code that need to be refactored

5 Chapter1: Visual Basic.NET and the.net Framework 7. Provides supports for Web, mobile, client, and Office application development. Features of Visual Studio.Net Auto Hide This is a new feature in Visual Studio that instructs the IDE to "hide away" the windows you are not currently using. This feature provides a lot more elbowroom for code construction and other tasks like debugging. When you need them, they're back in a jiffy. Dockable Windows You can dock all windows in Visual Studio to any edge of the main IDE window. The Auto Hide toggle also serves to lock the window in place so you must first un Auto Hide before you can move the window. Undocking a window is as simple as yanking the window off the side of the IDE. You can also double click the tle bar to dock or undock a window once Auto Hide is off. IntelliSense One useful feature of Visual Studio.net IDE is Microsoft IntelleSense. IntelliSense is what s responsible for those boxes that open as you write you code listing all possible options and even completing your typing for you. Find Results The Find Results windows (primary and secondary ones) display the results for "search and rescue" operations launched from the sophisticated Find and Replace dialog box. Find and Replace is accessed from the Edit, Find and Replace menu option. From here you can search for tokens, symbols, character strings with standard pattern matching, regular expressions, and wildcards. Dynamic Help Dynamic Help is one of the most useful features of this IDE. Simply place your cursor on an element of your code (such as a class name or a method) and Dynamic Help finds and displays a link to the resource in the Visual Studio help system. Event-Driven Programming A Windows program is quite different from yesteryear s MS-DOS program. A DOS program follows a relatively strict path from beginning to end. Although this does not necessarily limit the functionality of the program, it does limit the road the user has to take to get to it. A DOS program is like walking down a hallway; to get to the end you have to walk down the entire hallway, passing any obstacles that you may encounter. A DOS program would only let you open certain doors along your stroll. Windows, on the other hand, opened up the world of event-driven programming. Events in this context include clicking a button, resizing a window, or changing an entry in a text box. The code that you write responds to these events. In terms of the hallway analogy: In a Windows program, to get to the end of the hall you just click the end of the hall. The hallway itself can be ignored. If you

6 Chapter1: Visual Basic.NET and the.net Framework get to the end and realize that is not where you wanted to be, you can just set off for the new destination without returning to your starting point. The program reacts to your movements and takes the necessary actions to complete your desired tasks. Components of Visual Studio IDE Menu System The menu bar of the Visual Studio IDE provides different menus for different menus for different Visual Studio commands. Most of the menus are displayed as Toolbar. Toolbars Toolbars are the shortcuts to the most frequently performed actions. You can find the same commands that of the menus but these are much faster to access than menus. Code Editor The code editor allows you to write and edit code. You can press F7 key to switch from the Window Designer to the Code Editor. Alternatively, you can switch to the Code Editor by selecting View Code. You can use the same type of files, such as text files and XML documents. Using code editor you can set breakpoints for debugging the application, and collapse sections of code to increase readability. Solution Explorer A Solution is defined as a set of projects that are part of the same application in Visual Studio. The Solution Explorer displays each project, each project s references and components. If you wish to activate Solution Explorer in the IDE, click on Views Solution Explorer or press CTRL+ALT+L keys together. The solution explorer gives you a graphical representation of all the files that make up your project. When you double click on any file in you project such as a form within the Solution explorer, it opens the form in Windows Forms Designer. Object Browser The Object Browser is one of the most important windows you will access during the lifetime of a development project. It lets you look at all the classes provided by the.net Framework as well as any custom classes and types you are working on. It identifies the various namespaces and the assemblies within which they are packaged. Further, it reveals the classes and all their respective members, such as methods, properties, and fields. Toolbox The Toolbox contains the components and controls that can be added to Windows Forms applications and Web Forms applications. Class View

7 Chapter1: Visual Basic.NET and the.net Framework The class view contains a hierarchical tree view representation projects at the top-level node and displays the classes, methods and properties associated with a particular project. It helps us to find a member of a class that we want to work with. You can view class view by clicking View Class View or by pressing CTRL+SHIFT+C keys together. Properties Window As the name suggests, the Properties window in Visual Studio is used to set the properties for various objects at design time. You can view and edit the properties of a file, folder, project or solution using the Properties window and can modify properties of the components of projects and solutions. To view the Properties window, click on View Properties window in the menu bar or press F4 key. Server Explorer The Server Explorer window lets you access server side resources, such as databases, email servers, event logs, and message queues. Macro Explorer Macros let you customize the IDE in ways that cater to your programming habits, style, and comfort. Macros and the Macro Editor are new to Visual Studio and give you more control over the IDE than the Tools/Options facility. The entire IDE is customizable through macros. Task List Once you become productive, the Task List will be another indispensable tool. This utility helps you manage tasks within the solution; but most importantly, it displays the compile me errors and their causes. Command Window The Command Window is another imperative feature of the new Visual Studio.NET IDE. The Command Window has two views, Command and Immediate. Command Mode Lets you execute Visual Studio Commands without using the IDE menu system. Immediate Mode Used for debugging, expression evaluation, and variable modification. Output Window The Output Window displays build/compiler or diagnostic information depending on the mode it is in. During a build of a project or solution, the window is used to communicate

8 Chapter1: Visual Basic.NET and the.net Framework build and compile information. In Debug mode, during processing, the Output Window displays libraries loaded, return codes, and various details being emitted from running code. QUESTIONS: 1. What is.net? 2. Define the following terms: MSIL, CLR, and FCL. 3. Explain the.net framework architecture. 4. What are the design features of.net framework? 5. Write down the benefits of using Visual Studio. 6. Explain various features of Visual Studio.net 7. What is event driven programming language? How is it different from traditional programming? 8. Explain in brief different components of Visual Studio IDE 9. Write short notes on : a. CLR b. FCL Practical Assignments 1. Create a visual basic project (i.e., Console Application) by name MyFirstVBApp and then write down the steps to do the above. 2. Write a VB.net program to display a Hello World message and then execute it in VS.NET IDE. 3. Close all the component windows (for ex: Solution Explorer) and then try to get them back.