Microsoft .NET Developer Tools Readiness Kit - PowerPoint PPT Presentation

1 / 46
About This Presentation
Title:

Microsoft .NET Developer Tools Readiness Kit

Description:

Microsoft .NET Developer Tools Readiness Kit Module 'ASP.NET' By Joerg M. Freiberger Final touchup by Udo Riedel – PowerPoint PPT presentation

Number of Views:90
Avg rating:3.0/5.0
Slides: 47
Provided by: Joerg2
Category:

less

Transcript and Presenter's Notes

Title: Microsoft .NET Developer Tools Readiness Kit


1
VB.NET
The most powerful language for developer
2
??Visual Basic ???Visual Basic. NET
??????? ?????? .NET?? ??/????
3
????
?? ???? ??? ????
?????? ?? ?????????
?????? ?? ?????? ?? ??
?????????????????? ???????????????? ?? MCSD?
MCSE? MCDBA? MCPS? Visual Studio.net
?????--???? ?????????--????? ????/?? ?????? ?
?????? justin_at_sourcecode.com.tw.
4
????
  • VB6 ?VB.NET?????
  • VB.NET????????
  • ????? VB 6 ????

5
VB6 v.s VB.NET
  • ????
  • ????
  • ??????
  • ????
  • ????

6
????
  • Common Type System
  • VB.NET ?????????
  • VB.NET ?VB6 ???????
  • ??Ctype ?????????

7
Common Type System 1/2
  • ??.NET?????????
  • ??????(Type-Safety)
  • ???System.Object Class
  • (.NET Framework Class Library)
  • ???? vs. ????
  • (Value-Type vs. Reference-Type Variables)

8
Common Type System 2/2
9
VB.NET ??????
10
VB.NET?VB6???????
11
??????
  • VB6?????????
  • CInt()? CStr()?
  • ????Ctype() ????
  • ??Ctype(expression, type_name)
  • ???????????
  • si.toString
  • iInteger.Parse(s)

12
????--??
  • VB 6
  • Dim i as integer,s as string
  • i10
  • sCstr(i)
  • VB.NET
  • Dim i as integer, s as string
  • i10
  • sCstr(i) VB6???????
  • sCtype(i,string) CType?????
  • si.ToString ???????
  • iInteger.Parse(s) ?????

13
????
  • ????????(???)
  • ????
  • ?? Data Structures
  • ??????
  • ??Shorthand ???????

14
????????
  • ??????????
  • Dim x as integer 10
  • ??????
  • Dim x , y, z as integer

15
????
  • ?????? 0
  • ???? lower bound To upper bound??
  • Redim??

16
????--?? 1/2
  • VB 6
  • Dim month(1 to 6) as Integer
  • VB.NET
  • Dim month(5) As Integer 0,1,2,3,4,5 ?6???
  • Length6
  • Upper Bound5
  • Dim month() As Integer 1, 2, 3, 4, 5, 6

17
  • ????(Redim) --?? 2/2
  • VB6

Dim x () as string ?vb6 ???Redim?? ReDim x(5)as
string
Dim y (2) as string ?vb6 ???Redim?? ReDim y(5)
as string
  • VB.net

Dim x () as string ?vb.net???Redim?? ReDim
x(5)as string
Dim y (2) as string ?vb.net ???Redim?? ReDim
Preserve y(5) as string
18
????
  • Procedure Scope
  • --?????????????
  • Block Scope
  • --???If Else End If, For Next, Do Loop,
    While End While, Select Case End Select

19
????--??
  • Sub AddTen()
  • Dim I as integer Procedure Scope
  • ????????????
  • Msgbox(i.ToString) ??,????????
  • Msgbox(x.ToString) ??, ????????
  • End Sub

For i 0 to 10 dim x as integer Block
Scope x i Next
20
?? Data Structures
  • Data Structures ??VB6????????(UDT)??

21
Data Structure--??
  • VB 6.0
  • Private Type myCustomer
  • Name As String
  • Address As String
  • Age As Integer
  • End Type
  • VB .NET
  • Structure myCustomer
  • Dim Name As String
  • Dim Address As String
  • Dim Age As Integer
  • End Structure

22
??????
  • Option Explicit
  • (default on ??????????)
  • Option Strict
  • On?????????????
  • Off?????????????
  • Default Strict off

23
Option Strict??
  • VB.NET
  • Option Strict on ?????????????
  • ?
  • Dim x as object
  • X1234
  • Msgbox(x.chars(3) ) ??,string???chars?????
  • run-time????,?Strict on??
  • ??????? Late binding.

24
??Shorthand ???????
  • ?????????
  • /
  • -

