?3? VB.NET???ASP.NET?? - PowerPoint PPT Presentation

1 / 60
About This Presentation
Title:

?3? VB.NET???ASP.NET??

Description:

3 vb.net asp.net 3-1 vb.net 3-2 asp.net 3-3 vb.net 3-4 vb.net – PowerPoint PPT presentation

Number of Views:81
Avg rating:3.0/5.0
Slides: 61
Provided by: JoeC72
Category:
Tags: asp | net | font | size | unicode

less

Transcript and Presenter's Notes

Title: ?3? VB.NET???ASP.NET??


1
?3? VB.NET???ASP.NET??
  • 3-1 VB.NET???
  • 3-2 ASP.NET???????
  • 3-3 VB.NET????????
  • 3-4 VB.NET????
  • 3-5 VB.NET?????
  • 3-6 VB.NET?????
  • 3-7 VB.NET??????
  • 3-8 VB.NET?????

2
3-1 VB.NET???
  • 3-1-1 ???????
  • 3-1-2 ???Basic??

3
3-1-1 ???????
  • VB.NET?????.NET Framework??????????
  • ASP.NET?????VB.NET????.NET Framework???,??????????
    ?????,???????VB.NET??ASP.NET???

4
3-1-1 ???????-??
  • ??(Objects)??????????,?????????(Data)?????????(???
    ?)?????
  • ??(Class)???????,????????,???????,??????????????,?
    ????????????????,??????????
  • ??ASP.NET????.NET Framework?????,??HTTP???Respons
    e?Server?Request?Session?Application????

5
3-1-1 ???????-??
  • ??(Properties)?????????,??Response???ContentType?
    ?,String???length??????????

6
3-1-1 ???????-??
  • ??(Methods)????????,??Response?????????,????
  • Response.Write()
  • Response.Redirect()

7
3-1-1 ???????-??
  • ??(Events)?????????,??Page???Load??,?????????????
    ?,????
  • Sub Page_Load(sender As Object, e As Eventargs)
  • .
  • End Sub

8
3-1-1 ???????-????
  • ????(Collections)????????????
  • ??Response???????Cookies(??????????????),????
  • Response.Cookies("name").Value
  • ????????????name?Cookie??,????Value??????,Applicat
    ion?Session???????????

9
3-1-2 ???Basic??
  • ??Basic????
  • Visual Basic 6?VB.NET
  • Office????VBA
  • ???VBScript
  • ???VBScript???ASP
  • VB.NET???ASP.NET

10
3-2 ASP.NET???????
  • 3-2-1 ??ASP.NET??
  • 3-2-2 ??ASP.NET??
  • 3-2-3 ??ASP.NET??
  • 3-2-4 VB.NET?????
  • ????

11
3-2-1 ??ASP.NET??-1
  • ASP.NET?????HTML???,?????????lt???gt??????,????
  • ltgt
  • ???HTML????????????,????????ASP.NET??,????.aspx,??
    ??ASP.NET?Web????????????,?????????????

12
3-2-1 ??ASP.NET??-2
  • 01 lt_at_ Page Language"VB" gt
  • 02 lthtmlgt
  • 03 ltheadgt
  • 04 lttitlegtCh3-2-1.aspxlt/titlegt
  • 05 lt/headgt
  • 06 ltbodygt
  • 07 lt ' ????
  • 08 Dim fontSize1,fontSize2, i As Integer
  • 09 fontSize1 3
  • 10 fontSize2 5
  • 11 ' ??????????
  • 12 For i fontSize1 To fontSize2 gt
  • 13 ltfont sizeltigtgt
  • 14 ltpgt???ASP.NET??lt/pgt
  • 15 lt Next
  • 16 Response.Write("???!")
  • 17 gt
  • 18 lt/bodygt
  • 19 lt/htmlgt

13
3-2-2 ??ASP.NET??
  • ASP.NET?????ASP??,????Web????????ASP?ASP.NET??,???
    ?
  • ASP.NET????.aspx?
  • ASP?????.asp?
  • Windows???????????????,??????????.txt??????
  • ????????????????,?????????????,?????,???ASP.NET???
    ???

14
3-2-3 ??ASP.NET??
  • ASP.NET?????????,????????????Web???????,?Windows
    XP Professional????IIS?
  • ???Web??????
  • ???Web??????
  • ??????Web??

15
3-2-4 VB.NET?????????-??
  • VB.NET?????,????
  • ????VB.NET????????????
  • ???????????_???,???????,??????????????
  • ????????16383???,????????,abc?ABC????????
  • ??????????.????,??????????????
  • ?????????????

