1. Trang chủ
  2. » Khoa Học Tự Nhiên

VBDotNET language in a nutshell

1K 89 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 1.017
Dung lượng 3,33 MB

Nội dung

This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com VB.NET Language in a Nutshell, 2nd Edition By Paul Lomax, Ron Petrusha, Steven Roman, Ph.D of • Table Contents • Index • Reviews • CD-ROM • Reader Reviews • Errata Publisher: O'Reilly Pub Date: May 2002 ISBN: 0-596-00308-0 Pages: 682 Slots: VB.NET Language in a Nutshell begins with a brief overview of the new Visual Basic NET language, covering basic programming concepts and introduces the NET Framework Class Library and programming with attributes The bulk of the book presents an alphabetical reference to Visual Basic NET statements, procedures, functions, and objects Also included is a CD-ROM that allows the reference section of the book to integrate with Visual Studio NET This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com VB.NET Language in a Nutshell, 2nd Edition By Paul Lomax, Ron Petrusha, Steven Roman, Ph.D of • Table Contents • Index • Reviews • CD-ROM • Reader Reviews • Errata Publisher: O'Reilly Pub Date: May 2002 ISBN: 0-596-00308-0 Pages: 682 Slots: Copyright Preface Why Another VB Book? Who This Book Is For How This Book Is Structured Conventions Used in This Book How to Contact Us Acknowledgments Part I: The Basics Chapter Introduction Section 1.1 Why VB.NET? Section 1.2 What Is VB.NET? Section 1.3 What Can You Do with VB.NET? Chapter Program Structure Section 2.1 Getting a VB Program to Run Section 2.2 The Structure of a VB Program Chapter Variables and Data Types Section 3.1 Variables Section 3.2 Declaring Variables and Constants Section 3.3 Data Types Section 3.4 Arrays Section 3.5 Object Variables and Their Binding Section 3.6 The Collection Object Section 3.7 Parameters and Arguments Chapter Introduction to Object-Oriented Programming Section 4.1 Why Learn Object-Oriented Techniques? Section 4.2 Principles of Object-Oriented Programming Section 4.3 Classes and Objects Section 4.4 Inheritance Section 4.5 Interfaces, Abstract Members, and Classes Section 4.6 Polymorphism and Overloading This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Section 4.7 Accessibility in Class Modules Chapter The NET Framework: General Concepts Section 5.1 Namespaces Section 5.2 Common Language Runtime (CLR), Managed Code, and Managed Data Section 5.3 Managed Execution Section 5.4 Assemblies Section 5.5 Assemblies and VB.NET Chapter The NET Framework Class Library Section 6.1 The System Namespace Section 6.2 Other Namespaces Chapter Delegates and Events Section 7.1 Delegates Section 7.2 Events and Event Binding Chapter Attributes Section 8.1 Syntax and Use Section 8.2 Defining a Custom Attribute Section 8.3 Using a Custom Attribute Chapter Error Handling in VB.NET Section 9.1 Error Detection and Error Handling Section 9.2 Runtime Error Handling Section 9.3 Dealing with Logical Errors Section 9.4 Error Constants Part II: Reference Chapter 10 The Language Reference #Const Directive #If Then #Else Directive #Region #End Region Directive Abs Function Acos Function AddHandler Statement AddressOf Operator AppActivate Procedure Application Class Application.CompanyName Property Application.DoEvents Method Application.ExecutablePath Property Application.ProductName Property Application.ProductVersion Property Array Class Array.BinarySearch Method Array.Copy Method Array.IndexOf Method Array.LastIndexOf Method Array.Reverse Method Array.Sort Method Asc, AscW Functions This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com AssemblyVersion Attribute Asin Function Atan Function Atan2 Function AttributeUsage Attribute Beep Procedure Call Statement CallByName Function CBool Function CByte Function CChar Function CDate Function CDbl Function CDec Function Ceiling Function ChDir Procedure ChDrive Procedure Choose Function Chr, ChrW Functions CInt Function Class Statement Clipboard Class Clipboard.GetDataObject Method Clipboard.SetDataObject Method CLng Function CLSCompliant Attribute CObj Function Collection Class Collection.Add Method Collection.Count Property Collection.Item Method Collection.Remove Method ColorDialog Class COMClass Attribute Command Function Const Statement Cos Function Cosh Function CreateObject Function CShort Function CSng Function CStr Function CType Function CurDir Function DateAdd Function DateDiff Function DatePart Function DateSerial Function DateString Property DateValue Function Day Function DDB Function Debug Class This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Debug Class Debug.Assert Method Debug.AutoFlush Property Debug.Close Method Debug.Flush Method Debug.Indent Method Debug.IndentLevel Property Debug.IndentSize Property Debug.Listeners Property Debug.Unindent Method Debug.Write Method Debug.WriteIf Method Debug.WriteLine Method Debug.WriteLineIf Method Declare Statement DefaultMember Attribute Delegate Statement DeleteSetting Procedure Dim Statement Dir Function DirectCast Function Directory Class Directory.CreateDirectory Method Directory.Delete Method Directory.Exists Method Directory.GetCreationTime Method Directory.GetDirectories Method Directory.GetDirectoryRoot Method Directory.GetFiles Method Directory.GetFileSystemEntries Method Directory.GetLogicalDrives Method Directory.GetParent Method Directory.Move Method Do Loop Statement E Field End Statement Enum Statement Environ Function EOF Function Erase Statement Erl Property Err Object Err.Clear Method Err.Description Property Err.GetException Method Err.HelpContext Property Err.HelpFile Property Err.LastDLLError Property Err.Number Property Err.Raise Method Err.Source Property Error Statement ErrorToString Function This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Event Statement Exception Class Exit Statement Exp Function File Class File.Exists Method FileAttr Function FileClose Procedure FileCopy Procedure FileDateTime Function FileGet, FileGetObject Procedures FileLen Function FileOpen Procedure FilePut, FilePutObject Procedures FileWidth Procedure Filter Function Fix Function Flags Attribute Floor Function FontDialog Class For Next Statement For Each Next Statement Format Function FormatCurrency, FormatNumber, FormatPercent Functions FormatDateTime Function FreeFile Function Friend Keyword Function Statement FV Function Get Statement GetAllSettings Function GetAttr Function GetChar Function GetObject Function GetSetting Function GetTimer Function GetType Operator GoTo Statement Guid Attribute Handles Keyword Hashtable Class Hashtable.Add Method Hashtable.Clear Method Hashtable.ContainsKey Method Hashtable.ContainsValue Method Hashtable.CopyTo Method Hashtable.Count Property Hashtable.Item Property Hashtable.Keys Property Hashtable.Remove Method Hashtable.Values Property Hex Function Hour Function This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Hour Function IDataObject Interface IDataObject.GetData Method IDataObject.GetDataPresent Method IDataObject.GetFormats Method IEEERemainder Function If Then Else Statement IIf Function Implements Keyword Implements Statement Imports Statement Inherits Statement Input Procedure InputBox Function InputString Function InStr Function InStrRev Function Int Function Interface Statement IPmt Function IRR Function Is Operator IsArray Function IsDate Function IsDBNull Function IsError Function IsNothing Function IsNumeric Function IsReference Function Join Function Kill Procedure LBound Function LCase Function Left Function Len Function Like Operator LineInput Function Loc Function Lock Procedure LOF Function Log Function Log10 Function LSet Function LTrim Function MarshalAs Attribute Max Function Me Operator Mid Function Mid Statement Min Function Minute Function MIRR Function MkDir Procedure This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Mod Operator Module End Module Statement Month Function MonthName Function MsgBox Function MTAThread Attribute MyBase Keyword MyClass Keyword Namespace Statement Now Property NPer Function NPV Function Obsolete Attribute Oct Function On Error Statement OpenFileDialog Class Option Compare Statement Option Explicit Statement Option Strict Statement Out Attribute ParamArray Attribute Partition Function Pi Field Pmt Function Pow Function PPmt Function Print, PrintLine Procedures Private Statement Property Statement Protected Keyword Public Statement PV Function QBColor Function Queue Class Queue.Clear Method Queue.Contains Method Queue.CopyTo Method Queue.Count Property Queue.Dequeue Method Queue.Enqueue Method Queue.Peek Method Queue.ToArray Method RaiseEvent Statement Randomize Procedure Rate Function ReDim Statement Rem Statement RemoveHandler Statement Rename Procedure Replace Function Reset Procedure Resume Statement Return Statement This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Return Statement RGB Function Right Function RmDir Procedure Rnd Function Round Function RSet Function RTrim Function SaveFileDialog Class SaveSetting Procedure ScriptEngine Property ScriptEngineBuildVersion Property ScriptEngineMajorVersion Property ScriptEngineMinorVersion Property Second Function Seek Function Seek Procedure Select Case Statement Send, SendWait Methods Set Statement SetAttr Procedure Shadows Keyword Shell Function Sign Function Sin Function Sinh Function SLN Function Space Function Spc Function Split Function Sqrt Function Stack Class Stack.Clear Method Stack.Contains Method Stack.CopyTo Method Stack.Count Property Stack.Peek Method Stack.Pop Method Stack.Push Method Stack.ToArray Method STAThread Attribute Static Statement Stop Statement Str Function StrComp Function StrConv Function StrDup Function StrReverse Function Structure End Structure Statement Sub Statement Switch Function SYD Function SyncLock Statement This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com SystemTypeName Function Tab Function Tan Function Tanh Function ThreadStatic Attribute Throw Statement TimeOfDay Property Timer Property TimeSerial Function TimeString Property TimeValue Function Today Property Trim Function Try Catch Finally Statement TypeName Function UBound Function UCase Function Unlock Procedure Val Function ValDec Function VarType Function VBFixedArray Attribute VBFixedString Attribute VbTypeName Function WebMethod Attribute WebService Attribute Weekday Function WeekdayName Function While End While Statement With Statement WithEvents Keyword Write Procedure WriteLine Procedure Year Function Part III: Appendixes Appendix A What's New and Different in VB.NET Section A.1 Language Changes for VB.NET Section A.2 Changes to Programming Elements Section A.3 Obsolete Programming Elements Section A.4 Structured Exception Handling Section A.5 Changes in Object-Orientation Appendix B Language Elements by Category Section B.1 Array Handling Section B.2 Clipboard Section B.3 Collection Objects Section B.4 Common Dialogs Section B.5 Conditional Compilation Section B.6 Conversion Section B.7 Date and Time Section B.8 Debugging This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com attributes and declaring for classes 2nd implementing passing to procedures setting/retrieving values VB vs VB.NET Property Get procedure defining property members in class modules property procedures 2nd Property Set procedure defining Property statement 2nd 3rd Property End Property statement Protected Friend keyword class modules and declaring variables and constants Protected keyword 2nd accessibility rules for class modules and declaring variables and constants public interfaces of VB.NET classes encapsulation and Public statement 2nd 3rd accessibility rules for class modules and declaring variables and constants Push method (Stack class) 2nd PV function 2nd This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] QBColor function 2nd question mark (?) in regular expressions Queue class Queue.Clear method 2nd Queue.Contains method 2nd Queue.CopyTo method 2nd Queue.Count property 2nd Queue.Dequeue method 2nd Queue.Enqueue method 2nd Queue.Peek method 2nd Queue.ToArray method 2nd /quiet command-line switch This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] r-value of variables R4 (UnmanagedType enumeration) R8 (UnmanagedType enumeration) Raise method (Err object) 2nd 3rd error constants and RaiseEvent statement 2nd random numbers, returning Randomize procedure (Math class) 2nd 3rd Rate function 2nd ReadOnly keyword and Property statement ReadOnlyChecked property (OpenFileDialog class) /recurse\: command-line switch ReDim statement 2nd 3rd 4th /reference\: command-line switch 2nd reference-tracing garbage collection reference-type variables comparing IsReference function and 2nd vs value-type variables reflection and attributes 2nd regenerating errors Regex class #Region #End Region directive 2nd registry [See Windows registry] regular expressions, providing access to Rem statement 2nd Remove method Collection class 2nd 3rd Hashtable class 2nd String class RemoveHandler statement 2nd 3rd /removeintchecks command-line switch Rename procedure 2nd Replace function (String class) 2nd Replace method (String class) reporting bugs Reset method (ColorDialog class) Reset procedure 2nd /resource\: command-line switch resources, releasing response files RestoreDirectory property OpenFileDialog class SaveFileDialog class Resume statement 2nd Return statement 2nd 3rd Reverse method (Array class) 2nd RGB function 2nd 3rd QBColor function and Right function (String class) 2nd RmDir procedure 2nd Rnd function (Math class) 2nd 3rd /rootnamespace\: command-line switch Round function (Math class) 2nd 3rd RSet function (String class) This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com RTrim function (String class) 2nd runtime errors detecting vs logical errors This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] SafeArray (UnmanagedType enumeration) SaveFileDialog class 2nd SaveSetting procedure 2nd Scale method (not supported in VB.NET) scope in class modules shadowing by of variables/constants 2nd ScriptEngine function ScriptEngine property ScriptEngineBuildVersion function ScriptEngineBuildVersion property ScriptEngineMajorVersion function ScriptEngineMajorVersion property ScriptEngineMinorVersion function ScriptEngineMinorVersion property Second function 2nd Seek function 2nd Seek procedure 2nd Select Case statement 2nd Send/SendWait methods 2nd session-level events (ASP.NET) Set statement set_Name method SetAttr procedure 2nd SetDataObject method (Clipboard class) 2nd Sgn function [See Sign function] shadowing by scope shadowing element types Shadows keyword 2nd 3rd Class statement and Property statement and Public statement and Sub statement and Shared keyword Main method and Property statement and Sub statement and shared members Shell function 2nd Short data type 2nd changes in VB.NET converting values to short-circuiting evaluating If statements 2nd 3rd logical expressions and Show properties (FontDialog class) ShowDialog method OpenFileDialog class SaveFileDialog class Sign function (Math class) 2nd 3rd signatures, function signed integers and encapsulation Sin function (Math class) 2nd 3rd Single data type 2nd This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com converting values to single-threaded apartments, creating Sinh function (Math class) 2nd 3rd SLN function 2nd SolidColorOnly property (ColorDialog class) Sort method (Array class) 2nd sort order and Like operator Source property Err object 2nd 3rd Exception class 2nd Space function (String class) 2nd Spc function 2nd 3rd Split function (String class) 2nd 3rd Split method (String class) SqlClient namespace Sqrt function (Math class) 2nd 3rd Stack class Stack.Clear method 2nd Stack.Contains method 2nd Stack.CopyTo method 2nd Stack.Count property 2nd Stack.Peek method 2nd Stack.Pop method 2nd Stack.Push method 2nd Stack.ToArray method 2nd StackTrace property (Exception class) 2nd StartsWith method (String class) STAThread attribute static fields, not sharing values across threads static members Static statement 2nd static subroutines static variables declaring and initializing initializing Stop statement 2nd Str function 2nd 3rd straight-line depreciation of assets, computing 2nd StrComp function (String class) 2nd StrConv function (String class) 2nd StrDup function (String class) 2nd String class String data type 2nd 3rd converting values to strings concatenation operators Filter function and fixed-length, defining functions for manipulating left aligning members of String class right aligning VB vs VB.NET strong-name key containers, specifying StrReverse function (String class) 2nd Struct (UnmanagedType enumeration) Structure data type 2nd Structure End Structure statement 2nd VB vs VB.NET This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com structured error handling 2nd Sub procedures calling Sub statement 2nd Substring method (String class) subtraction assignment operator (-=) subtraction operator (-) sum-of-years' digits depreciation of assets, computing 2nd 3rd Switch function 2nd switches, command-line SYD function 2nd 3rd symbolic constants (VB) 2nd 3rd SyncLock statement 2nd SysInt (UnmanagedType enumeration) System namespace 2nd assemblies and Exception class System.Attribute namespace System.CodeDOM namespace System.Collections namespace 2nd System.ComponentModel namespace System.Configuration namespace System.Data namespace 2nd 3rd System.Diagnostics namespace System.DirectoryServices namespace System.Drawing namespace System.IO namespace System.Net namespace System.Reflection namespace 2nd System.Resources namespace System.Security namespace System.ServiceProcess namespace System.Text namespace System.Text.RegularExpressions namespace 2nd System.Threading namespace System.Timers namespace System.Web namespace System.Web.UI namespace System.Windows.Forms namespace 2nd 3rd System.Xml namespace SystemTypeName function 2nd SysUInt (UnmanagedType enumeration) This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] Tab function 2nd Tan function (Math class) 2nd 3rd Tanh function (Math class) 2nd 3rd /target\: command-line switch TargetSite property (Exception class) 2nd task ID, returning TBStr (UnmanagedType enumeration) Terminate event (not supported in VB.NET) 2nd text comparison 2nd Like operator and threads of execution, controlling ThreadStatic attribute Throw statement TimeOfDay property 2nd Timer property 2nd TimeSerial function 2nd timestamps, generating TimeString property 2nd TimeValue function 2nd 3rd ToArray method Queue class 2nd Stack class 2nd ToBoolean method ToByte method ToChar method ToCharArray method (String class) ToDateTime method Today property 2nd ToDecimal method ToDouble method ToInt16 method ToInt32 method ToInt64 method ToLower method (String class) ToSByte method ToSingle method ToString method Convert class Exception class 2nd Type class ToUInt16 method ToUInt32 method ToUInt64 method ToUpper method (String class) TransactionOption property (WebMethod attribute) TreeViewCancelEventArgs class Trim function (String class) 2nd Trim method (String class) TrimEnd method (String class) TrimStart method (String class) TriState enumeration True keyword Try Catch Finally statement 2nd 3rd two's-complement representation two-dimensional arrays This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com Type class iterating objects in reflection classes and type members in class modules type system, common [See Common Type System] type-safe code Type End Type construct [See Structure End Structure statement] Type.GetType method TypeName function 2nd This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] U1 (UnmanagedType enumeration) U2 (UnmanagedType enumeration) U4 (UnmanagedType enumeration) U8 (UnmanagedType enumeration) UBound function 2nd 3rd UCase function (String class) 2nd underscore (_) VB.NET line continuation character Unindent method (Debug class) 2nd universal data types Unlock procedure Lock procedure and unsigned integer data types Convert class methods and TypeName function and unstructured error handling uppercase, converting strings to user-defined types 2nd declaring 2nd /utf8output command-line switch This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] Val function 2nd 3rd ValDec function 2nd value-type vs reference-type variables Values property (Hashtable class) 2nd VarEnum enumeration, members of variables declaring command-line switches and Option Explicit statement and VB.NET changes to FileGet/FileGetObject procedures FilePut/FilePutObject procedures lifetime of object [See object variables] private properties of public scope of 2nd changes for VB.NET shadowing by scope static 2nd value-type vs reference-type Variant data type (not supported in VB.NET) 2nd VariantBool (UnmanagedType enumeration) VariantType enumeration 2nd VarType function 2nd 3rd 4th VB IDE and control-related events VB.NET arrays in assemblies command-line compiler common type system [See Common Type System] data types [See data types] error handling in introduction to language changes for language reference NET Framework object-oriented programming changes to procedures, changes to program structure programming elements changes to obsolete variables in VB language elements not supported by VBByRefStr (UnmanagedType enumeration) vbc.exe VBFixedArray attribute 2nd VBFixedString attribute 2nd 3rd vbObjectError constant VbStrConv enumeration 2nd VbTypeName function 2nd /verbose command-line switch This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com versioning properties of assemblies Visual Basic built-in constants enumerations vs VB.NET This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] \\\\w and \\\\W in regular expressions /warnaserror command-line switch WebMethod attribute 2nd WebService attribute Weekday function 2nd WeekdayName function 2nd Wend keyword (not supported in VB.NET) 2nd When filter, used with user-defined errors While End While statement 2nd 3rd widening casts 2nd /win32icon\: command-line switch /win32resource\: command-line switch Windows applications, creating Windows Forms applications events Windows registry creating entries for VB applications in functions for manipulating GetAllSettings function and GetSetting function and windows, activating With statement WithEvents keyword 2nd Private statement and Public statement and WithEvents statement Write method (Debug class) 2nd Write procedure WriteIf method (Debug class) 2nd WriteLine method (Debug class) 2nd WriteLine procedure WriteLineIf method (Debug class) 2nd WriteOnly keyword and Property statement This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] Xor logical operator This document is created with a trial version of CHM2PDF Pilot http://www.colorpilot.com [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] Year function 2nd ... Preface Microsoft Visual Basic began its life just eleven years ago as a kind of amalgamation of Microsoft's QBasic programming language and a graphical interface design program developed in part... LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { static char szAppName[] = "SayHello" ;... that assumed the presence of the Internet marked another change in programming paradigms Yet Visual Basic's real strength remained as it always had been: a great platform for developing standalone

Ngày đăng: 25/03/2019, 15:41