VB.Net Summary (2)

【Foreword】

  The last blog mentioned that VB.Net is derived from VB to a certain extent, but they also have some differences on the other hand, so today I will talk about the same or different places in several aspects.

【content】

  input Output

~ VB VB.Net
enter Both enter information in the same way
output print statement Removed print statement, but added system console object, built-in object MessageBox.Show()

  Basic language element
  namespace: If you want to use the Console class, you need to explicitly specify the calling namespace.
  Grammar: The data types, variable declarations, and arrays have all changed, which will be discussed in detail later.
  Statement: Corresponding improvements in VB.NET:
    1. GoSub is no longer supported;
    2. Call Function and Sub statements can be used to call procedures;
    3. On…GoSub and On…GoTo statements are no longer supported, and the Select Case statement can be used Instead;
    4.While…Wend statement is changed to While…EndWhile statement, and the Wend keyword is no longer supported;
    5.Set statement is canceled.
  Class:
  VB.NET newly added, Private (limited to inside the class); Public (can be accessed from outside the class); Friend (limited to the application to which the class belongs); Protected (can only be accessed by the class and its derived classes); Protected Friend (can be accessed by class, application, and derived classes); VB.NET supports inheritance.
  Procedures and Functions

~ VB VB.Net
Process Parentheses are not allowed to call a procedure Sub, and parentheses must be added when a Call statement calls a function or Sub Parentheses are required for all method calls; the call statement is optional
function ByVal or ByRef, the default is the latter ByVal or ByRef, the default is the former

  document

~ VB VB.Net
sequential file The user opens the file with Open, writes the file with Write#, Print#, reads the file with Input#, InputLine#, and InputB, judges whether the file is over with EOF, and closes the file with the Close# statement Create an instance of the StreamReader class to open it, call the Read and ReadLine methods of the StreamReader class to read, create an instance of the StramWriter class with the Write and WriteLine methods to create or modify files, and use the Close method of the class instance to close the file
random document The Open statement creates or opens a file, the Put# statement is used to write the file, the Get# statement is used to read the file, the Loc function is used to locate the read and write position, and the Close# statement is used to close the file Use the FileOpen function to open a file, the FileGet and FilePut functions to read and write any records, and the FileClose function must be used to close random files

  database

~ VB VB.Net
database access Via ADO (Active X Data Objects), RDO (Remote Data Objects), DAO (Data Access Objects) Via ADO.NET and ADO (in the form of a COM component, only available by adding a reference)
Data access specific implementation Bind the database to an ADODC control or use the data environment or programmatically create a recordset RecordSet object and exchange data with the recordset object By creating, configuring a data adapter DateAdapter and generating a dataset DataSet or dynamically creating, configuring a data adapter and creating a generated dataset programmatically
data binding This is achieved by setting the properties of DataChanged, DataField, DataFormat, DataMember and DataSource, and binding the display properties of the control to the corresponding fields in the data source You can bind any property of any control to any structure that contains data

【Summarize】

  VB is actually a part of object-oriented, and now VB.Net is actually all object-oriented. This video is a transition material to help us understand object orientation. If there is anything inaccurate, please point it out, if you feel that the summary can still be done, just move your little hand and give a like before leaving...

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324690658&siteId=291194637