16
3-2-4 VB.NET?????????-??
  • ????????????????,??????????????????,??????????????
    ?
  • VB.NET???????REM????'???????,?????????????,????
  • REM ?????
  • ' ???
  • Dim size1,size2 As Integer ' ?????

17
3-2-4 VB.NET?????????-?????
  • ??VB.NET??????,?????????,??????,????????????????_?
    ??,????
  • Dim size1,size2,size3,size4,size5 _
  • ,size6,size7,size8,size9 As Integer

18
3-2-4 VB.NET?????????-?????
  • ?????????????????????,?????????????,?????

19
3-2-4 VB.NET?????????-??????????
  • ???????????,??????????????????,???????????????,??
    ??
  • For i 1 To 10 Step 1
  • total total i
  • Next

20
3-3 VB.NET????????
  • 3-3-1 ???????
  • 3-3-2 ????????????
  • 3-3-3 ????

21
3-3-1 ???????-1
22
3-3-1 ???????-2
23
3-3-1 ???????-3
24
3-3-1 ???????-4
25
3-3-1 ???????-5
26
3-3-2 ????????????-????
  • VB.NET???????Dim???????,????
  • Dim size ' ??size??????Object
  • ???????????,??????????,????????Object,????????????
    ?
  • ?????????????,??????As???????????,????
  • Dim size1,size2 As Integer '
    ??size1?size2??Integer????
  • ???????????????????

27
3-3-2 ????????????-????
  • ????,??????????????????,????
  • Dim name As String ,size3 As Integer 100 '
    ????size3???
  • ?????????size3????100?

28
3-3-2 ????????????-????
  • VB.NET????????,??????????Const??????,?????????????
    ?,????
  • Const MAX_SIZE 100
  • ?????????100?

29
3-3-2 ????????????-????
  • VB.NET????????????????,??????????,????
  • size 3
  • name "???"
  • ??????????,?????????????????????

30
3-3-3 ????-??
  • VB.NET???????Dim?????,?????????????????,???????,??
    ??
  • Dim arraySize(5) As Integer
  • ???????????,????????????,???05????????
  • ??????,????
  • Dim arraySize(5, 5) As Integer
  • ?????????6x6?????,????????????????

31
3-3-3 ????-??
  • ?????????????,????
  • Dim arraySize() As Integer 1, 2, 3, 4, 5, 6
  • ??????????????????,?????????,????????????????
  • ????????????????,????
  • arraySize(0) 1
  • arraySize(1) 2
  • .
  • arraySize(4) 5
  • arraySize(5) 6

32
3-3-3 ????-??????
  • VB.NET????????ReDim????????????????,??ReDim???????
    ???,????????,????
  • ReDim arraySize(6)
  • ?????????arraySize??????6?
  • VB.NET???????????,???????,??????????,???Preserve??
    ????????,????
  • ReDim Preserve arraySize(10)

33
3-4 VB.NET????
  • 3-4-1 ????????
  • 3-4-2 ??????????
  • 3-4-3 ?????
  • 3-4-4 ?????
  • 3-4-5 ?????

34
3-4 VB.NET????
  • VB.NET?????????????????????,????????????????,VB.NE
    T???????????????????,????
  • A B - 1
  • A gt B
  • A lt B And A gt 1
  • ??????A?B?????1????,?-?lt?gt?gt?????

35
3-4-1 ????????-1
  • VB.NET???????,????????????????,???????????????,???
    ????????????????,?????????
  • ??????????????,??????????,?????????
  • ???????????,?????????????????,??????????????

36
3-4-1 ????????-2
  • ????????????,???????,????????,?????????,????
  • ????? gt ????? gt ?????
  • ???????????????
  • ????????????????,?????????????,????????,????
  • ?? gt (-)?? gt /?? gt \???? gt Mod gt -?? gt
  • ??????????,????
  • Not gt And, AndAlso gt Or, OrElse gt Xor

37
3-4-2 ??????????
38
3-4-3 ?????
39
3-4-4 ?????-??
40
3-4-4 ?????-??
41
3-4-5 ?????
42
3-5 VB.NET?????
  • 3-5-1 ???????
  • 3-5-2 ????????

43
3-5-1 ???????-If...Then
  • If Then???????????????????,??If???True,???Then...E
    nd If?????,????
  • If value gt 0 Then
  • Response.Write("???ltbrgt")
  • End If
  • ??If??True??????????,????????End If,????
  • If value gt 0 Then Response.Write("???ltbrgt")

44
3-5-1 ???????-If...Then...Else
  • If Then????????????????,?????,????Else??,If???True
    ???Then...Else?????,False??Else...End
    If?????,????
  • If value lt 10 Then
  • Response.Write("???ltbrgt")
  • Else
  • Response.Write("???ltbrgt")
  • End If

