VB6.0 "provocation". net!

Source: Internet
Author: User

Come with two years ago contact VB, now learn vb.net, these two look really have to say, this is relative like (PS: a difference, only three letters), and so on. But what difference do they have? All say vb.net advanced, than VB exactly advanced where? is not vb.net can completely replace VB?

This article will show you the outcome of the two-party "war".

1. Background Introduction

VB. NET is a development language that Microsoft launched in 2002 to develop a. NET platform-based application, and is one of the development languages that Microsoft has chosen to develop. NET platform usage programs. Next, let's take a basic look at the main differences between VB.net and its previous version number---VB 6.0.

2. Who is the "antecedents" OOP?

VB and. NET after many rounds of Yue Heyue, found that VB is not completely object-oriented, it does not conform to the three major characteristics of OOP (encapsulation, inheritance, polymorphism) in the inheritance. and VB.net is the Orthodox oop of the novel Blood!

VB this really let active in the VB Field Novice rookie who panicked a ~ ~

When we were using VB6.0. Ability to create new classes, new windows, and treat them as objects. However, inheritance cannot be implemented between classes, so it is only possible to call VB6.0 a visual programming language based on OOP. NET is the biggest difference .

3. See "Gorgeous turn" in the form of appearances

VB is very obvious, we can only see his figure in the Windows application window. And what about vb.net?

Not just windowsform!.

vb.net is also able to create ASP. NET and Web service applications. Also agreed to create a console application and an application to perform as a desktop service .

4. The potential of the data access function to compete

There is also a big gap in the strength of data access, and the main body today is the difference between data access skills, detailed implementation essentials, and data binding at three points .

First of all. On the data access skills . CB6.0 provides access to the database through ADO, and at the same time, to ensure compatibility with earlier version numbers,

RDO (Remote Data Object) and DAO (data Access object) Two kinds of data access skills. in vb.net, ADO is used. NET to access the database,

Ado. NET is part of the. NET Framework. Its corresponding class library is a true subset of the. Net FrameWork SDK.

In fact, vb.net can also use ADO to access

Ask the database. But ADO in vb.net in the form of COM components, by adding a reference talent enough to use in the vb.net.

Join the referenced process,

is actually interoperating with COM components. An interop COM component that is not already a COM component in its previous sense, but instead becomes available for vb.net direct

applies the. NET class library.  
    detailed implementation Essentials . VB 6.0 Implementation of data access is mainly two main points: one is in the program design phase, you can by the data

The source is bound to the ADODC control or to the data environment, and the second is executed to programmatically establish the recordset Recordset object and

Exchange data.

< Span style= "font-family:kaiti_gb2312; font-size:18px ">     the same way to implement data access in vb.net there are two main points: first, in the program design phase . By establishing, configuring the data adapter

(DataAdapter) and a dataset (DataSet), and two in execution. dynamically establish, configure, and build data sets programmatically.

On data binding , VB is implemented by configuring the properties of the control. It is common to bind the display property of a control to the corresponding field in the data source. In. NET, data binding is used in a wide variety of applications. The ability to bind whatever property of any control to whatever structure includes data.

5, Web development see the Truth

VB6.0 is an application built on the Web using ASP (Active Server Page). In ASP, writing a Web page is not a pure VB language. Instead, the VB scripting language---VBScript.

ASP page development is low on tool requirements, but it is process-oriented development, so the complexity of the ASP code is messy, making programming more cumbersome.

Vb. NET is to write Web pages using ASP. However, in ASP. NET, it is no longer the scripting language, but the real meaning of the programming language.

Vb. NET fully supports Web programming. and is based on the new frame structure. It relies on web-based features such as ASP. NET Web applications, XML Web services, and so on. Makes developing Web pages very similar to developing Windows programming, and Web page code seems more organized.   

6. Component Building-How did you get here?

While writing applications using VB and VB.net, you can select components from the Toolbox. But there is a fundamental difference between the two in the realization mechanism. In VB 6.0, the components that are built in the application are all COM components that can be used in COM applications for ActiveX controls, ActiveX-type DLLs, and ActiveX-type EXE.

in vb.net, the components that are dragged into the window are based on inheritance and inherit from the corresponding class in the SDK provided by the. NET Framework. After instantiation, the component is added to the design window by adding a function .

7, single thread? Multithreading!

VB6.0 only supports single threads and does not support multi-threading,. NET fully supports multithreading.

In Terms of concurrency issues and multi-tasking management . VB6.0 supports multiple single-threaded units. It's just that it doesn't support a free-threaded model . and VB. NET has the ability to create free threads by using the CLR.

It creates multithreaded applications directly from the System.Threading class of the system.

8, how to see the exception handling?

With regard to the exception handling of VB, we have used the following methods for example: the use of the on Error Goto statement. That is, jump directly to a command line. Exit Sub, exit the process directly. To avoid entering the wrong program; On Error Resume Next, change the error trap, and so on.

But in vb.net, the error of capturing, processing, and perhaps working (Error-closing) becomes more intact and smoother.

The body is now try ... Catch...... The use of the finally program segment.  

9. "Communication" with other languages

When it comes to this, you have to introduce the MSIL, Microsoft intermediate Language, which is translated into Microsoft intermediate language.

MSIL is to be. NET into an intermediate process of machine language. It is a kind of pseudo-assembly language in high-level languages and Intel-based language assembly . When a user compiles a. NET program, the compiler translates the source code into a set of instructions that are effectively converted to native and CPU-independent. When these instructions are executed, the just -in-time (JIT) compiler translates them into CPU-specific code. Because the common language execution library supports a variety of real-time compilers. So the same piece of MSIL code can be compiled in real time by different compilers and executed on different architectures. This gives the program ape a great deal of flexibility, and the program apes can choose their own familiar language. And no longer have to worry about learning the new language that is constantly being introduced. --Baidu Encyclopedia

the principle of mixed language programming is supported between high-level languages under the. NET Framework: the. NET compiler compiles the source code into MSIL. Instead of machine language, the MSIL language is interpreted in the context of the. NET framework as a machine language to execute.

In short, there is a very big difference between VB and. NET, their relationship is not only the version number of the upgrade, but also vb.net from the OOP mechanism, data processing, concurrency control and other aspects of the idea of the Web page, console program and other forms of updates.

VB6.0 "provocation". net!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.