|
|
 |

 |
|
Programming Microsoft® .NET
|
|
|
Author
|
|
Jeff Prosise (Wintellect)
|
|
|
Pages
|
816
|
|
Disk
|
1 Companion CD(s)
|
|
Level
|
All Levels
|
|
Published
|
05/15/2002
|
|
ISBN
|
9780735613768
|
|
Price
|
$59.99
To see this book's discounted price, select a reseller below.
|
|
|
|
|
 |
|
|
Index
A
aborting threads, 668-70
abstract methods, interfaces as, 32
accelerators, 117
access tokens, 478, 480-81, 491-92
ACL (access control list) authorization, 477, 478, 481, 482, 492
Activator class methods, 722-23
Active Server Pages. See ASP
Adapter Sets. See DataAdapters
adaptive rendering, 400
adding items to collections
arrays, dynamic, 70
hash tables, 67-68
ADO.NET
BLOB retrieval, 575-76
Close method, 567, 570-71, 579-81
columns, 590, 594
command objects. See command objects, ADO.NET
connection objects, 87, 567-69
connection strings. See connection string configuration
connectionless design, 563
data binding, 601
data providers, 564-67
data types, determining, 579
database creation, 574
DataReader class, 86-87, 577-81
DataSets. See DataSets
DataTable objects, 590, 592-97
DataView class, 600-601
deleting records, 597
exception handling, 87
ExecuteNonQuery method, 572-74, 576
ExecuteReader method, 577-81
ExecuteScalar method, 574-77
FCL class support, 86-89
field names, retrieving, 578
filling DataSets, 592-93
Get methods, 579
inserting data, 88, 594-95
integrated security, 569
isolation levels, 583
Jet database engine, 564
locking during transactions, 582-83
managed applications, 563
Microsoft.Jet.OLEDB.4.0 data provider, 564
MSDAORA provider, 564
ODBC.NET data provider, 564
OLE DB .NET provider, 564-67, 585-86, 588
OleDb classes, 86
OleDbCommand, 567, 571-72, 586
OleDbConnection, 566-67, 569-70
Open method, 567, 570-71
Oracle databases with, 564-65
output parameters, 588-89
parameterized commands, 584-86
Prepare methods, 586
propagating changes to databases, 597-99
purpose of, 563
queries, 87-89, 577-81. See also SQL
rows, 590, 595
schema information, retrieving, 578-79
selecting records, 595
set-based data access, 589-97
Sql classes, 86
SQL Server .NET provider, 564-67
SqlCommand, 567, 571-72, 586
SqlConnection, 566-69
steps in database command processing, 567
stored procedures, 586-89
stream-based data access, 588
System.Data namespace, 86, 563
tables, 574, 590, 592-97
time outs on commands, 572
transaction commands, 581-83, 587
updating records, 597-99
views, 600-601
XML support, 601-2
AL (Assembly Linker)
binding modules into assemblies, 44
defined, 14
strongly naming assemblies with, 16, 48-50
aligning strings, 101
allocation of memory, 7. See also garbage collection; memory
anchoring controls, 138-39, 645
APIs
functions callable on Web. See Web methods
interoperability of, 8
.NET Framework. See FCL
reflection, 10
AppCounter.aspx example, 539-41
Application[], 434-36
application cache
absolute expiration, 440
adding items, 438, 442
application state, common characteristics with, 433
CacheDependency objects, 440
defined, 437
deleting data, 439
dependencies, 440
expiration policies, 437-38, 439-41
Global.asax file access to, 438
Insert method, 438
lock mechanism, 439
memory shortages, 441-42
Page.Cache, 438
performance improvements with, 443-44
priority assignment, 441
removal callbacks, 441-42
retrieving data, 438
sliding expiration, 440
SmartQuotes example, 443-47
storage characteristics, 433
System.Web.Caching.Cache, 438
Application class, Windows Forms, 98
application domains, 7, 711
Application_ handlers, 428-30
application roots, 418
application state
adding items, 434
AppCounter example, 539-41
characteristics of, 433
HttpApplicationState methods, 434
lock system, 434-35
purpose of, 432-33
reading values, 434
saving to file, 435
application types supported by .NET, 5
args parameters, 22-23
arrays
adding to, 70
application cache with, 444
ArrayList class, 66, 69-71, 127, 703-6
capacity, 71
creating, 69
dynamic, 70-71
inserting in, 70
number of items in, determining, 23
releasing memory, 70-71
removing items, 70
sizing, 70
static, 70
synchronizing access to, 703-6
WordCount example, 71-74
as keyword, 33
ASCX files, 318-19, 418-19. See also user controls
ASHX files, 405
ASMX files, 525
ASP (Active Server Pages)
application state, 432-37
disadvantages of, 188
history, 6
session state, 447-48
syntax for, 187-88
ASP.NET
applications. See ASP.NET applications
ASP, compared to, 188
assemblies imported by default, 204
Cache objects. See application cache
caching Web pages, 205
code-behind programming, 209-19
Context properties, 488
currency converter example, 206-9
custom controls. See custom controls
data storage. See application cache; application state
debugging support, enabling, 202
@ directives, 201-6
directories, 189
DLLs generated, 198, 418-19
exceptions, unhandled, 192
HTML controls, 195-97
HTTP handlers, 403-5
inheritance of configurations, 423-25
Lander example, 210-19
namespaces imported by default, 203
page-level directives, 201-6
page-level events, 198-201
processing initial HTTP requests, 198
programming language selection, 202, 216
project creation, 221
redirecting browsers, 308-9
Request objects, 308-9
Response objects, 308-9
RunAt="server", 193, 195
security. See ASP.NET security
SendMail example, 84-85
source code generation, 228-31
state. See application cache; session state
support for, 6
thin-client applications, 709
user controls, creating. See user controls
User-Agent headers, 334
view state, 364-65
Web Forms component. See Web forms
ASPNET account, 481
ASP.NET applications
all pages, text appearing on, 430-31
AppCounter.aspx example, 539-41
application cache. See application cache
application state, 432-37
ASCX files, 418-19
ASPX files, 418-19
configuration settings. See Web.config files
Congo.com example, 462-72
defined, 418
DLLs, 198, 418-19
End events, 428
Error events, 431
file types in, 418
global directives, 425-28
global event handlers, 428-31
Global.asax files, 418-19
HttpApplicationState, 433-34
inheritance of configurations, 423-25
instantiating objects declaratively, 432
namespace importation, 427
object tags, 432
settings. See Web.config files
Start events, 428
state. See session state
structure of, 418-19
subdirectories, 424
Web.config files, 418-25
worker process, 427
ASP.NET security
access tokens, 478, 480-81, 491-92
ACL (access control list) authorization, 477, 478, 481, 482
ASPNET account, 481
authentication. See authentication
authorization, 477, 481, 483, 495-96
CorpNet example, 489-95
forms authentication. See forms authentication
guidelines, 482-83
HTTP pipeline, 480
HttpContext User property, 488
IIS, relationship with, 479-80
impersonation, 481-82, 492
login page, default, 518
non-ASP.NET files, 520
PublicPage/ProtectedPage example, 497-517
purpose of, 473-74
role-based security, 496
SYSTEM, running as, 482
types of sites requiring security, 473-74
URL authorization, 495-96
Aspnet_state.exe, 453
Aspnet_wp.exe, 479-82
ASPX files, 418-19
assemblies
Asminfo.cs example, 91-92
@ Assembly directive, 204-5
Assembly Linker (AL), 14, 16, 44, 48-50
attributing code, 51
binding, 17, 44, 49-50, 95-96
configuration files, 47
cryptographic hashes, 16
defined, 14
delayed signing, 52-53
digital signatures of, 16
dynamic linking, 42-52
GAC (global assembly cache), 16-17, 50-53
linking to, 47
loading, 90-91
manifests. See manifests
metadata, obtaining, 90-93
multifile. See multifile assemblies
partial loading of, 46
public keys, 50
redirects, 49-50
reflection namespace, 89
shared, 50-51
signing, 52
strongly named, 16-17, 50-51, 52
subdirectories, installing in, 47
verification skipping, 53
versioning, 16-17, 48-50
weakly named, 16
assembly language. See CIL
Assembly Linker (AL), 14, 16, 44, 48-50
asynchronous delegates, 674, 733-35
asynchronous method calls, 733-35, 738
attributes
assembly, 52
Conditional, 93
custom, 93
defined, 93
parameters, defining, 94
reflection with, 94
System.Attribute namespace, 93
XML, 607-8
attributing code, 51-52
authentication
401 status code, 484
access tokens, 491-92
ASP.NET settings, 421
Authorization headers, 484
basic authentication, 483-85, 489-90
charging for Web services, 557-59
CorpNet example, 489-95
defined, 475
deploying applications, 489-91
digest, 486-87
enabling, 492
forms authentication. See forms authentication
HttpContext User property, 488
IIdentity interface, 488
IIS configuration manager, 478-79
authentication,
IIS for intranets, 559
indicating type to use, 476-77
integrated Windows authentication, 487-88
message authentication code, 369
multiple roles with, 517
Passport authentication, 475-76
purpose of, 474
realms, 484
SOAP headers for, 557-59
types supported by ASP.NET, 475
user information, obtaining, 488-89
Web.config, 476-77
Windows. See Windows authentication
WWW-Authenticate headers, 484
authorization
ACLs, 477, 481-83
ASP.NET settings, 421
defined, 477
role-based security, 496
SOAP headers for, 557-59
URL, 477, 495-96
AutoCounter example, 376-81
AutoPostBack property, 236-37
B
background threads, 664-66, 674
BadNews.cs example, 681-84
base classes, default, 31
basic authentication, 483-85, 489-90
BeginTransaction method, 581-83
binary formatters, 730-31
binary I/O, 60, 63-66
binding
assembly files, 17, 44
data. See data binding
late, 95-96
redirects, 49-50
bitmaps
Bitmap class, HTTP handlers with, 404, 408
BMPs, loading, 117
database storage of, 575-76
destruction problem, 40
disposing, 118
GIFs, loading, 117
JPG files, 117, 576
loading, 117
BLOB (binary large objects) retrieval, 575-76
BMPs. See bitmaps
bookseller example. See Congo.com example
Bookstore Locator Web service example, 534-35
borders of Table controls, 241-42
boxing types, 35-36, 692-93
browsers
adaptive rendering, 400-401
compatibility of Web applications, 222
Internet Explorer. See Internet Explorer
mouseovers, version differences, 333
Netscape Navigator. See Netscape Navigator
properties, retrieving, 334
scripting languages, 389-90
validation control problems, 292
versions, obtaining, 333-34
XML support, 651-52
XSLT support, 654
brushes, 102-3
Build command, 156
button controls
Button, 243-44
Command event, 244-45
creating, 133
declaring, 243
events, 243
ImageButton, 243-44
LinkButton, 243-44
multiple with single handler, 245
overloading, 245
Web, 224-25, 243-44
C
C++, managed, 216
C#
code-behind programming, 210
compile command, 20
Hello World example, 19-25
project creation, 150
unboxing reference values, 36
undefined types messages during compilation, 19
using keyword, 21-22
Cache objects. See application cache
CacheDuration parameter of WebMethod, 530-31
caching
application. See application cache
ASP.NET, 205
fragment, 349-50
@ OutputCache directive, 349
VaryByControl attributes, 349-50
Web pages, static content of, 317
calculator examples
ASP, 187-88
Calculator Web client example, 542-43
Calculator Web service example, 525-29
mortgage payments, Web-based, 219-31
NetCalc Windows Forms, 148-74
simple HTML form, 181-82
Web, ISAPI DLL, 184-86
Web Forms, 188-91
Calendar controls
Cell object, 287
colors, 289
creating, 195, 282
customizing, 286-89
DayRender events, 284, 286-88
events, 284-88
multiple dates, selecting, 285-86
properties of, 283
purpose of, 282
SelectionChanged events, 284-85
Showtime example, 289-91
VisibleMonthChanged events, 284
weekdays, limiting selection to, 288
callable API functions. See Web methods
callbacks, 34, 734-35, 738
capacity of an ArrayList, 71
cascading style sheets (CSS), 315
casting
DataSets, in, 595
InvalidCastException, 54
prevention by CLR, 7
weakly typed collection classes, 66-67
catch blocks, 54-56
CDATA, 608-9
CGI (Common Gateway Interface), 184
channels, remoting, 711-12
CheckBox controls
creating, 239-40
IPostBackDataHandler, 373-76
RadioButtons derived from, 240
CheckBoxList controls, 248-49
child controls, 381, 383, 385-86
CIL (common intermediate language)
assembler for, 8
benefits of, 8
described, 11-12
disassembly, 12-14
displaying for code, 24-25
example of, 12
execution model, 12
instruction set, 12-13
loading values, 12
managed modules, 8-9
programming languages, compilers for, 8
purpose within CLR, 6
storing values, 12
CityView Web service client example, 546-57
CityView.ashx, 553-57
CityView.aspx, 550-53
classes
closing of, 38-42
constructor methods, 30
default base class, 31
defined, 28
derivation, 30-31
fields, adding, 153
instantiating, 30
linking to assemblies, 47
members, kinds of, 28
objects, instantiating, 30
portability of, 8
qualifying references, 21-22
Rectangle example, 29-31
remotable, 710-11
types, as, 28-31, 38
clients
tightly coupled, 709
Web services. See Web service clients
client-side scripting
benefits of, 389-90
character filtering, 398-402
OnKeyDown event handling, 398-402
OnPreRender method, 392
performance benefits, 389
RegisterClientScriptBlock method, 391-93
remote referencing, 394-95
returning JavaScript to clients, 390-91
rollover images, 396-98
script blocks, returning, 391-92
startup scripts, 393
clipboards, 98
Clock example, 108-11
ClockServer.cs example, 713-16
Close method, 40-41
CloseDemo example, 131
CLR (common language runtime)
advantages of, 25
application domains, 7
benefits of managed environments, 7
CIL. See CIL
code verification, 7
file headers, 9
garbage collection, 7
JIT (just-in-time) compilation, 6-7
managed applications, 5
managed modules, 8-9
metadata, 9-11
operation of, 6
purpose of, 5, 6
code obfuscation, 14
code revisions, documenting, 93-95
code verification, 7
code-behind programming
@ Application directives, 426-27
base classes, 215
C#, method for, 210
compiling, 211, 216
custom control example, 355
defined, 209
DLLs, 211, 216
Lander example, 210-19
operation of, 215
@ Page directive, 216
programming language selection, 216
reasons to use, 209
references to controls, 210, 212
user controls, 327-30
Web Forms example, 228-31
Web services, 528-29
Collect method, 40
collections
adding to, 67-68
arrays. See arrays
bit arrays, 66
Count property, 68
enumerating, 68
foreach keyword, 68
hash tables. See hash tables
queues, 66, 704-7
removing items, 68
SortedList class, 66, 71-74
Stack class. See stacks
strongly typing, 67
synchronizing access to, 703-4
System.Collections namespace, 66
types, table of, 66
weak typing in, 66-67
WordCount example, 71-74
Color dialog boxes, 141
COM (Component Object Model), 5, 709-10
combo boxes, 246-47
comics list example, 260-69, 279-82
command objects, ADO.NET
classes for, 571-72
closing, 579-81
DataReader class, 577-81
defined, 567
ExecuteNonQuery method, 572-74, 576
ExecuteReader method, 577-81
ExecuteScalar method, 574-77
parameterizing, 584-86
common intermediate language. See CIL
common language runtime. See CLR
CompareValidator, 292, 296-99
compatibility issues, 3-5, 8, 14-15
compilers
availability of, 8
decompilers, 14
entry points, indicating, 21
compiling
ASP.NET settings, 421
C# programs, 43
code-behind programming, 211, 216
csc command, 20
defaults, 20
DLLs, 211, 216
program execution, 20-21
undefined types, 19
Visual Basic .NET programs, 43
Windows Forms applications, 101
composite controls
child controls, 381, 383, 385-86
ControlCollection type, 381
Controls property, 381
declarative, 381-82
defined, 381
group box control, 383-85
INamingContainer, 386-87
LoginControl example, 386-89
programmatic, 382, 385-89
Render method, 382
visibility of, 382, 383
conditional validation example, 312-14
configuration files
ASP.NET. See Web.config files
binding redirects, 50
directories for assemblies, 47
Machine.config. See Machine.config files
Congo.com example, 462-72
connection string configuration
ADO.NET, 420-21
Connect Timeout parameter, 569
ConnectionString property, 568
Database parameter, 568, 569
exceptions, 568
File Name parameter, 570
Integrated Security parameter, 569
OLE DB Services parameter, 570
OLE vs. SQL data providers, 565-67
OleDbConnection, 569-70
pool size parameters, 569
Provider parameter, 569
Pwd parameter, 568, 570
Server parameter, 568, 569
SqlConnection, 566-69
Uid parameter, 568, 569
connections
aborted threads, 668-69
closing, 567
database, 87
remoting, 711-12
console applications, compiling, 20
Console class, 21
constructors, 30
containers, controls as, 381
context menus, 115
ControlDemo example, 134-37
controls
adaptive rendering, 400
adding to forms, 133, 151, 157
anchoring, 138-39
buttons. See button controls
Calendar, 195, 282-91
CheckBox, 239-40, 373-76
child, 381, 383, 385-86
classes, table of, 132-33
client-side scripting. See client-side scripting
collections, 134
colors, background, 132
composite. See composite controls
containers, acting as, 381
Controls property, 381
creating, 133
custom ASP.NET. See custom controls
DataGrid. See DataGrid controls
DataList, 264-69
declarative, 381-82
delegates, 134
dialog boxes, in, 142-43
event handlers, 133-34, 154-55
graphical, 403-13
horizontal alignment, 243
HTML, 195-97
HTTP handlers, 403-5
HyperLink, 237-38, 396-98
Image, 238-39
initializing, 133, 156-57
instantiating, 156
kinds of, table of, 132-33
Label, 134-35
ListBox, 247-48, 250-51, 373-76
lists. See list controls
Literal, 386
LoginControl example, 386-89
NumTextBox control example, 400-402
OnPreRender method, 392
Panel, 242-43
programmatic, 382, 385-89
purpose of, 131-32
Repeater, 254-64
server. See server controls
System.Windows.Forms namespace, 132
tabbing between, 135
Table, 241-42
TextBox. See TextBox controls
tree view, 134
user. See user controls
validation. See validation controls
view state, 364-65
Web. See Web controls
Web forms, adding to, 224-25
converter, currency, 206-9, 253-54
cookieless session state, 450-51
cookies
browser support for, determining, 450-51
caching, 341
cookieless session state, 450-51
Cookies collection, 342
Cookies header, 339, 343
creation, 340, 341
defined, 339
deletion, 342-43, 513
disabling, effect on session state, 447-48
encryption, 518-19
Expires attribute, 341-42
forms authentication, 497, 498, 500, 504, 508-9
HasKeys property, 343
headers, HTTP, 339, 343
HttpCookie class, 341-44
HttpCookieCollection property, 342
multivalue, 343-44
MyQuotes example, 344-49
names, 340, 342, 518
persistent, 341
properties, 341-42
protection levels, 518-19
returning to browser, 342
Secure attribute, 342
security considerations, 518-19
semicolons in, 340
session, 341, 342
session state, ASP, 447-48
Set-Cookie header, 340-41, 343
signing out, destroying upon, 517-18
time-out values, 508-9, 518
uses for, 340
values, 340, 342, 343
coordinates, drawing, 105-12
CorpNet example, 489-95
Count property
ArrayLists, 70
Hashtables, 68
credit card numbers, validating, 77
critical sections, 681
cryptographic hashes
of assemblies, 16
Web farm considerations, 461-62
csc command, 20
CSS (Cascading Style Sheets), 650
culture strings, 16
currency converter example, 206-9, 253-54
custom controls
adaptive rendering, 400
assembly identification, 355
attributes, adding, 359
AutoCounter example, 376-81
base class for, 354
browser determination, 400
change events, 365-68
character filtering, 398-402
ClientID property, 360-61
compiling, 355
composite. See composite controls
Control class, 354
declarative, 381-82
defined, 353
dynamically generated images, 402-13
embedding in .aspx files, 355-56
generating postbacks, 371-73
group box control, 383-85
Hello world example, 354-58
HtmlTextWriter reference, 354, 358-59
HTTP handlers, 403-5
ID attribute, 360-61
IPostBackDataHandler, 373-76, 377
IPostBackDataHandler interface, 361-64
IPostBackEventHandler, 374-76, 377
JavaScript, returning to clients, 390-91
lifetime of, 364
LoadPostData method, 361-62, 366
MessageButton1.cs, 390-91
MessageButton2.cs, 392-93
MessageButton3.cs, 394-95
MyLinkButton example, 375-76
MyTextBox control example, 362-64, 365-73
Name attribute, 360
namespace statements, 354, 355
NumTextBox control example, 400-402
odometer example, 405-13
OnChange events, 370-71, 374
OnPreRender method, 392
postbacks, 359-61, 361-64
postCollection, 362
properties, adding, 357-58
RaisePostDataChangedEvent, 365-68
@ Register directive, 355
Render method, 354, 382, 390, 392, 403
Repeater controls, 361
RolloverImageLink control, 396-98
state, preserving, 364-65
System.Web.UI.Control, 354
tags, 355, 360
text boxes, updating, 361-62
UniqueID property, 360-61
using namespaces, 354
view state, 364-65
Write method, 354, 358-59
WriteEndTag method, 358-59
CustomValidator, 292, 299-300
D
data binding
ADO.NET, 601
arrays of strings, 251
data-bound controls, 254
DataGrid controls, 269-82
DataList controls, 264-69
DataView class, 273
list controls, 250-53
MyComicsDataGrid example, 279-82
paging lists, 276-79
Repeater controls, 254-64
data providers
DataSets with, 565
defined, 564
Microsoft.Jet.OLEDB.4.0, 564
MSDAORA provider, 564
.NET classes with, 565-67
ODBC.NET, 564-65
picking, 564-65
SQL Server .NET provider, 564-67
SQLOLEDB provider, 564
data retrieval using hash tables, 67-69
data types. See types
DataAdapters
CommandBuilder classes, 599-600
defined, 590
Fill method, 592-93, 597-99
propagating changes to databases, 597-99
role of, 592
SelectCommand, 599-600
Update method, 598-99
XML, 602
database access. See ADO.NET
DataGrid controls
column types, table of, 271
Congo.com example, 462-72
custom paging, 278-79
DataView class, 273
formatting options, 270-71
ItemCommand events, 273
manual column creation, 271-72
MyComicsDataGrid example, 279-82
MyQuotes example, 344-49
pageable, 276-79
purpose of, 195, 269
sortable, 273-76
TemplateColumns, 279
view state, 369
DataList controls, 264-69
DataReaders, 86-87, 577-81, 591
DataSets
adding records, 594-95
Boolean expressions, 596
casting in, 595
clearing, 593
columns, 590, 594, 595
CommandBuilder classes, 599-600
comparison operators, 596
Constraints property, 590
controls, binding to, 591
data providers with, 565
DataAdapters for. See DataAdapters
DataReaders, compared to, 591
DataTable objects, 590, 592-97
defined, 88, 589-90
deleting records, 597
Fill method, 592-93, 597-99
initializing, 592-93
inserting data, 594-95
ISNULL function, 596
NewRow method, 595
propagating changes to databases, 597-99
purpose of, 591
random access support, 591
ReadXML method, 333, 601-2
referencing tables, 594
Relations property, 590
rows, 590, 595
selecting records, 596
session state storage of, 472
structure of, 590
System.Data namespace, 590
tables, 590, 592-97
updating records, 597-99
values, adding to columns, 595
WriteXML method, 602
XML, reading from, 601-2, 630
XML, reading into, 206-7
DataTable objects, 590, 592-97
DataView class, 273, 600-601
DCOM (Distributed Component Object Model), 709-10, 727
debugging
ASP.NET, enabling, 202
executables, 13
multithreaded code, 662
synchronizing threads, 691-92
user controls, support for, 319
declarative controls, 381-82
decompilers, 14
definition of Microsoft .NET initiative, 3-4
delayed signing, 52-53
delegates
asynchronous, 674, 733-35
base class of, 35
controls, 134
defined, 34
EventHandler control change events, 365-66
operation of, 34-35
DELETE command, SQL, 571-72
delete operators, 30
destructors
Finalize method, 30
nondeterministic destruction, 38-42
device contexts, 98-99
device coordinates, 105, 112
DHTML
character filtering, 398-402
rollover images, 396-98
dialog boxes
borders, 141
Cancel button, 142
changes from Windows API, 140-41
characteristics of, 140
common dialogs, 140-41
controls in, 142-43
defined, 140
displaying, 140
instantiation, 142
modal vs. modeless, 140
OK button, 142
Open File, 118, 141
Print, 141
Save File, 141
ShowDialog method, 140, 142
sizing, 141
StartPosition property, 141
task bar, showing on, 142
title bar, setting, 141
user input extraction, 142-43
Windows Forms nature of, 98
DialogDemo example, 141-48
digest authentication, 486-87
digital signatures
of assemblies, 16
delayed signing, 52-53
directives
@ Application, 425-27
@ Assembly, 204-5, 319-20
@ Control, 319-20, 327, 338
defined, 201
@ Implements, 202
@ Import, 203-4, 206, 319-20, 427-28
@ OutputCache, 205-6, 349
@ Page, 202-3, 216
@ Reference, 202
@ Register, 318-19, 321, 339, 355
table of, 201-2
@ WebHandler, 548
@ WebService, 525
directories
manipulation, 61
virtual directories, ASP.NET, 220
disassembly, 13-14
DISCO, 537-39
Dispose method
bitmaps with, 118
GDI+ objects, 103-4
purpose of, 40-41
distances, graphic, 105
distributed transactions, 581-83
DLL Hell, 17, 27, 48-50
DLLs (dynamic link libraries)
ASP.NET applications, 418-19
compiling, 211, 216
disassembly of, 13-14
FCL, 19
manifests as, 44
DNS (Domain Name System), 179
Document Object Model (DOM), 614, 615-17, 621-30
document type definitions (DTDs), 613, 634
DOM (Document Object Model), 614, 615-17, 621-30
downloadable units, 14-15
drawing. See GDI+
DrawString method, 99-101
DropDownList, 200, 246-47
DTDs (document type definitions), 613, 634
dynamic discovery of Web services, 538
dynamic link libraries. See DLLs
dynamic linking
binding redirects, 49-50
creating multifile assemblies, 43-44
defined, 42-43
global assembly caches, 50-51
linking to assemblies, 45-47
subdirectories, installing assemblies in, 47
versioning assemblies, 48-50
dynamic loading
defined, 95-96
plug-ins using, 95-96
subpage caching, 349-50
of user controls, 338-39
E
ECMAScript. See JavaScript
Elapsed event, 34
ElapsedEventHandler delegate, 34
e-mail, System.Web.Mail namespace, 83-85
EnableSession parameter of WebMethod, 531
encapsulation, 389
EN_CHANGE notifications, 398
encrypted streams, 60
encryption
cookies, 518-19
digital signatures, 16, 52-53
HTTPS, 519
IIS support for, 478
SSL, 478
XOR utility for, 64-66
entry points, 21, 24
enum keyword, 33
enumerations, 33
Equals method, hash tables with, 69
Error events, 431
error messages, Message property, 55
event handling
controls, for, 133-34, 154-55, 365-66
EventHandler delegate, 365-66
global, ASP.NET applications, 428-31
keyboard input, 155
menu commands, 114
multiple button controls, single handler for, 245
server controls, for, 191-92
events
Calendar controls, 284-85
classes, as members of, 28
closing of forms, 130
controls with, 133-34
custom controls, adding to, 365-68
delegate use with, 34
form-level, 130-31
keyboard, 124-25, 155
mouse. See mouse input; mouseovers
multicasting, 35
multithreading synchronization, 700-702
OnChange events, 370-71, 374
page-level, 198-201
RaisePostDataChangedEvent, 365-68
remote applications, 731-33
server controls, 191-92
ServerClick, 197
sizing of forms, 130
user control, 325-27
Events.cs example, 701-2
exceptions
ADO.NET, 87
advantages of framework, 54
ASP.NET, unhandled, 192
bitmap memory consumption problem, 40
catch blocks, 54-56
custom, 57
disposal of, 55
finally blocks. See finally blocks
handling, 54-57
Message property, 55
multithreading, 668-70
nesting of, 56
pointers, stray, 7
set accessors throwing, 30
System.Exception, 55, 57
text I/O, 61-62
ThreadAbortException, 668-70
threads, 668-70
throwing, 57
try blocks, 54-55
types, table of common, 55
unhandled, 56
executables. See also managed modules
assemblies as, 14
debugging, 13
defined, 8
ExecuteNonQuery method, 572-74, 576
ExecuteReader method, 577-81
ExecuteScalar method, 574-77
executing programs, operations during, 20-21
Expressanalyzer.cs, 645-50
F
fat clients, 709
FCL (.NET Framework class library)
contents of, 59-60
defined, 27
enumeration of parameters, 33
Forms namespace, 98
housing of, 19
namespaces in, 17-18, 59
purpose of, 5, 59-60
reflection API, 10
XML with, 603-4, 621
fields
adding to forms, 153
classes, as members of, 28
code-behind programming, using in, 210, 212
protected, 30
file authorization, 477
file handles, destruction problem, 38-41
files
database. See ADO.NET
I/O. See I/O
manipulation, 61
Open File dialog boxes, 118, 141
Save File dialog boxes, 141
fill methods (drawing), 102-4
Finalize method, 30, 32, 41-42
finally blocks
lock keyword, 686-87
monitors with, 684
syntax, 56
threads, aborting, 668-70
fire-and-forget semantics, 735
flow layout mode, 222
fonts
Font class, 102
Font dialog boxes, 141
FontInfo class, 335
user controls, 334-35
For Each keyword, 68
foreach keyword, 32, 68
foreground threads, 664-66
Form class
defined, 98
instancing, 100
OnPaint method, 100
ProcessDialogKey method, 155
Form1.cs, 157-73
forms
HTML. See Web forms
Windows. See Windows Forms
forms authentication
Authenticate method, 500
cookie security, 518-19
cookies, 497, 498, 500, 504, 508-9
databases for passwords, 503
defined, 497
directory protection levels, 500
impersonation, 483
login forms, 476
LoginPage.aspx, 497-503
multiple roles with, 517
non-ASP.NET files, 520
password security, 504
persistent cookies, 508-9
forms authentication,
role-based security with, 509-17
signing out, 517-18
simple example, 497-503
time-out values, 507, 518
URL authorization, 516-17
forms designer
controls, adding to forms, 151, 157
defined, 150-51
event handlers, adding, 155
fields, adding, 153
methods, adding, 154-55
Properties window, 151
titles, setting, 151
Toolbox, 151
forms element, table of attributes, 518
fragment caching, 205, 349-50
framework. See .NET Framework
G
GAC (global assembly cache)
defined, 50
delayed signing, 52-53
installing assemblies, 50-51
strongly named assemblies, 16-17
GacUtil, 50-51
garbage collection
algorithms for, 7
Finalize method, 30
garbage-collected (GC) heap, 690-91
GC class, 19
nondeterministic destruction, 38-42
GDI+
brushes, 102
Clock example, 108-11
coordinates, 105-12
defined, 101
disposing of objects, 104-5
fills, 102
Font class, 102
GDI, compared to, 101-2
gradients, 102-3
Graphics class, 98-99, 103-4
Matrix class, 105-6
page coordinates, 105, 111-12
Pen class, 102-3, 112
primitives, table of, 102
rectangles, 102-3
redrawing windows, 108
reusing resources, 105
rotations, graphic, 106-8
scaling, 108
SolidBrush object, 102
statelessness, 102
System.Drawing namespace, 98, 102
Transform property, 105-6
transformations, 105-12
translation of coordinates, 106-8
units of measurement, 105, 111
generics, 67
GET command, HTTP, 179, 181, 524, 536
GetPostBackEventReference, 371, 374, 377
GIFs, loading, 117
global assembly cache. See GAC
global directives, 425-28
global event handlers, 428-31
Global.asax files
all pages, text appearing on, 430-31
application cache access, 438
@ Application directives, 425-27
Application_ handlers, 428-30
defined, 425
Description attribute, 426
elements of, 425
Error events, 431
global directives, 425-28
global event handlers, 428-31
global object tags, 432
HttpApplication object, 427, 429-31
@ Import directives, 427-28
Inherits attribute, 426-27
role within ASP.NET, 418-19
role-based security, 511
Session_ handlers, 429
SmartQuotes example, 445-46
gradients, 102-3
graphical controls, 403
graphics. See also bitmaps; GDI+
bitmaps, drawing on forms, 117
BLOB retrieval, 575-76
database storage and retrieval of, 575-76
DrawString method, 99-101
Graphics class, 98-99
Graphics property of OnPaint, 100
HTTP handlers with, 404
methods for drawing, 103-4
grid layout mode, 222
group box control, 383-85
GUI programming. See Windows Forms
Guitars.xsl, 653-54
H
hash tables
advantages of, 71-72
defined, 66-67
Hashtable class, 36, 66-69
shopping carts, 462-72
synchronizing access to, 704-6
WordCount example, 71-74
headers, HTTP, 179
heaps, metadata, 10
Hello world examples
console application, 19-25
custom control for Web pages, 354-58
Windows Forms, 99-101
HTML (Hypertext Markup Language)
converting from XML, 650-58
editing, 226
forms. See HTML forms
generating. See ASP.NET; Web forms
HtmlTextWriter methods for custom controls, 358-59
parsing, 82-83
screen scraping, 75
stripping tags from, 76
tables. See Table controls
HTML controls, 195-97, 233
HTML forms
ASP, 187-88
CGI, 184
ISAPI, 184-86
.NET. See Web forms
server-side processing, 183-84
simple, 180-82
HtmlTextWriter method, 391-92
HTTP (Hypertext Transfer Protocol)
Authorization headers, 484, 557
binary formatters, 730-31
browser version information, 334
cookie headers, 339
defined, 178
HttpApplicationState, 433-34
HttpContext User property, 488
HttpSessionState. See session state
HttpWebRequest class, 81-82
HttpWebResponse class, 81-82
remote object connections, 711-12, 729-31
Set-Cookie header, 340-41, 343
state preservation. See cookies
syntax, 179-80
User-Agent headers, 400-401
HTTP handlers
defined, 403
invoking image generators, 404
odometer example, 405-13
operation of, 404
Web service clients, 548
Web.config, 403, 405
HttpApplication object
Global.asax files, 427, 429-31
Server.MapPath facility, 435
HTTPS, 519
hyperlinks
HyperLink controls, 237-38
image hyperlinks, 238
listing, 82-83
rollover images, 396-98
I
ICollection, SyncRoot, 705-6
identity matrices, 105
IDictionary interface, Hashtable implementing, 68
IDisposable interface, 41
IEnumerable interface
data binding list controls, 251
defined, 32
Hashtable implementing, 68
IIdentity interface, 488
IIS (Internet Information Services)
6.0, changes in security, 480
access tokens, 478, 480-81, 491-92
authenticating Web services, 559
authentication support, 479
configuration manager, 478-79, 489-90
deploying applications, 489-91
directories, 189
encryption support, 478
Inetinfo.exe, 478, 480
ISAPI DLLs, 184
relationship to ASP.NET security, 479-80
remote channels, 712
remote object activation, 727-29
security design, 477-78
virtual directory creation, 220
Windows authentication, 475, 479
ILDASM, 10, 12-14, 23-25
ILease properties, table of, 724
IListSource interface, 251
Image controls, 238-39, 548-49
images. See also bitmaps; GDI+; graphics
dynamic generation of, 403, 405-13
graphical controls, 403-13
HTTP handlers, 403-5
loading, 117
odometer example, 405-13
rollover, 396-98
Src attribute, 396, 403
ImageView example, 117-22
impersonation, 481-82, 492
Imports statement, 21
INamingContainer, 386-87
inheritance
interfaces, of, 32
Web.config files, 423-25
input. See I/O
installation, XCOPY installs goal, 47, 51
instantiating
ASP.NET objects declaratively, 432
controls, 156
dialog boxes, 142
forms, 100
new operator, 30
reference vs. value types, 35-38
structs, 31
instruction set, CIL, 12-13
integrated Windows authentication, 487-88
intellectual property rights, 14
interfaces
as keyword, 33
creating, 32
defined, 32
ICollection, 705-6
IDictionary, 68
IDisposable interface, 41
IEnumberable, 32, 68, 251
IIdentity, 488
ILease properties, table of, 724
IListSource, 251
implementing, 32
INamingContainer, 386-87
IPostBackDataHandler, 373-76, 377
IPrincipal type, 488
is keyword, 33
remotable objects using, 723
Internet
DNS, 179
e-mail, 83-85
HTML forms, 180-88. See also Web forms
HTTP, 178-80
paradigms for programming, 177
server-side processing, 183-84
services. See Web services
support classes, 81-85
Web pages. See ASP.NET; Web forms
Internet Explorer. See also browsers
adaptive rendering, 400-401
HTTP, operation of, 179
MSXML parser, 651
XML, displaying, 651-52
Internet programming support classes
e-mail wrappers, 83-85
HttpWebRequest class, 81-82
HttpWebResponse class, 81-82
protocol wrappers, 81-82
System.Net namespace, 81
System.Web.Mail namespace, 83-85
interoperability
APIs under CLR, 8
goal of .NET, 3-4
multilanguage assemblies, 14-15
Web services, 4-5
InvalidCastException, 54
I/O (Input/Output)
binary, 60, 63-66
exception handling, 61-62
file I/O, 60-61
forms for. See Windows Forms
keyboard input, 122-24
List.cs example, 62
mouse methods, table of, 122-23
readers, 60-61
Scramble.cs example, 64-66
sockets, 60
StreamReader class, 61
streams, 60-63, 82-83
StreamWriter class, 60-63
System.IO namespace, 60
text files, 61-63
user. See dialog boxes
WriteLine method, 61
writers, 60-61
IPostBackDataHandler, 373-76, 377
IPostBackEventHandler, 374-76, 377
IPrincipal type, 488
is keyword, 33
ISAPI (Internet Server Application Programming Interface), 184
isolation levels, 583
iteration
arrays, 70-71
Hashtables, 68
J
Java, porting to .NET, 690
JavaScript
character filtering, 398-402
controls using, 389-93
isKeyValid function, 398
OnKeyDown event handling, 398-402
remote referencing, 394-95
returning to clients, 390-91
rollover images, 396-98
Jet database engine, 564
JIT (just-in-time) compilation, 6-7
JPEG files
inserting in databases, 576
loading, 117
JScript. See JavaScript
K
key files, 48
keyboard input, 122-24, 155
keyboard shortcuts, creating, 114
Next
Last Updated: April 17, 2002
|