给blood的礼物《A Programmers Introduction to Visual Bas
2024-07-21 02:25:33
供稿:网友
overview
foreword viii
introduction 1
1 why should you move to visual basic.net? 3
2 your first vb.net application 21
3 major vb.net changes 49
4 building classes and assemblies with vb.net 73
5 inheritance with vb.net 91
6 database access with vb.net and ado.net 105
7 building web applications with vb.net and asp.net 133
8 building web services with vb.net 153
9 building windows services with vb.net 165
10 upgrading vb6 projects to vb.net 175
a the common language specification 187
index 191
contents
introduction 1
1 why should you move to visual basic.net? 3
visual basic.net: a new framework....................................................3
the common language runtime............................................................6
managed execution ................................................................................8
microsoft intermediate language (msil) ........................................8
the just-in-time compiler ................................................................9
executing code ..................................................................................9
assemblies........................................................................................10
the common type system ..................................................................12
classes ..............................................................................................13
interfaces ..........................................................................................13
value types ......................................................................................14
delegates ..........................................................................................14
the .net framework class library ....................................................14
self-describing components ................................................................15
cross-language interoperability ..........................................................16
the catch..........................................................................................17
security ..................................................................................................17
code access security (cas)............................................................18
role-based security ........................................................................18
summary................................................................................................18
2 your first vb.net application 21
the start page........................................................................................21
creating a new project..........................................................................23
examining the ide ..........................................................................25
creating your first vb.net application..............................................31
windows application enhancements ....................................................36
resizing controls automatically......................................................36
anchoring controls to the form edges ..........................................38
easier menus ....................................................................................41
setting tab order ............................................................................42
line and shape controls: you’re outta here ..................................44
form opacity....................................................................................45
summary................................................................................................48
3 major vb.net changes 49
general changes ....................................................................................49
default properties ............................................................................49
subs and functions require parentheses ........................................50
changes to boolean operators ........................................................51
declaration changes ........................................................................52
support for new assignment operators ..........................................52
byval is now the default ................................................................53
block-level scope ..........................................................................53
while...wend becomes while...end while ..................................54
procedure changes ..........................................................................54
array changes ..................................................................................57
option strict ..................................................................................58
data type changes ..........................................................................59
structured error handling ................................................................62
structures replace udts ................................................................64
ide changes ....................................................................................66
new items ..............................................................................................66
constructors and destructors ..........................................................66
namespaces ......................................................................................67
inheritance ........................................................................................69
overloading ......................................................................................69
free threading..................................................................................70
garbage collection ..........................................................................72
summary................................................................................................72
4 building classes and assemblies with vb.net 73
creating your first class library ..........................................................74
adding a “souped-up” class ..........................................................74
creating properties ..........................................................................75
building a test client ......................................................................76
read-only and write-only properties ..............................................79
parameterized properties ..................................................................79
default properties ............................................................................80
constructors in your classes............................................................80
classes without constructors ..........................................................81
adding methods to classes..............................................................82
adding events ..................................................................................82
the “final” code ..................................................................................84
compiling the assembly........................................................................86
reusing the assembly in other applications ..................................87
how .net locates assemblies........................................................88
summary................................................................................................90
5 inheritance with vb.net 91
what is inheritance? ..............................................................................91
interface inheritance in vb6 ............................................................92
vb.net’s implementation inheritance............................................93
a quick inheritance example ..............................................................94
shared members ....................................................................................95
inheritance keywords ............................................................................96
forcing or preventing inheritance ....................................................96
overriding properties and methods ................................................97
polymorphism........................................................................................99
polymorphism with inheritance ....................................................100
polymorphism with interfaces........................................................101
when to use and when not to use inheritance ................................102
summary..............................................................................................103
6 database access with vb.net and ado.net 105
accessing a database from a windows application ..........................106
using the dataadapter configuration wizard ..............................107
ado.net............................................................................................122
about ado.net............................................................................122
datasets ..........................................................................................122
working with the ado.net objects ............................................123
xml integration ..................................................................................128
the xml designer ........................................................................129
summary..............................................................................................131
7 building web applications with vb.net and asp.net 133
your first asp.net application ........................................................134
how asp.net works ..........................................................................137
web pages and code ......................................................................138
server controls ....................................................................................138
validation controls ........................................................................142
data binding ........................................................................................149
handling re-entrant pages ..................................................................151
summary..............................................................................................152
8 building web services with vb.net 153
creating your first web service ........................................................154
testing the web service ................................................................155
creating a web service client ............................................................156
how web services work ....................................................................162
and you thought disco was dead................................................163
accessing web services ................................................................163
summary..............................................................................................164
9 building windows services with vb.net 165
creating your first windows services project....................................166
adding installers to your service ..................................................168
configuring your service ..............................................................169
understanding windows services ......................................................170
service lifetime and events ..........................................................171
debugging your service ................................................................172
summary
10 upgrading vb6 projects to vb.net 175
upgrading your first vb6 application ..............................................175
the visual basic upgrade wizard ................................................176
examining the upgraded forms and code ....................................178
modifications..................................................................................179
differences in form code ..............................................................180
the visual basic compatibility library..............................................181
the upgrade process ..........................................................................182
learn vb.net................................................................................182
pick a small project and make sure that it works ......................182
upgrade the project and examine the upgrade report ................183
fix any outstanding items in vb.net ........................................183
helping your vb6 applications upgrade ..........................................183
do not use late binding ..............................................................183
specify default properties..............................................................184
use zero-bound arrays..................................................................184
examine api calls ........................................................................184
form and control changes ............................................................185
summary..............................................................................................185
a the common language specification 187
what is the common language specification? ..................................187
vb.net data types and the cls ......................................................188