microsoft visual basic 2010 reloaded fourth edition:微软的visual basic 2010加载第四版_第1页
microsoft visual basic 2010 reloaded fourth edition:微软的visual basic 2010加载第四版_第2页
microsoft visual basic 2010 reloaded fourth edition:微软的visual basic 2010加载第四版_第3页
microsoft visual basic 2010 reloaded fourth edition:微软的visual basic 2010加载第四版_第4页
microsoft visual basic 2010 reloaded fourth edition:微软的visual basic 2010加载第四版_第5页
已阅读5页,还剩44页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Microsoft Visual Basic 2010: Reloaded Fourth Edition,Chapter OneAn Introduction to Visual Basic 2010,2,Overview,What Is a Computer?Machine, Assembly and High-Level LanguagesVisual Basic & Other High-Level LanguagesObject TechnologyThe Internet and the World Wide WebIntroduction to Microsoft .NETLanguage and SyntaxVisual Studio 2010 IDESolutions and ProjectsCreating a New ProjectExamples,3,What Is a Computer?,A computer is a device that can perform calculations and make logical decisions much faster than humans can.Computers process data, using sets of instructions called computer programs. These programs guide computers through orderly sets of actions that are specified by people known as computer programmers.,4,What Is a Computer?,A computer is composed of various devicesknown as hardware:keyboardscreenmousehard drivesmemoryDVD drivesprinterprocessing units The programs that run on a computer are referred to as software.,5,Computer Components,Computers can be thought of as being dividedinto six units:Input unit: This “receiving” section of the computer obtains information from input devices.Input can come from devices such as the keyboard and the mouse. Output unit: This “shipping” section of the computer takes information that the computer has processed and places it on various output devices.Output can be displayed on screens, printed on paper, played on audio/video devices, and transmitted over the Internet.,6,Computer Components,Memory unit: This “warehouse” section of the computer stores data while an application is running. Its information is immediately available for processing. To be executed, computer programs must be in memory. The memory unit retains information until it can be sent to output devices. Often, the memory unit is called either memory or primary memory. Random-access memory (RAM) is an example of primary memory. Primary memory is usually volatile, which means that it is erased when the machine is powered off.,7,Computer Components,Central processing unit (CPU): The CPU supervises the operation of the other sections.Arithmetic and logic unit (ALU): The ALU (a part of the CPU) performs calculations and makes decisions.Secondary storage unit: This unit is the “warehousing” section of the computer.Devices such as hard drives, CD-ROM drives, DVD drives, and USB memory sticks are secondary storage units.These normally hold programs or data that other units are not actively being used. The computer can retrieve this information when it is needed later in time. Secondary storage is nonvolatile. Information in secondary storage takes much longer to access than information in primary memory.,8,Machine, Assembly and High-Level Languages,Programmers write instructions in programming languages. Some of these are directlyunderstandable by computers, and others require intermediate translation steps.Computer languages that are in use today can be divided into three general types:machine languagesassembly languageshigh-level languages,9,Machine, Assembly and High-Level Languages,A computer can directly understand only its own machine language.As the “natural language” of a particular computer, machine language is defined by the computers hardware design. Machine languages are machine dependent.Machine languages generally consist of streams of numbers (ultimately reduced to 1s and 0s in the binary number system).,10,Machine, Assembly and High-Level Languages,The following section of a machine-language program demonstrates the incomprehensibility of machine language to humans:+1300042774+1400593419+1200274027Machine-language programming proved to be slow and error prone.,11,Machine, Assembly and High-Level Languages,Programmers began using English-like abbreviations to represent the computers basic operations.These abbreviations formed the basis of assembly languages.LOAD BASEPAYADD OVERPAYSTORE GROSSPAY,12,Machine, Assembly and High-Level Languages,Translator programs called assemblers convert assembly-language programs to machine language.Although it is clearer to humans, computers cannot understand assembly-language code until it is translated into machine language. Assembly languages still require many instructions to accomplish even the simplest tasks.,13,Machine, Assembly and High-Level Languages,To speed up the programming process,high-level languages were developed.Programs called compilers convert high-level-language programs into machine language.High-level languages look almost like everyday English and contain common mathematical notations.grossPay = basePay + overTimePayVisual Basic is one of the worlds most popularhigh-level programming languages.,14,Visual Basic,Visual Basic evolved from BASIC (Beginners All-purpose Symbolic Instruction Code), which was developed as a language for writing simple programs quickly and easily.When Bill Gates founded Microsoft Corporation in the 1970s, he implemented BASIC on several early personal computers.,15,Visual Basic,In the late 1980s and the early 1990s, Microsoft developed the Microsoft Windows graphical user interface (GUI). Visual Basic was introduced by Microsoft in 1991 to make programming Windows applications easier.,16,Visual Basic,Visual Basic is a so-called object-oriented,event-driven visual programming language.Programs are created with the use of a softwaretool called an Integrated Development Environment (IDE). The latest versions of Visual Basic are fully object oriented and respond to user-initiated events such as mouse clicks, keystrokes and timers. In Visual Studio, it is convenient to make programs by dragging and dropping predefined objects like buttons and textboxes.,17,Visual Basic,Microsoft introduced its .NET strategy in 2000.The .NET platform allows applications to be distributed to a variety of devices.Software components created in different .NET programming languages can communicate with one another.,18,Other High-Level Languages,Although hundreds of high-level languages have been developed, only a few have achieved broad acceptance.IBM Corporation developed Fortran in themid-1950s to create scientific and engineering applications.COBOL was developed in the late 1950s by a group of computer manufacturers. COBOL is used primarily for business applications that require the manipulation of large amounts of data.,19,Other High-Level Languages,The C language gained widespread recognition asa development language for the UNIX operating system.C+ was developed by Bjarne Stroustrup in the early 1980s at Bell Laboratories. C+ provides capabilities for object-oriented programming (OOP).Objects are reusable software components thatmodel items in the real world. Object-oriented programs are easier to understand, correct and modify.,20,Other High-Level Languages,Developers use Java to create web pages with dynamic content, to build large-scale enterprise applications, to enhance the functionality of web servers, and to provide applications for consumer devices.In 2000, Microsoft announced C#. The C# programming language was designed specifically for the .NET platform. Like Visual Basic, C# is object oriented and has access to .NETs library.,21,Object Technology,Object technology is a packaging scheme for creating meaningful software units.Almost any noun can be reasonably represented as a software object.Objects:have properties such as color, size and weightperform actions such as moving, sleeping or drawing A class specifies the general format of its objects, and the properties and actions available to an object depend on its class.,22,Object Technology,Procedural programming languages focused on actions (verbs) rather than objects (nouns).Object-oriented languages more naturally reflects the way in which we perceive the world.This has resulted in significant productivity gains.Properly designed classes can be reused on future projects Using libraries of classes reduces the amount of effort required to implement new systemsThe production of software is more understandable because it is better organized and has fewer maintenance requirements.,23,Object Technology,Instead of worrying about the details of how objects are implemented, you can focus on the behaviors and interactions of objects.Visual Basic is one of the worlds most widely used object-oriented languages.,24,The Internet and the World Wide Web,In the late 1960s, ARPA rolled out plans to network the main computer systems of ARPA-funded universities and research institutions.This became known as the ARPAnet, the grandparent of todays Internet.Its main benefit proved to be the capability for quick and easy communication via what came to be known as electronic mail (e-mail).,25,The Internet and the World Wide Web,The protocol for communicating over the ARPAnet became known as the Transmission Control Protocol (TCP).TCP ensured that messages, consisting of pieces called “packets,” were properly routed from sender to receiver, arrived intact and were assembled in the correct order.One challenge was to enable different networks to communicate with each other.ARPA accomplished this by developing the Internet Protocol (IP), which created the current architecture of the Internet.The combined set of protocols is now called TCP/IP.,26,The Internet and the World Wide Web,The World Wide Web is a collection of hardware and software associated with the Internet.In 1989, Tim Berners-Lee of CERN began to develop a technology for sharing information via “hyperlinked” text documents called HyperText Markup Language (HTML).He also wrote communication protocols such as HyperText Transfer Protocol (HTTP).In October 1994, Berners-Lee founded the World Wide Web Consortium, devoted to developing technologies for the World Wide Web.,27,The Internet and the World Wide Web,The Internet and the web will surely be listed among the most important creations of humankind.Todays applications can be written to communicate among the worlds computers. This is the focus of Microsofts .NET strategy.The Internet and the World Wide Web:make information instantly and conveniently accessible,and allow individuals and small businesses to achieve worldwide exposure.,28,Introduction to Microsoft .NET,In June 2000, Microsoft announced its .NET initiative The .NET initiative permits developers to create applications in any .NET-compatible language.Part of the initiative includes Microsofts ASP.NET. The .NET strategy extends the idea of software reuse to the Internet.Visual programming enables .NET programmers to create applications using prepackaged graphical components.,.NET Framework,The Microsoft .NET Framework:executes applications and web servicescontains a class library (Framework Class Library)and provides many other programming capabilities. The .NET framework is a platform with which you can develop software applications and libraries called managed applications; it provides you with the compiler and tools you need to build, debug, and execute managed applications.Prior to this approach, unmanaged applications had to manage their own services which sometimes led to erroneous code, security holes and data corruption.,29,.NET Framework,CLR: Common LanguageWCF: Windows Communication FoundationWPF: Windows Presentation FoundationWF: Windows Workflow FoundationLINQ: Language Integrated QueryCardspace: Manages online identitiesAJAX: Asynchronous JavaScript and XMLREST: Representational State Transfer,30,.NET Framework,31,Spoken Languages and Syntax,Sprechen Sie Englisch?Habla ingles?Voc fala ingls?OO-day ou-yay eak-Spay Eng-hay ish-lay?,32,Examples of Programming Languages,C: fast, efficient code Java: platform independence BASIC: ease of use Visual Basic: user interface design using forms Perl: text manipulation,33,Visual Basic.NET syntax,If x5 ThenMessageBox.Show(I am greater than 5.)Else MessageBox.Show (I am not greater than 5.)End If,34,C# Syntax,if (x5)MessageBox.Show (I am greater than 5.);elseMessageBox.Show (I am not greater than 5.);,35,Learning a Programming Language,SyntaxStructureRulesPunctuationReserved Words (keywords) eg. If, ElseVisual Basic.NET is NOT case sensitive. MyCase is the same as myCase and MYCASE. Comment lines start with an apostrophe (),36,37,Visual Studio 2010 is Microsofts integrated development environment (IDE) for creating, running and debugging applications. The IDE allows you to create applications by dragging and dropping existing building blocks into place.This technique is called visual programming.It is a Rapid Application Development (RAD) tool because it is focused on productivity.,Visual Studio 2010 IDE,Visual Studio 2010 Languages,Visual Basic.NET C# (pronounced C-Sharp) J# (pronounced J-Sharp) C+ (pronounced C plus plus) ASP.NET (web page creation),38,Visual Basic 2010 Express,Visual Basic Express is a compact development environment for creating Visual Basic.NET applications. Can create different types of applicationsWindows Applications (Windows Forms or WPF Application)Console ApplicationsReusable components or class librariesCannot build web sites or web services with the Visual Basic Express Edition.,39,Some Advantages of Visual Basic 2010 Express IDE,Greatly reduces amount of code you must writeAutomatically colors code depending what it isComments are GreenKeywords are BlueOrganizes code in separate filesIntelliSenseCode SnippetsReal-time compiler feedbackBlue squiggle under code indicates an errorGreen squiggle under code indicates a possible error,40,Solutions and Projects,Visual Basic organizes applications into solutions and projects.Solutions contain one or more projects.A project is a group of related files, such as codeand images that might make up a program.,41,Solutions, Projects, and Files,Creating a New Project,Select either File New Project, which creates a new project, or File Open Project, which opens an existing project. From the Start Page, under the Recen

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论