45
3-5-2 ????????-If Then ElseIf
  • If Then ElseIf?????If Then???????,??ElseIf????????
    ??,??
  • If dayValue 1 Then
  • Response.Write("???ltbrgt")
  • ElseIf dayValue 2 Then
  • Response.Write("???ltbrgt")
  • ElseIf dayValue 3 Then
  • Response.Write("???ltbrgt")
  • .
  • ElseIf dayValue 7 Then
  • Response.Write("???ltbrgt")
  • Else
  • Response.Write("????????ltbrgt")
  • End If

46
3-5-2 ????????-Select Case
  • Select Case?????????????,???????????,?????????????
    ??????,????
  • Select Case dayValue
  • Case 1 Response.Write("????ltbrgt")
  • Case 2, 3, 4 To 6
  • Response.Write("???ltbrgt")
  • Case 7 Response.Write("????ltbrgt")
  • Case Else
  • Response.Write("????????ltbrgt")
  • End Select

47
3-6 VB.NET?????
  • 3-6-1 ForNext??
  • 3-6-2 Do/While...Until/Loop??

48
3-6-1 ForNext??-For...StepNext
  • For...StepNext??????????????,?Step???????,??Step?
    1????Step,????For Next??,????1,??1?10??????,????
  • Dim i, total As Integer
  • For i 1 To 10 Step 1
  • total i
  • Next
  • ???????Step,????
  • For i 10 To 1 Step -1
  • total i
  • Next

49
3-6-1 ForNext??-For EachInNext
  • For Each???For Next????????,??????????????????????
    ?,????????????,?????????????????,????
  • Dim objName As New ArrayList
  • Dim name As String
  • objName.Add("???")
  • objName.Add("???")
  • objName.Add("???")
  • For Each name In objName
  • Response.Write(name "ltbrgt")
  • Next

50
3-6-2 Do/While...Until/Loop??-While?????
  • Do Loop??????While??,??????????,????
  • Dim total As Integer 0
  • Dim counter As Integer 1
  • Do While counter lt10
  • total counter
  • counter 1
  • Loop

51
3-6-2 Do/While...Until/Loop??-Until??????
  • Do Loop??????Until??,???????????,????
  • Dim total As Integer 0
  • Dim counter As Integer 1
  • Do
  • total counter
  • counter 1
  • Loop Until counter gt 10

52
3-6-2 Do/While...Until/Loop??-WhileEnd While
  • WhileEnd While?VB 6?WhileWend??,??????????????,?
    1??10????,????
  • Dim total As Integer 0
  • Dim counter As Integer 1
  • While counter lt10
  • total counter
  • counter 1
  • End While

53
3-7 VB.NET??????
  • 3-7-1 ?????
  • 3-7-2 ?????????????

54
3-7-1 ?????-Sub???
  • Sub????????VB.NET???,??Sub?End Sub??,????????,????
  • Sub addOne2N(maxValue As Integer)
  • Dim total As Integer 0
  • Dim counter As Integer 1
  • While counter lt maxValue
  • total counter
  • counter 1
  • End While
  • Response.Write(...??? _total "ltbrgt")
  • End Sub

55
3-7-1 ?????-Function??
  • Function?????Function?End Function??,??????,??????
    ??Return??,????
  • Function addTen()
  • Dim i, total As Integer
  • For i 1 To 10 Step 1
  • total i
  • Next
  • Return total
  • End Function

56
3-7-1 ?????- Call?????????
  • ????????,??????????????Call,????
  • Call addOne2N(5)
  • addOne2N(100)
  • ???????,??????????????,?????????,????
  • total addTen()

57
3-7-2 ?????????????-??
  • VB.NET???????,????
  • ??????(Block Scope)??End?Loop?Next???????????????
    ,???????????,????????,????????????
  • ??????(Local Scope)???????????,??????????????,???
    ????
  • ??????(Global Scope)??????????????,??????????????
    ????,???????

58
3-7-2 ?????????????-????
  • ???????????????????,????
  • ByVal?????????????????,?????????
  • ByRef????????????????,?????????

59
3-8 VB.NET?????-??
  • VB.NET?????????????,?Try End Try,????
  • Try
  • ' ????????
  • Catch e As Exception
  • ' ????????
  • Finally
  • End Try

60
3-8 VB.NET?????-??
  • ??????????????,????
  • Try?????Try?Catch?????????VB.NET???????????
  • Catch??????Try????????????,?Catch?Finally????????
    ??????e?Exception????,????????,???????????????
  • Finally??????????????,????????,???????????,??????
    ?????,??????????
Write a Comment
User Comments (0)
About PowerShow.com