210 likes | 231 Views
Learn the basics of VB.NET programming with this comprehensive lecture. Explore the .NET Framework, compiling programs, developing applications in Visual Studio, and testing procedures. Enhance your skills with hands-on exercises and IL Disassembler.
E N D
Programming with Visual Basic .NET Fundamentals of Programming Lecture # 1 Tariq Ibn Aziz Compunet Corporation
Hardware components Compunet Corporation
Evolution of computer languages Compunet Corporation
Running a program Compunet Corporation
The .NET Framework • An architectural model for creating programs that interface with the operating system and base class libraries Compunet Corporation
The .NET Framework • Contains a hierarchical set of Base Class Libraries Compunet Corporation
The .NET Framework • Base class libraries are code libraries that provide general functions Compunet Corporation
Common Language Runtime • Each .NET language compiles into a common intermediate language and common type system • Assembly contains compiled .NET program • The compiled .NET program contains the intermediate language and metadata • Metadata describes the assembly contents Compunet Corporation
Compiling a program Compunet Corporation
VB.NET Development Environment • Visual Studio.NET 2003 contains what you need to start building and executing VB.NET applications. • Many Project templates are available in Visual Basic Project development environment, some of them are: • Window Application • ASP.NET Application • Smart Device Application • ASP.NET Web Application • Console Application • Windows Services • Its trial version can be installed on machine. Compunet Corporation
Visual Basic • Visual Basic is an Object-Oriented Programming Language • Object contains data, method and constructor Compunet Corporation
Program exist in two forms Source code (text form of program) Object code (executed by the computer) .NET compiler produce an object file that contain intermediate code. Program Forms Compunet Corporation
Namespaces • Organizes base class libraries • Top namespace is System • All Windows Forms inherits the System.Windows.Forms.Form namespace Compunet Corporation
VB.NET Class Libraries • Provides a number of libraries of utility classes and methods • System • System.Console • System.Diagnostics • System.Data • System.Data.sqlClient • System.Web • System.Xml • System.IO.File Compunet Corporation
Program Statements • “A program statement is any combination of Visual Basic keywords, properties, functions, operators, and symbols that (make up) a valid instruction for the Visual Basic compiler. (see p. 127) • For example: End Label1.Text = TimeString • Syntax means the rules used to distinguish valid statements from invalid ones. It’s like grammar in English. If the syntax is not correct, the compiler will give you an error when you build your program. It’s possible to write a statement with good syntax but bad semantics (meaning). This may result in run-time errors. Compunet Corporation
VB.NET Application • Use any text editor to write this VB.NET program, call ILoveVB.vb • VB.NET is not case sensitive, so be sure while writing the filename and class name Public Module Hello Sub Main() System.Console.WriteLine("I Love VB…") End Sub End Module ' Run this at the command line ' vbc ILoveVB.vb Compunet Corporation
VB.NET Application • To compile this program c:\> vbc ILoveVB.vb • To run your program c:\> ILoveVB • You should see the following output I Love VB … Compunet Corporation
Testing • Blackbox testing – testing a program without knowing what’s inside it (it’s a black box). Test plans developed by looking at requirements statement. • Whitebox testing – testing a program with full knowledge of how it works. Test plans developed by looking at the code. Every line of code should work correctly all the time! Compunet Corporation
VB.NET Application(Exercise) • Enter and compile this example on your PC to see whether your Software installation is OK Compunet Corporation
IL Disassembler (ILDASM) • View assembly using ILDASM • Displays intermediate language • Can view information about namespaces, classes, and other programming structures Compunet Corporation
Using the ILDASM Compunet Corporation