ASP.NET programming language
The language supported by ASP.NET, including VB.NET, C # .NET, JScript.net, VC . Net, and other .NET Framework supported by languages. Here I introduce you the most common VB.NET and C # .NET.
Visual Basic.Net
Visual Basic.net is the latest version of Visual Basic in .NET. It compares to VB 6, adds many new or improved features - for example: inheritance, interface, overloading. These make it a powerful object-oriented language.
The largest new feature of Visual Basic.Net is whose CLS (Common Language Specification, Public Language Specifications) and CLR (Common Language Runtime). Because Visual Basic.net follows CLS, this allows any language that follows CLS to use the classes, objects, and components you have written with Visual Basic.net. Similarly, Visual Basic.NET developers can also freely use other classes, objects, and components written in language compliance with CLS, without having to worry about the differences between languages.
Visual Basic.NET supports many new object-oriented properties such as inheritance, overload, interfaces, structures, and the like. Also included with abnormal processing, representative, and some new data types.
1) Inheritability
Visual Basic.net allows you to define base classes, derived classes to inherit the properties and methods of the base class. You can also use a method of derived class to cover the base class. All classes in VB.NET are inherited by default. If you can inherit the class in an existing form in a form, because the form you design is a class.
2) Abnormal treatment
VB.NET supports structured exception handling, you can use the following code to capture exceptions:
Try '"Try" block Catch e as classloadexception' "catch" block finally '"finally" block end TRY
Put your code in the TRY block. When an exception occurs, the program will automatically jump to the Catch block, here, we can output an error message, or give the user a friendly tip without causing the program to crash. In the Finally section, we can use some system resources such as database linkages.
3) Overloading Use the overload You can allow methods, attributes, or processes that allow different data types to use the same name. As shown in the following code: Overloads Sub Display (ByVal theChar As Char) 'Add code that displays Char data End Sub Overloads Sub Display (ByVal theInteger As Integer).' Add code that displays Integer data End Sub Overloads Sub Display (ByVal theDouble. As Double) 'Add Code That Displays Double Data. End Sub
When different parameters are passed to the Display method, it runs different processes. This is very useful when we use different data types.
4) Interface
The interfaces and classes will define methods and properties, but the class is different, the interface does not provide the implementation of the method. You can write the implementation in the class of inherited interfaces.