Summary-Intro to VB,.NET & Vs

of 10
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report
Category:

Documents

Published:

Views: 53 | Pages: 10

Extension: PDF | Download: 0

Share
Description
Intro to VB, .NET & VS A. Introduction to programming Introduction, features and versions of VB a. Programming is problem solving: It has following four steps: 1. 2. algorithm) Understanding Problem (Problem Identification) Devising a plan to solve that problem (devising, refining and testing the 3. 4. b. i. dependent) Carrying out the plan to solve that problem (translating the code into program using programming language) Evaluating the solution (testing and debugging the program) Hist
Tags
Transcript
  Intro to VB, .NET & VSA.Introduction, features and versions of VBIntroduction to programming a. Programming is problem solving: It has following four steps: 1. Understanding Problem (Problem Identification) 2. Devising a plan to solve that problem (devising, refining and testing thealgorithm) 3. Carrying out the plan to solve that problem (translating the code into programusing programming language) 4. Evaluating the solution (testing and debugging the program) b. History and Generations of PLs: i. Machine Language (binary code for all instructions and data, machinedependent) ii.  Assembly Language (English like abbreviations (mnemonics) insteadof binary instructions, machine dependent, needs assemblers like MASM, TASM, EMU, A56,etc). iii. High Level Language (assembly langs. require lots of instructions for atask, which is done by a single statement in HLLs. machine-independent, needs compiler andinterpreter. Interpreters are popular in program-development environments, so thatdevelopers can change programs frequently as they add new features, see the result andcorrect errors. Once a program is fully developed, a compiled version can be produced sothat the program runs at maximum efficiency.) iv. Very High Level Language (easier but specialized, non-procedural,usually related to manipulation of databases, examples: SQL, LISP (List Programming),ORACLE reports, SPSS, Mathematica, ABAP, etc). v. Natural Language (similar to 4GLs but free from a specific syntax or vocabulary and very close to natural languages, a part of AI, generally related to solve aparticular problem, examples are prolog, mercury). Historical Notes about VB Evolved from BASIC which was developed by Thomas Kurtz and John Kemeny in mid 1960s,become “Visual” in 1991 by Microsoft. Features of VB i.Visual Language ii. Easy Access to Win-32 API (see in separate word file)  iii. Event handling, (u will come to know) iv. Object-oriented programming (u will come to know) v. Exception handling (u will come to know) vi. Visual Basic is the world’s most widely used RAD language. Versions of VB vii. Version 3: Support for Database through DAO. viii. Version 5: Multimedia Support for Web through ActiveX Objects (which are basically scriptsand are based on the specification “Component Object Model”. ix. Version 6.0 (A new chain of technologies was introduced including integration of DAO and ActiveX objects i.e. ADO which supports database access through both desktop and webapplications, while DAO could only support desktop applications and Active Server pagestechnology was also introduced). x. Visual Basic .NET xi. VB 2005 B.Introduction to .Net Framework Introduced in 2000, .NET is a new vision for the development, engineering and use of software. It is basically an API (not win API). CLS is the blueprint (specification) of .NETframework. All .NET applications require .NET framework to be executed. Problems or needs before .NET framework Enhancement and ease of use in library functions.Language interoperability Accessibility of software from almost any type of device. Accessibility from internet. ã  A new program-development process environment i.e. Visual Studio.NET.Security, platform independence and memory management. Features of .NET Framework ã Class Library (BCL & FCL)  .NET framework is in the form of a set of standard class (OOP) libraries (with .dll extension).  It is divided into BCL & FCL. BCL is the core set of classes that serve as the basic APIlikemscorlib.dll and system.dll and system.core.dll. BCL is present in .NET framework and allalternative implementations of .NET framework like Mono and Silverlight.   FCL refers to expanded set of object-oriented libraries including WinForms, ADO.NET, LINQ,Windows Presentation Foundation, etc, is much easier and larger(consisting of more than20000 classes) than Win-API. It exposes everything that Windows do.  Namespaces: It is made up of hierarchy of namespaces, where a namespace is a logicalgroping of FCL. System namespace is at the root of this hierarchy. Other namespaces areSystem.Data and System.Web. A feature that Visual Studio provides is the Object Browser,which lists the Framework Class Library (FCL) classes available in Visual Basic with itsnamespace and assembly names and all its relations with other elements and its members. o  Adding reference of a namespace: If however, you are adding a reference of user-definednamespace or a system namespace (starts with System or Microsoft); add the importstatement in the code in addition of adding reference of the assembly (.dll file). Twonamespaces can contain same class names. In that case fully qualified class names will beused that is class name with namespace name separated by period. In this way the use of namespaces reduce the chance of name collisions. Again default namespaces are alreadyreferenced in the current project like system namespace. Also notice that by default, a VisualBasic .NET project declares a root namespace that has the same name as the project. Youcan change the name of the root namespace in project’s properties. We can also use aliasesinstead of namespace names. The nested namespace is a member of the enclosingnamespace. However, the members of the nested namespace are not members of theenclosing namespace.   Assemblies: FCL is physically arranged in the form of assemblies. There is no one-to-onecorrespondence between assemblies and namespaces. For example, the System.Data.dllassembly actually implements some routines in both the System. Data and System.Xmlnamespaces, while other routines in the System.Xml namespace are implemented in theSystem.Xml.dll assembly. A namespace can be spread across source files and compiled to asingle assembly. o  Assembly is any executable code. It can be a whole program i.e. .exe or part of anexecutable program i.e. .dll file; an executable file that can’t run on its own, it can only runfrom inside an executable file that can run itself (like .exe). Advantages of using .dll instead of .exe are that it doesn’t consume any memory until it is called or used. Secondly, in thisfashion they can be shared with other programs. There are two types of assemblies in .NET:private and shared. Shared assemblies must be loaded in global assembly cache before theycan be used. The .NET System classes are all shared assemblies. o In .NET, the structure of an assembly is divided into these components: its manifest (like itsname), its metadata (like details of the data types), the CIL and its resources (like images), if   any. These contents of an assembly can be viewed through an external Visual Studio toolildasm, which can be added through tools-external menu into VS via C:\ProgramFiles\Microsoft Visual Studio8 \ SDK \V2.0 \Bin path. Different attributes of an assemblycan be set through Assemblyinfo.vb file. o  Adding a reference of an assembly: In VS, you can add a reference of a user-definedclass library i.e. an assembly by adding reference to the .dll file, produced by that classlibrary in the current project’s properties. And the reference of system class library can begiven by import command followed by the namespace in which this class library exists, likethis: import system.drawing. Many essential system class libraries are already referenced bydefault like console class in mscorlib namespace. Writeline is a method of console. o To get an array of Assembly objects representing the assemblies currently loaded into anapplication domain, use the “ AppDomain.GetAssemblies” method in NamespaceSystem.Reflection o Private and Shared Assemblies: Private assemblies must be in the same directory of theapplication, while shared assemblies are stored in a special .NET system directory called theGlobal Assembly Cache (GAC). You can view the contents of your global assembly cache byusing Windows Explorer to navigate to the WINNT\assembly folder Because they are available system-wide, the .NET runtime imposes several extra checks onshared assemblies to ensure that they are valid for the program requesting them, such assecurity and version compatibility. Such an assembly is then called as strong namedassembly. In order to create a shared assembly with a strong name, you must generate apublic/private key pair that is used to sign an assembly. Public/private key cryptographicsystems use a private key known only to the sender of an encoded message, and a publickey published to the world. The .NET Framework provides a tool for generating the strongname called sn.exe (sn stands for Strong Name). Unfortunately, this can only be used fromthe command prompt. The steps are: 1. Set the environment variables by running SDKVars.bat from command prompt which is located in theC:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin directory. 2. Then Use the following command to generate a key, giving a filename (usually with the .snk extension):sn -k superlib.snk 3. This creates the key file superlib.snk in the current directory. To sign the assembly with this key, modify or enter the AssemblyKeyFile attribute in the last part of the AssemblyInfo.vb file for your project:[assembly:AssemblyKeyFile(“C:\ProgramFiles\Microsoft VisualStudio8\SDK\v2.0\Bin\SuperLib.snk”)]4.Now, recompile the superlib.dll assembly.5.Once you have successfully rebuilt the project, the assembly is now signed. If we examine the manifestof the superlib.dll assembly now with ildasm, we see that a public key has been generated andembedded within.
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x