25
??Shorthand ---??
Dim z as integer 0 Dim s as string First z
1 z z1 s Second s s Second
26
??????
  • ???????????????()????????
  • ????????(byVal)?
  • ????(Optional)??????
  • ??return ??Function ????

27
Option Parameter??
  • VB 6.0
  • Function add(Optional ByVal X as integer)As
    Integer
  • If IsMissing(X) Then
  • End Sub
  • VB .NET
  • Function add(Optional ByVal X As Integer 0)
    As Integer
  • End Function

28
Return???---??
  • VB6
  • Function getData () as string
  • ?
  • getDataResult Data
  • End Function
  • VB.NET
  • Function getData () as string
  • ?
  • getDataResult Data
  • ???
  • Return Result Data
  • End Function

29
??????(ParamArrays)
  • VB .NET ?? ParamArrays ??
  • ?? ByVal ??( VB 6.0 ? ByRef )
  • ???????( VB 6.0 ? Variant )
  • ???? Optional ??

30
????---??
  • Sub Test(ByVal ParamArray X( ) As Object)
  • Dim I As Integer
  • For I X.GetLowerBound(0) To X.GetUpperBound(0)
  • MsgBox(X(I))
  • Next
  • End Sub

31
????(?)
  • ??????????
  • ?? TryCatch ??????
  • System.Exception Class
  • ??????????? (exMessage,Source)
  • Throw ??

32
????---?? 2/2
  • Try...Catch
  • Dim i1, i2, i3 As Decimal
  • i1 22
  • i2 0
  • Try
  • i3 i1 / i2
  • MsgBox(i3.ToString)
  • Catch eExcption As Exception
  • MsgBox(eExecption.Message)
  • Finally
  • MsgBox("the end")
  • End Try

33
?????? 2/2
  • Throw ??
  • ?
  • Try
  • If i2 0 Then
  • Throw New Exception("i2 equals zero")
  • Else
  • Throw New Exception("i2 does not equal
    zero")
  • End If
  • Catch eException As Exception
  • MsgBox("Message "
    eException.Message)
  • Finally
  • MsgBox("finally block")
  • End Try

34
????
  • ??????
  • VB 6.0
  • Set objX TextBox1
  • VB .NET
  • objX TextBox1
  • ?????????????????
  • VB 6.0
  • TextBox1 1234
  • VB .NET
  • TextBox1.Text 1234

35
Visual Basic.NET ???
  • ?????????
  • ???Object-Oriented Programming?
  • ???Structured exception handling?
  • ?.NET Framework ????
  • ??Multithreaded
  • Garbage Collection
  • ??Web ????????
  • Web Forms
  • Web Services

36
????
  • ?????????????
  • ??????????????
  • ?????????????????
  • ??????????????????

37
????
38
Multithread
  • .NET Framework ????????
  • System.Threading.Thread
  • ??Start??????Thread??
  • ??Abort??????Thread??
  • ??Priority????Thread????

39
Multithreaded
40
????? VB 6 ???? 1/3
  • ??????
  • ?VB1 ?VB5????????VB.NET
  • -??????VB6?????
  • ?ADO??RDO?DAO??????
  • -ADO.NET???RDO?DAO?data binding to controls,data
    controls,???RDO ?User Connection

NotesDHTML?ActiveX Document?VB6?????????VB.NET(??
???)???,????????Distributed Transactions?
COM/COM ????????????Web Service ????(.NET
middle-tier Component)
41
????? VB 6 ???? 2/3
  • ???VB6???????????
  • ???Early-Binding??Late-Binding
  • ??????????date??????
  • -????Double????VB.NET???Date/Double?????????????
    ??
  • ?????????????????
  • -?????????late-binding?????VB.NET?????
  • ???????? ??/?? ??
  • -Dim x (1 to 6) as integer
  • (??? Dim x(6) as integer)
  • -????Option Base 1???????

42
????? VB 6 ???? 3/3
  • ??????
  • ??????VB.NET??
  • -???VB6??????
  • ?VB6?????????????.NET ??
  • -VB6 Forms ????Windows Forms
  • ????????????
  • -???????????????????

43
??????
44
??
  • ??VB.NET??????
  • Object Oriented Programming
  • ????.NET Framework
  • ??Base Class library
  • ????VB6??????
  • ??????

45
????
  • MSDN(????)
  • htt//msdn.microsoft.com
  • http//msdn.microsoft.com/net
  • MSDN(??????????????)
  • http//www.microsoft.com/taiwan/msdn/community

46
Question
Write a Comment
User Comments (0)
About PowerShow.com