Академический Документы
Профессиональный Документы
Культура Документы
NET
Mike Helstrom
Solution Architect
MikeH@iisweb.com
Agenda
What is .NET?
.NET Framework
Visual Studio.NET
C#
Visual Basic.NET
Q&A
What is Microsoft .NET?
http://www.microsoft.com/net/
Next Generation Internet
http://www.microsoft.com/business/vision/netvision.asp
.NET Infrastructure and Tools
Visual Studio.NET
.NET Framework
Windows.NET
“Whistler” (Windows XP)
.NET Framework
.NET Framework
http://msdn.microsoft.com/net
The .NET Framework
VB C++ C# JScript …
Visual Studio.NET
ASP.NET: Web Services Windows
Windows
and Web Forms Forms
Forms
Source VB C# C++
code Unmanaged
Compiler Compiler Compiler
Component
JIT Compiler
Native Code
Unified Classes
Web Classes (ASP.NET)
Controls, Caching, Security, Session, Configuration etc
System Classes
Collections, Diagnostics, Globalization, IO, Security,
Threading Serialization, Reflection, Messaging etc
ASP.NET
Visual J++ has been removed from the Visual Studio suite.
http://msdn.microsoft.com/vstudio
JUMP to .NET
Design Goals of C#
Component Orientated Language
Robust and Durable Software
Features
Classes
Namespaces
No header files
VB.NET vs. C#
Ability to embed C++ code in C# code
Elegance of C/C++ language
Design Goals C#
Component Oriented
Properties, methods, events
Robust and Durable
Garbage collection (No memory leaks and
stray pointers)
Exception Handling
Type-safety (No uninitialized variables)
Based on C++
Interoperability
Support for XML, SOAP
Visual Basic.NET
Visual Basic.NET
Leave it in VB6
WebClasses, ActiveX Documents, DHTML Projects
Thinking in VB.NET
Data Types, Type vs. Structure
Property Functions, Zero Bound Arrays
Default Parameters
New Features
Forms Designer, Declaration Syntax
Structured Exception Handling
Overloading, Inheritance
Free Threading
ADO.NET
VB.NET: Data Types
True is now = 1
Integer Data type has changed
Short (Int16), Integer (Int32), Long (Int64)
VB 6
Type Customer
CustomerNumber as Long
CustomerName As String
VB.NET
CustomerCompany As String
End Type
Structure Customer
Public CustomerNumber as Integer
Public CustomerName As String
Public CustomerCompany As String
End Structure
VB.NET: Property Functions
VB 6
Public Property Get CustomerName() As String
CustomerName = m_CustName
End Property
Public Property Let CustomerName(sCustName As String)
m_CustName = sCustName
End Property
VB.NET
Public Property CustomerName() As String
Get
CustomerName = m_CustName
End Get
Set
m_CustName = Value
End Set
End Property
VB.NET: Zero Bound Arrays
VB.NET
txtAddress.Text = rs(“Addr_1”).value
lblFName.Text = “First Name”
Note: Recordset (COM ADO) is not the preferred data storage object in VB.NET, this is just an example.
VB.NET Forms Designer
VB.NET
Try
...
Catch
‘error handling
Finally
‘clean up
End Try
VB.NET: Overloading
ADOConnection
Similar to Connection object in ADO
ADOCommand
Similar to Command object in ADO
ADODataSetCommand
Somewhat like Recordsets for ADO.NET (DataSet)
Designed for stateless operations
ADODataReader
For streaming methods, similar to Stream
SQLConnection, SQLCommand, and
SQLDataSetCommand, SQLDataReader
VB.NET Demo
VB 6 Moving Forward
Avoid
Web Classes, ActiveX Docs, DHTML Apps
Development Techniques
Early Binding
Don’t use Default Properties
Use Constants (such as true)
Avoid GoSub
Use ByVal and ByRef explicitly (ByVal is now
default)
Use ADO
VB6 to VB.NET Conversion Techniques
Relax, take breaks often
Resources
Microsoft
http://www.microsoft.com/net
http://msdn.microsoft.com/net
Programmer Resources
http://www.gotdotnet.com
http://www.devx.com
VB6 to VB.NET Whitepaper
http://msdn.microsoft.com/library/techart/vb6tovbdotnet.htm
Example Site
http://www.ibuyspy.com
TechNet Briefing
http://www.iisweb.com