100% found this document useful (1 vote)
12 views

Building Distributed Applications with Visual Basic NET Dan Fox download

The document provides information about the book 'Building Distributed Applications with Visual Basic .NET' by Dan Fox, including its contents, structure, and key topics covered. It emphasizes the transition to .NET technologies and the importance of Visual Basic .NET for developers. The document also includes links to download various related ebooks and textbooks.

Uploaded by

tjeckgolqm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
12 views

Building Distributed Applications with Visual Basic NET Dan Fox download

The document provides information about the book 'Building Distributed Applications with Visual Basic .NET' by Dan Fox, including its contents, structure, and key topics covered. It emphasizes the transition to .NET technologies and the importance of Visual Basic .NET for developers. The document also includes links to download various related ebooks and textbooks.

Uploaded by

tjeckgolqm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

Building Distributed Applications with Visual

Basic NET Dan Fox pdf download

https://ebookfinal.com/download/building-distributed-
applications-with-visual-basic-net-dan-fox/

Explore and download more ebooks or textbooks


at ebookfinal.com
We have selected some products that you may be interested in
Click the link to download now or visit ebookfinal.com
for more options!.

Developing Web applications with Visual Basic NET and ASP


NET 1st Edition John Alexander

https://ebookfinal.com/download/developing-web-applications-with-
visual-basic-net-and-asp-net-1st-edition-john-alexander/

Essential ASP NET with Examples in Visual Basic NET 1st


Edition Fritz Onion

https://ebookfinal.com/download/essential-asp-net-with-examples-in-
visual-basic-net-1st-edition-fritz-onion/

Practical Database Programming with Visual Basic NET 1st


Edition Ying Bai

https://ebookfinal.com/download/practical-database-programming-with-
visual-basic-net-1st-edition-ying-bai/

Practical Database Programming with Visual Basic NET 2nd


Edition Ying Bai

https://ebookfinal.com/download/practical-database-programming-with-
visual-basic-net-2nd-edition-ying-bai/
Mastering Visual Basic NET 1st Edition Petroutsos

https://ebookfinal.com/download/mastering-visual-basic-net-1st-
edition-petroutsos/

Sams Teach Yourself ADO NET in 21 Days 1st Edition Dan Fox

https://ebookfinal.com/download/sams-teach-yourself-ado-net-
in-21-days-1st-edition-dan-fox/

Visual Basic NET Bible 1st Edition Bill Evjen

https://ebookfinal.com/download/visual-basic-net-bible-1st-edition-
bill-evjen/

Visual Basic and Visual Basic NET for Scientists and


Engineers 1st Edition Christopher Frenz (Auth.)

https://ebookfinal.com/download/visual-basic-and-visual-basic-net-for-
scientists-and-engineers-1st-edition-christopher-frenz-auth/

Visual Basic NET From VB6 to VB NET 1st Edition Matt


Tagliaferri

https://ebookfinal.com/download/visual-basic-net-from-vb6-to-vb-
net-1st-edition-matt-tagliaferri/
Building Distributed Applications with Visual Basic NET
Dan Fox Digital Instant Download
Author(s): Dan Fox
ISBN(s): 9780672321306, 0672321300
Edition: illustrated edition
File Details: PDF, 8.81 MB
Year: 2001
Language: english
Building Distributed Applications
with Visual Basic .NET
Dan Fox
Quilogy, Inc.

800 East 96th Street, Indianapolis, IN 46240 USA


ASSOCIATE PUBLISHER
Building Distributed Applications Linda Engelman
with Visual Basic .NET ACQUISITIONS EDITOR
Sondra Scott
Copyright © 2002 by Sams Publishing
All rights reserved. No part of this book shall be reproduced, stored in a DEVELOPMENT EDITOR
retrieval system, or transmitted by any means, electronic, mechanical, photo- Shannon Leuma
copying, recording, or otherwise, without written permission from the pub- MANAGING EDITOR
lisher. No patent liability is assumed with respect to the use of the information Charlotte Clapp
contained herein. Although every precaution has been taken in the preparation
of this book, the publisher and author assume no responsibility for errors or PROJECT EDITOR
omissions. Nor is any liability assumed for damages resulting from the use of Elizabeth Finney
the information contained herein.
COPY EDITORS
International Standard Book Number: 0-672-32130-0 Geneil Breeze
Michael Henry
Library of Congress Catalog Card Number: 00-111343
Printed in the United States of America INDEXER
Erika Millen
First Printing: November 2001
04 03 02 01 4 3 2 1
PROOFREADER
Plan-it Publishing

Trademarks TECHNICAL EDITORS


Phil Syme
All terms mentioned in this book that are known to be trademarks or service
Dan Suceava
marks have been appropriately capitalized. Sams Publishing cannot attest to
the accuracy of this information. Use of a term in this book should not be TEAM COORDINATOR
regarded as affecting the validity of any trademark or service mark. Chris Feathers

MEDIA DEVELOPER
Warning and Disclaimer Dan Scherf
Every effort has been made to make this book as complete and as accurate as
INTERIOR DESIGNER
possible, but no warranty or fitness is implied. The information provided is on
Anne Jones
an “as is” basis. The author(s) and the publisher shall have neither liability nor
responsibility to any person or entity with respect to any loss or damages aris- COVER DESIGNER
ing from the information contained in this book or from the use of programs Aren Howell
accompanying it.
Contents at a Glance
Foreword x
Introduction 1

Part I .NET Concepts


1 The Microsoft .NET Architecture 9
2 The Development Environment 49
3 VB .NET Language Features 79
4 Object-Oriented Features 119
5 Packaging, Deployment, and Security 165
6 Error Handling and Debugging 199

Part II Enterprise Techniques


7 Accessing Data with ADO.NET 225
8 Building Components 299
9 Accessing Component Services 345
10 Building Web Forms 401
11 Building Web Services 509

Part III Integration


12 Accessing System Services 549
13 Implementing Services 609
14 Integrating with the Enterprise 653
Index 705
Table of Contents
Introduction 1
The Book’s Focus ....................................................................................1
The Book’s Layout ..................................................................................2
Part I: .NET Concepts ........................................................................2
Part II: Enterprise Techniques ............................................................2
Part III: Integration ............................................................................3
The Book’s Illustrative Style, Sample Application, and Web Site ..........4
The Book’s Audience ..............................................................................5

PART I .NET Concepts


1 The Microsoft .NET Architecture 9
A New Platform ....................................................................................11
What .NET Is and Is Not..................................................................12
VB’s Place in .NET ..........................................................................14
Common Language Runtime Architecture ............................................16
Goals of the CLR..............................................................................17
Managed Versus Unmanaged Code..................................................20
Common Language Specification ....................................................21
CLR Internals ..................................................................................22
Run-time Components......................................................................37
Class Libraries ..................................................................................44
Summary ................................................................................................47

2 The Development Environment 49


A New IDE ............................................................................................50
Projects and Solutions ......................................................................51
IDE Windows ..................................................................................55
Supported File Types ........................................................................64
Setting Project References................................................................67
Macros and Add-Ins ........................................................................69
Using Attributes ....................................................................................73
Command-Line Compilation ................................................................76
Summary ................................................................................................77

3 VB .NET Language Features 79


Keyword Changes ..................................................................................80
Functional Changes................................................................................85
Declarations ......................................................................................85
Operators ..........................................................................................86
Data Types ........................................................................................88
Arrays ..............................................................................................90
Structures ..........................................................................................98
Conversion ......................................................................................100
Strings ............................................................................................101
Block Scope....................................................................................105
Procedures ......................................................................................106
Upgrading from VB 6.0 ......................................................................107
Using the Upgrade Wizard ............................................................109
Summary ..............................................................................................117

4 Object-Oriented Features 119


OO Terminology ..................................................................................120
Encapsulation..................................................................................120
Polymorphism ................................................................................121
Inheritance ......................................................................................121
More OO Terms..............................................................................122
Role of Namespaces ............................................................................123
Defining Classes ..................................................................................126
Creating Members................................................................................127
Creating Methods ..........................................................................127
Creating Properties ........................................................................128
Creating Fields................................................................................130
Creating Events and Delegates ......................................................131
Creating Named Constants ............................................................144
Using Inheritance ................................................................................145
Using Polymorphism ......................................................................149
Creating and Using Shared Members ............................................150
Using Interface Based Programming ..................................................152
Versioning ......................................................................................154
Using Constructors and Destructors ....................................................155
Parameterized Constructors............................................................156
Destructors......................................................................................157
Summary ..............................................................................................163

5 Packaging, Deployment, and Security 165


Packaging and Deployment Concepts ................................................166
Assemblies Revisited......................................................................166
PreJITing Your Code ......................................................................176
Packaging and Deployment Options ..................................................177
Deployment Scenarios....................................................................177
Installing Server Resources ............................................................182
Securing Your Code ............................................................................187
Code Access Security ....................................................................187
Role-Based Security ......................................................................194
Summary ..............................................................................................198
vi
BUILDING DISTRIBUTED APPLICATIONS WITH VISUAL BASIC .NET

6 Error Handling and Debugging 199


Handling Exceptions............................................................................200
Using Unstructured Exception Handling ......................................202
Using Structured Exception Handling............................................205
Using the VS.NET Debugger ..............................................................209
Starting Debugging ........................................................................210
Attaching to a Running Process ....................................................213
Using Diagnostics ................................................................................214
Using the Debug Class ..................................................................215
Using Tracing ................................................................................217
Using Listeners ..............................................................................220
Summary ..............................................................................................222

PART I Enterprise Techniques


7 Accessing Data with ADO.NET 225
ADO.NET Defined ..............................................................................226
Relation to OLE DB and ADO ......................................................228
System.Data Architecture ....................................................................228
Managed Providers ........................................................................229
Connection Pooling ........................................................................242
Disconnected Data..........................................................................244
Application Scenario: The Quilogy Education System ......................256
Defining the Data Structure............................................................258
Handling Data Access ....................................................................286
Summary ..............................................................................................298

8 Building Components 299


Designing Components........................................................................300
Building Classes Versus Components ............................................301
Marshalling Objects........................................................................302
Building Reusable Components ....................................................310
Using .NET Remoting ........................................................................317
Hosting Components ......................................................................318
Activating Components ..................................................................325
Using Advanced Remoting ............................................................331
Calling Unmanaged DLLs ..................................................................333
Wrapping Unmanaged DLLs ........................................................335
Using Callbacks..............................................................................343
Summary ..............................................................................................344
vii
CONTENTS

9 Accessing Component Services 345


Migrating from MTS to COM+ ..........................................................347
Administrative Changes ................................................................347
Architectural Changes ....................................................................348
Implementing COM+ Services ......................................................354
Automatic Transactions ..................................................................358
Object Activation and Construction ..............................................363
Object Pooling ................................................................................366
Shared Properties............................................................................367
COM+ Events ................................................................................369
Queued Components ......................................................................374
COM+ Security ..............................................................................378
Registering Serviced Components ......................................................382
First-Use Registration ....................................................................382
Manual Registration ......................................................................384
Interoperating ......................................................................................384
Accessing COM Components from .NET ....................................385
Accessing .NET Components from Unmanaged Code..................391
Summary ..............................................................................................399

10 Building Web Forms 401


Understanding ASP.NET ....................................................................402
ASP.NET Architecture....................................................................403
Programming Models ....................................................................407
Differences from ASP ....................................................................408
Example Application............................................................................418
Web Forms Architecture ......................................................................419
Page Processing Flow ....................................................................419
Event Model ..................................................................................425
ASP.NET Features ..............................................................................430
Configuration Files ........................................................................430
Security ..........................................................................................433
State Management ..........................................................................449
Caching ..........................................................................................455
Tracing............................................................................................462
ASP.NET Server Controls ..................................................................464
HTML Server Controls ..................................................................465
Web Server Controls ......................................................................469
Web Forms User Controls ..............................................................505
Summary ..............................................................................................508
viii
BUILDING DISTRIBUTED APPLICATIONS WITH VISUAL BASIC .NET

11 Building Web Services 509


Web Service Architecture ....................................................................510
Uses for Web Services....................................................................512
Web Service Technology ................................................................514
Web Service Implementation ..............................................................523
Creating a Web Service Class ........................................................524
Web Service Design Issues ............................................................534
Customizing SOAP ........................................................................536
Consuming a Web Service ..................................................................539
Using the Client Proxy ..................................................................542
Summary ..............................................................................................545

PART III Integration


12 Accessing System Services 549
Understanding I/O Concepts................................................................550
Reading and Writing Files..............................................................552
Creating Multithreaded Applications ..................................................577
Using Threads ................................................................................579
Using Thread Pools ........................................................................587
Manipulating Windows Processes ......................................................594
Using Cryptography ............................................................................602
Summary ..............................................................................................608

13 Implementing Services 609


Creating Service Applications ............................................................610
Building a Service ..........................................................................611
Installing Services ..........................................................................616
Controlling Services ......................................................................622
Scheduling the Service ........................................................................625
Using a Simple Timer ....................................................................625
Using Event Logging ..........................................................................627
Writing to the Event Log................................................................628
Using a Custom Log ......................................................................630
Receiving Notification....................................................................633
Monitoring Performance......................................................................634
Installing Custom Performance Counters ......................................635
Using Performance Counters..........................................................636
Sampling Performance Counters....................................................639
Communicating over the .NET............................................................639
Using System.Net ..........................................................................640
Using FTP ......................................................................................646
Summary ..............................................................................................653
ix
CONTENTS

14 Integrating with the Enterprise 653


Using the XML Classes ......................................................................654
Streaming XML..............................................................................655
Accessing Data With the DOM......................................................667
Transforming a Document..............................................................672
Handling XML Schemas ................................................................675
Serializating to XML......................................................................680
Integrating Messaging..........................................................................686
Administering Queues ....................................................................687
Sending and Receiving Messages ..................................................692
Integrating Active Directory ................................................................699
Querying the Directory ..................................................................701
Summary ..............................................................................................704

Index 705
Foreword
The shift to .NET technologies is underway, bringing with it exciting opportunities that only
distributed computing makes possible. This I know to be true, having experienced the awesome
power of .NET technologies at work each day where our award-winning internal systems run
on the .NET platform.
As Chief Technology Officer at Quilogy, a provider of business solutions through digital con-
sulting, advanced hosting, and technical education, I have worked closely with Dan Fox over
the past several years learning, experimenting with, and applying new Microsoft technologies
to our own organization. For only by testing and building proven solutions for ourselves can
we be sure to provide our customers with the best, most effective solutions. Our work over the
past year to incorporate .NET strategies has been especially rewarding.
Dan’s demonstrated mastery of .NET technologies at Quilogy as well as his previous profes-
sional experiences building large-scale systems for a major oil company, extensive knowledge
of database and object-oriented systems, as well as numerous Microsoft certifications make
him uniquely qualified to write this book. Additionally, this year marks the 10th anniversary of
Visual Basic, which makes this book’s publication particularly meaningful. As we have found
for ourselves, the best way for professional VB developers to enter into the .NET sphere is
through Visual Basic .NET.
As the leading language used by corporate developers to build solutions, VB with its new .NET
qualities now can address even more of the needs and concerns of business developers, which
makes understanding it at this time so crucial. Part of the great news about .NET is that you
can move into it and still leverage your existing skills because of its multilanguage support. As
the book shows, there are some concepts and techniques you’ll need to learn, but they’ll build
on those you already have, so you can start to take advantage of all the new features and capa-
bilities that .NET has to offer.
Rather than restating Microsoft’s documentation, Dan explains the course of an application’s
development and offers wide-ranging insight as he delves into the whys, such as why VB .NET
is important, and the hows, such as how VB .NET fits into the general scheme. Additionally,
numerous code examples clearly illustrate key points and complement the book’s easy readabil-
ity. Dan is a sought-after instructor and speaker at such major events as TechEd and Developer
Days. He is also a regular contributor to several print and online magazines including Visual
Basic Programmers Journal, SQL Server Magazine, InformIT, and Advisor journals. His exem-
plary teaching methods, engaging speaking voice, and comprehensive knowledge shine through
in this book.
Currently as Technical Director, Dan is charged with helping me select technologies, set appli-
cation architecture, identify successful design patterns, and educate staff on emerging technolo-
gies. Since taking on this important position in the company, he has been instrumental in the
development of Quilogy’s breakthrough system for building portal solutions called Quilogy
Accelerator (QA). Using the code to Quilogy’s own intranet as a .NET accelerator, QA facili-
tates the process of creating portal and intranet solutions faster and less expensively than either
buying or building from scratch.
As we have found with QA and you will find as you apply .NET strategies to your own busi-
ness practices, .NET is changing the face of technological business solutions in extraordinarily
exciting new directions.
Alan Groh
CTO Quilogy
About the Author
Dan Fox is Technical Director for Quilogy in Overland Park, Kansas. Quilogy (www.quilogy.com)
is a leading Microsoft Gold Certified Partner and Solution Provider with more than 450 con-
sultants nationwide in 16 cities. Quilogy provides digital consulting and technical education
services to a wide range of clients and specializes in building solutions on the Microsoft plat-
form. As a Certified Technical Education Center, Quilogy teaches the range of Microsoft
Official Curriculum (MOC) courses and specializes in building solutions and teaching courses
using both .NET development and .NET Enterprise Servers.
Dan is a Microsoft Certified Solutions Developer, Systems Engineer, and Trainer who has been
a consultant, instructor, and managing consultant on a variety of projects. In his role as a
Technical Director, Dan provides technical guidance to Quilogy’s consultants and customers.
Before joining Quilogy in 1995, Dan worked for Chevron in Houston, Texas, and the National
Association of Insurance Commissioners in Kansas City, Missouri. Dan earned his B.S. in
Computer Science from Iowa State University in 1991.
Dan has been a frequent contributor to the Visual Basic Programmer’s Journal and has written
numerous articles for SQL Server magazine, Advisor journals, and InformIT.com. He authored
the book Pure Visual Basic from Sams and coauthored a book on the Visual Basic 6 Distributed
Exam (70-175) for Certification Insider Press. He has spoken at TechEd and several Developer
Days conferences and Microsoft events.
Dan lives in Shawnee, Kansas, with his lovely wife, Beth, and two young daughters, Laura and
Anna. Besides earning the nickname “Dan.NET” from his family, Dan spends his time reading,
enjoying movies, and as always, rooting for the Cubs.

About the Technical Reviewers


Dan Suceava is currently a Senior Programmer for Vitrix, Inc., a time-and-attendance software
company located in Tempe, Arizona. He has been developing desktop and n-tiered applications
in Visual Basic since 1996. He currently has completed working on an ASP solution that offers
time keeping over the Web to other businesses. He holds a Master’s Degree in Computer
Science from Arizona State University.
Phil Syme has been programming with C++ and Visual Basic since the release of Windows 3.1.
He helped create several enterprise-scale projects developed for Fortune 100 companies that
used Microsoft technologies. Phil has coauthored two articles published in IEEE symposiums.
Currently, Phil is writing two books with Peter Aitken, called Sams Teach Yourself Internet
Programming with C# in 21 Days and Sams Teach Yourself Internet Programming with VB .Net
in 21 Days.
Eric Wilson has been developing business applications for eCommerce, Internet, and LAN-
based solutions since 1994. Eric is certified in a variety of Microsoft solutions and has achieved
the following status with Microsoft: MCSE (Microsoft Certified Systems Engineer), MCSD
(Microsoft Certified Solutions Developer), MCT (Microsoft Certified Trainer), MCP (Microsoft
Certified Professional), and MCP + I (Microsoft Certified Professional + Internet). Currently,
Eric is the President and CEO of Web Basix, Inc., located in RTP (Research Triangle Park),
North Carolina, focusing on enterprise level application development and developer training.
Dedication
To my daughters, Laura and Anna, who are always a reminder of God’s blessings.

Acknowledgments
First, I’d to thank the Senior Acquisitions Editor on this project at Sams, Sondra Scott. From
our initial contact, she has been an encouragement and a great person to work with. She made
sure that each step in the process went smoothly and provided excellent feedback early in the
process in the form of reviews. In addition, I’d like to thank Shannon Leuma, the Development
Editor, who was ever vigilant to keep me on schedule, make sure that the content was well
organized, and made many suggestions that served to make this a better book.
Of course, the two key elements of any technical book such as this, the actual written word and
the code, were greatly improved by the copyediting skills of Mike Henry and Geneil Breeze,
and the technical reviews of Phil Syme, Dan Suceava, and Eric Wilson. The five of them made
sure that the book was readable and contained accurate information, something that was diffi-
cult given the fact that the reviewers had to work with multiple beta versions of the product for
most of the development cycle.
As you can tell from the cover and forward, this book was a team effort by Quilogy, the com-
pany for which I work. President and CEO Randy Schilling and Chief Technology Officer
Alan Groh’s encouragement and investment in the project was instrumental to making it a suc-
cess. Because the book was developed so early in the product life cycle, their willingness to
give me the resources to develop a book of this scope, including both the time and travel to
Redmond, contributed greatly to the quality of the final result. Throughout the process, Quilogy
consultants and instructors reviewed the content and provided helpful advice and suggestions.
To all these talented people, I’m certainly indebted, particularly, Tim Vanover, Dave Wanta,
Jason Wisener, Sue Van Gels, Adrian Anttila, and Cathey Barrett.
In addition, the scope and purpose of the book was shaped and honed through excellent reviews
by Ari Bixhorn, VB Product Manager at Microsoft; Steve Hoag, Senior Technical Writer for
VB User Education at Microsoft; Kyle Lutes, Assistant Professor at the Computer Technology
Department of Purdue University; Richard Nelson, Senior Software Architect at Intuitive
Manufacturing Systems; Lars Powers, Vice President/Solution Development at Acclarant, Inc.;
Mike Snell, Chief Software Architect at Acclarant, Inc.; and Larry Wall, Team Leader Microsoft
Group at Synapse Technology. Thanks to all of you for your help.
And so, as is true of any book, this one was truly a team effort. That being said, any errors are
only mine, so feel free to e-mail me at dfox@quilogy.com with corrections and suggestions.
Finally and most importantly, I couldn’t have embarked on this project without the loving sup-
port of my wife, Beth, and daughters, Laura and Anna. Beth’s continuous encouragement and
patience during this project made it much easier to accomplish, and my girls as always pro-
vided the balance that keeps my technological pursuits in perspective.
Tell Us What You Think!
As the reader of this book, you are our most important critic and commentator. We value your
opinion and want to know what we’re doing right, what we could do better, what areas you’d
like to see us publish in, and any other words of wisdom you’re willing to pass our way.
As an associate publisher for Sams Publishing, I welcome your comments. You can e-mail
or write me directly to let me know what you did or didn’t like about this book—as well as
what we can do to make our books stronger.
Please note that I cannot help you with technical problems related to the topic of this book,
and that due to the high volume of mail I receive, I might not be able to reply to every
message.
When you write, please be sure to include this book’s title and author as well as your name
and phone or fax number. I will carefully review your comments and share them with the
author and editors who worked on the book.

E-mail: feedback@samspublishing.com

Mail: Sams Publishing


800 East 96th Street
Indianapolis, IN 46240 USA
Introduction
Congratulations on stepping into the world of .NET! As you no doubt know by now, for many
developers, this is a big step. .NET in general and VB .NET in particular introduce new tech-
nology and new ways of performing familiar tasks that require attention to both conceptual and
practical issues when designing and developing software.
This introduction explains the focus, layout, illustrative style, sample application, Web site, and
intended audience of the book.

The Book’s Focus


Not all software is created equal. The architecture and techniques you use when designing and
building a forms-based application, for example, are not the same as for building a Web-based
application. Because many different types of applications require different approaches, and
thus will use VB .NET in different ways, this book focuses on building distributed applications.
By “building” distributed applications, I’m referring to the design and construction of the soft-
ware. To that end, this book focuses both on architectural issues and implementation by explain-
ing how a certain aspect of VB .NET fits into the bigger picture, and how it can or should be
used in a distributed application in addition to the details of the syntax. By distributed applica-
tions, I mean those applications that employ a Web architecture and typically are constructed in
logical services or tiers (presentation, business logic, data access). As a result, for example,
developing forms-based applications using the Windows Forms package is beyond the scope of
this book, whereas almost a quarter of the book is devoted to building presentation services
using both Web Forms and Web Services.
As mentioned, distributed applications also include building business logic and data access ser-
vices. Therefore, some of the largest chapters deal with integrating VB .NET with Component
Services and using ADO.NET and XML. Many readers might be familiar with this architecture
as Windows DNA although that marketing term refers to the previous generation of technology
including VB 6.0 and COM. Indeed, this book can be thought of as a collection of techniques
for building updated Windows DNA applications with VB .NET.
In addition, I’ve placed some emphasis on building server-based applications as well and have
included coverage on Windows service applications and employing the networking APIs in
.NET. I’ve included these topics because they often are employed as simply an additional inter-
face to a distributed application and are needed to create robust back ends for data exchange or
data loading.
2
Building Distributed Applications with Visual Basic .NET

The Book’s Layout


To walk you through the conceptual and practical issues, this book is comprised of three sec-
tions that will facilitate understanding of not only the how but also the why of building distrib-
uted applications.

Part I: .NET Concepts


Part I, “.NET Concepts,” provides an overview of the key concepts that developers need to be
aware of when undertaking projects using VB .NET. The section begins with Chapter 1, “The
Microsoft .NET Architecture,” which not only introduces the platform but also dives right into
the substrate of VB .NET, the common-language runtime (CLR) upon which everything in the
product is built. The CLR is indeed the revolutionary aspect of VB .NET, and, as you’ll see,
when put in proper context, VB .NET can simply be thought of as a tool used to build applica-
tions for the CLR, referred to as managed applications.
Although a good deal of technical information is found in Chapter 1, my intent is not to scare
off anyone. However, I think it is crucial to gain at least a surface level understanding of the
CLR because it helps make sense of many of the other concepts in VB .NET such as those dis-
cussed in Chapter 4, “Object-Oriented Features,” and Chapter 5, “Packaging, Deployment, and
Security.” In addition, Part I covers the changes and new features in both Visual Studio .NET in
Chapter 2, “The Development Environment,” and the VB language itself in Chapter 3, “VB .NET
Language Features.” Finally, the section closes with Chapter 6, “Error Handling and Debugging,”
which discusses how error handling and debugging have been improved in this version of the
product.

Part II: Enterprise Techniques


Part II, “Enterprise Techniques,” is the core of the book and is comprised of five chapters that
discuss each of the services layers (presentation, business, data access) in a distributed applica-
tion in reverse order. The section begins with Chapter 7, “Accessing Data with ADO.NET,”
which examines how the ADO.NET programming model enables you to more easily build
loosely coupled applications while taking advantage of XML.
This chapter, and the others in the section, provide examples from a sample application that
implements a simple student registration site for the company I work for, Quilogy. Quilogy
(www.quilogy.com) is a digital consulting firm that offers technical education at training cen-
ters around the country. To that end, students need to be able to query our course schedule,
register for class, review their transcript, and so on from our public Web site. The sample
application implements these features using VB .NET and is provided, along with the underly-
ing database schema, on the companion Web site (www.samspublishing.com). The application
3
INTRODUCTION

uses SQL Server 2000 on the back end, so although ADO.NET supports accessing other
providers, the examples in this section and throughout the book will focus on SQL Server.
Chapter 8, “Building Components,” discusses how components are built in VB .NET. The
chapter also looks at legacy DLLs to ensure that your existing code can be used in .NET.
Finally, a discussion on how components in VB .NET applications can be shared with .NET
Remoting is presented, which, like its precursor DCOM, often comes in handy when the sub-
systems in a distributed application need to communicate across process and machine bound-
aries. Chapter 9, “Accessing Component Services,” logically follows by discussing how
business and data access logic in VB .NET components can be integrated with Windows 2000
Component Services. This allows your VB .NET components to take advantage of the object
pooling, just-in-time activation, transactional control, and other features VB developers rou-
tinely implement in distributed applications. In addition, this chapter shows how components
built in VB .NET can interoperate with classic COM components.
Part II is rounded out with Chapter 10, “Building Web Forms” and Chapter 11, “Building Web
Services,” which cover the aspects of the presentation services layer necessary to build a Web-
based application. In large part, Chapter 10 covers the architecture and features of ASP.NET
and how they differ from ASP and then discusses in detail the Web Forms programming model
using the UI of the Quilogy sample application for illustration. Chapter 11 introduces a second
type of interface that VB .NET can produce by discussing Web Services. Because Web
Services are a new concept to many developers, this chapter provides a foundation by explor-
ing the underlying technologies involved and how they are implemented in VB .NET.

Part III: Integration


The last section of the book, Part III, “Integration,” is comprised of a collection of topics that
allow VB .NET developers to extend their code. Chapter 12, “Accessing System Services,”
covers I/O concepts, creating multithreaded applications, and a brief introduction to using
cryptography. Chapter 13, “Implementing Services,” walks through creating Windows Services
in VB .NET as well as using scheduling, the event log, performance counters, and network
communication. Finally, Chapter 14, “Integrating with the Enterprise,” examines three topics
that allow VB .NET developers to extend their reach to data sources other than relational data-
bases by using the XML classes, message queuing, and integrating with Active Directory.
As you might be aware, VB .NET largely gains its functionality from the class libraries that all
the Visual Studio .NET languages can take advantage of, which I’ll refer to as the Services
Framework. As such, you’ll notice that only Chapters 2, 3, and 4 actually discuss issues partic-
ular to VB .NET. Most of the rest of the book is simply an explication of how the classes of
the Services Framework can be used within the VB .NET language. This realization is key to
understanding VB .NET as a product and its role in Visual Studio .NET. In this way, VB .NET
Discovering Diverse Content Through
Random Scribd Documents
Cela a ses braies avalées
Qu’elle avait... fermées.

Patience, malgré le silence des auteurs, le pantalon ne devait par


tarder à faire une nouvelle apparition sous les jupes des dames. Le
Dictionnaire du Mobilier de Viollet-le-Duc en fait foi aux articles
Jarretière et Braies:
«Pour danser, les dames portaient des hauts-de-chausses
(caleçons) et des bas-de-chausses, par conséquent des jarretières.
Les caleçons portés dans les bals sous les jupes étaient commandés
par une observation d’hygiène très exacte. Pendant le XIVe siècle,
les dames portaient des jarretières de soie brodée, qui, serrées sur
le bas-de-chausses, au-dessus du genou, étaient croisées sous le
jarret et venaient s’attacher au-dessus du genou. Les caleçons
descendaient sur les jarretières plus ou moins haut et ne serraient
point la jambe»[11].
Ce fut même, suivant l’éminent architecte, l’origine du nom de
bas:
«Les femmes qui ne portaient jamais de braies à pieds, mais des
caleçons descendant aux genoux, avaient des hauts-de-chausses,
d’où le nom de bas est resté»[12].
Tandis que Viollet-le-Duc se borne à signaler l’existence du
pantalon dans la toilette féminine pour danser seulement, M. Alfred
Franklin, dans son intéressante série la Vie privée d’autrefois,
généralise cet usage, sans, malheureusement, indiquer davantage
ses sources:
«Toutes les femmes portaient des hauts-de-chausses ou caleçons,
et l’objet des jarretières était précisément de les attacher aux bas-
de-chausses ou bas, que l’on ne cherchait point à dissimuler.
L’habitude du cheval, l’ensemble un peu brusque des manières
découvraient souvent la jambe. La jarretière n’est donc pas encore
une pièce secrète du costume; on la couvre d’ornements, on y peint
des devises, des armes, des pensées, parce qu’elle est destinée à
être montrée»[13].
De son côté, Vignola confirme:
«Les châtelaines» portaient aussi une culotte d’étoffe à crevés, qui
leur permettait de chevaucher à califourchon ou en croupe»[14].
Comment les dames avaient-elles été amenées à s’attribuer cet
accoutrement viril? On est, sur ce point, réduit aux conjectures.
En dehors de l’observation d’hygiène signalée par Viollet-le-Duc,
ne faut-il pas, comme M. le professeur Nardi, de Bari, trouver
l’origine du caleçon à cette époque dans le mode de chevaucher
qu’avaient alors les femmes?
«Le pantalon des dames fut-il inventé au Moyen-Age par des maris
jaloux? Fut-il à certaine époque une ceinture cadenassée?[15] C’est
possible, quoique l’histoire reste muette sur ce point. Au Moyen Age,
les pauvres dames trottèrent à cheval par les mauvais sentiers de
l’Italie, de l’Espagne ou de la France; les selles pour femmes et pour
hommes étaient semblables. Dans ces conditions, une jeune fille
devait éviter certain froissement immédiat des arçons; et une dame
tombant de cheval, préférait ne montrer qu’un fond d’étoffe. Les
chutes de cheval ont dû donner naissance au caleçon»[16].
C’est fort vraisemblable. Mais, hypothèse pour hypothèse,—il est
bon de rire quelquefois—pourquoi, analysant ce plaisant conte du
chevalier de la Tour-Landry, que cite Gudin[17], ne pas chercher
l’origine du caleçon, ou, à plus proprement parler, du pantalon, dans
l’irrésistible besoin qu’éprouvent parfois les femmes de tromper leur
mari ou leur amant?
Celui de la dame était vieux et cordier, et la chère âme le cocufiait
avec la furie bien française dont était digne le prieur d’un couvent de
cordeliers. Les Carmes ne sont pas seuls à jouir de certaines
prérogatives.
A deux reprises, le pauvre homme faillit être convaincu de son
infortune et pincer, sans avoir recours au commissaire de police, cet
ange tutélaire des maris trompés, l’épouse coupable en flagrant
délit.
Grâce au ciel, sa voisine veillait, et l’on sait si les voisines ont
toujours été indulgentes à l’adultère de la femme. Voici comment,
pour la seconde fois, elle sut la sauver:
«Après une aultre foiz lui avint que il cuida prendre une poche aux
piez de son lit pour aler au marché a iij leues d’illec, et il prist les
brayes du prieur, et les troussa a son eisselle. Et quant il fut au
marchié et il cuida prendre sa poche, il prist les brayes, dont il fut
trop dolent et couroucié. Le prieur, qui estoit cachié en la ruelle du
lit, quand il cuida trouver ses brayes, il n’en trouva nulles, fors la
poche qui estoit de costé. Et lors, il sceut bien que le mary les avoit
prinses et emportées. Si fut la femme a grand meschief, et ala à sa
commère de rechief et luy compta son fait, et pour Dieu elle y meist
remède. Si lui dist:
«Vous prendrés mes brayes et je en prendray unes autres, et je lui
diray que nous avons toutes brayes, et ainsi se firent. Et quant le
preudhomme fut revenu moult dolent et moult courouciez, sy vint la
faulse commère le veoir, et lui demanda quelle chière il faisoit: car
mon compère, dist-elle, je me doubte que vous n’ayez trouvé aucun
mauvais encontre ou que vous n’aiez perdu du vostre.
«—Vrayment, dist le bonhomme, je n’ay rien perdu; mais je ay
bien autre pensée. Et au fort elle fist tant qu’il luy dist comment il
avoit trouvé une brayes, et quant elle l’ouy commença à rire et à lui
dire:—Ha, mon chier compère, or voi-je bien que vous estes deceu
et en voye d’estre tempté; car, par ma foy, il n’y a femme plus
preude en ceste ville que est la vostre, ne qui se garde plus
nettement envers vous qu’elle fait. Vrayment, elle et moy et aultres
de ceste ville avons prises brayes pour nous garder de ces faulx
ribaulx qui parfoiz prennent ces bonnes damoiselles à cop, et afin
que vous sachiez que c’est vérité, regardez se je les ay. Et lors elle
haulsa sa robe et luy monstra comment elle avoit brayes, et il
regarda et vit qu’elle avoit brayes et qu’elle disoit voir; si la crut et
ainsi la faulce commère la sauva par ij foi»[18].
Il est à noter que les contes du chevalier de la Tour-Landry étaient
destinés à «l’enseignement de ses filles». Que n’a-t-il écrit pour ses
fils—quand ils auraient vingt ans?—c’eût été plutôt joyeux.
Sans que son usage fût général, le pantalon féminin était donc
connu et porté par certaines au Moyen-Age.
Après être devenu la parure favorite des courtisanes de Rome et
de Venise, passant les Alpes et la Manche, il devait, au seizième
siècle, jouir d’une vogue inconnue jusque-là à la cour de France,
aussi bien qu’à celle d’Angleterre.
Vogue passagère: il ne tardera pas à disparaître des mœurs et des
dessous. Celles même qui sembleraient avoir le plus besoin de ce
vêtement protecteur le plus souvent inutile, les ballerines et les
amazones, ne voudront pour rien au monde s’en embarrasser.
Deux siècles passeront ainsi. Pour qu’à notre époque il retrouve sa
vogue et sa grâce anciennes, il faudra que chutes et scandales se
soient multipliés; que la police, cette pure gardienne des mauvaises
mœurs, soit intervenue; que par cinquante années de luttes enfin, il
soit parvenu, la crinoline aidant, à s’imposer à la femme
moderne,...à la ville et l’hiver tout au moins.
LE PANTALON FÉMININ
AU XVIe SIÈCLE
Les dames portaient, sous la cage du vertugadin en tambour, le
haut-de-chausses ajusté selon l'usage masculin.
Racinet.
C'est pour désigner les chausses de dames que le mot caleçon fut
créé.
Quicherat.
LE PANTALON FÉMININ AU XVIe
SIÈCLE
andis que Cesar ecoutoit cecy, son laquais, qui despuis fut roy
d'Espagne, estoit derriere luy pour avoir de la chair. Estant
importuné, il se retourne et luy dit: Cap de biou, mon laquais, je
vous donneray mornifle: et tout sert. Si tu veux de la chair, prends-
toy aux fesses.
«Boece.Il a mis cela en effect et est cause qu'il y a tant de dames
bossues, d'autant qu'il sçavoit en plusieurs lieux que celles qu'il
attraperoit, il les happeroit aux fesses, comme estant les plus
savoureuses et mieux faisandées; joint qu'il estoit assez aisé, parce
qu'alors les dames n'avoient point de culotte. Il est vray, ouy; je ne
dis point comme les autres fois, quand je mentois par oüy-dire. Je
l'ay veu: c'est que, pour crainte que cela n'advint, plusieurs ont fait
faire des caleçons, ou brides à fesses, afin de se garantir; et les
autres qui n'avoient pas cette industrie, pour sauver leur cul,
craignant la dent laquaisme, ont mis la chair de leurs fesses sur leurs
épaules. Cela est donc la cause des bossues[19].»
Telle serait suivant Béroalde de Verville l'origine du pantalon
féminin. Je la donne pour ce qu'elle vaut, substituant, bien entendu,
d'après la sagace interprétation de Paul Lacroix Charles-Quint à
César.
Bien que, dans des conditions analogues, des religieuses d'Outre-
Rhin se soient, à la fin du XVIIIe siècle, confectionné à la hâte des
caleçons à l'approche des troupes françaises, ce n'est là évidemment
qu'une boutade du conteur.
Mais elle est intéressante en ce qu'elle signale la nouveauté de la
mode qui commençait à sévir sous les jupes des dames et des
demoiselles. Brantôme, Taboureau des Accords, Henri Estienne,
confirmeront le dire de Béroalde et ne craindront pas de parler plus
longuement des caleçons de leurs contemporaines.
Si les soldats de Charles-Quint ne furent pour rien dans cette
petite révolution intime, Catherine de Médicis et les modes qu'elle
importa d'Italiesans compter sa façon particulière de monter à
chevalsemblent, au contraire y avoir été pour beaucoup.
A effet semblable, cause semblable. De même que, sous le Second
Empire, la crinoline et les cages devaient imposer et généraliser
l'usage du pantalon, les vertugades, qui écartaient et faisaient
ballonner les jupes, furent, vraisemblablement, sous Charles IX, son
auxiliaire le plus puissant.
Il ne les accompagna pas tout d'abord, il est vrai. Au début du
règne, les filles de CatherineBrantôme est très affirmatif sur ce
pointne portaient point de caleçons. A défaut de ce correctif
nécessaire, les pauvres dames commencèrent par aller quasiment
nues sous l'énorme cloche de leurs jupes, et la Complainte de M. le
Cul les railla assez gaillardement:
Ces vertugalles ouvertes
Laissent les fesses découvertes[20]

L'on ne tarda guère pourtant à y mettre bon ordre:


«Par-dessus le corps piqué fut mis un pourpoint auquel
s'attachaient les chausses. Les femmes furent amenées par la mode
des jupes écartées à s'approprier cet attribut tout viril. C'est pour
désigner les chausses de dames que le mot caleçon fut crée»
(Quicherat)[21].
Le mot n'aurait-il pas été imité, plutôt, de l'italien calzone, comme
l'indique M. le professeur Nardi? l'objet, comme les vertugades, dont
il corrigeait les écarts et l'indiscrétion, semblant venir d'Italie.
Taboureau des Accords donne, cependant, une étymologie, très
française, si française même que sa gauloiserie me force à la passer
sous silence. C'est de la linguistique: les premières lignes suffiront à
donner le ton du morceau. Elles ont, également, le mérite d'établir la
nouveauté du mot et de la chose:
«On dit que quand les dames de la Cour commencèrent à porter
des hauts-de-chausses, elles firent une convocation générale pour
sçavoir comment elles les nommeroient, à la différence de celles des
hommes: Enfin, du consentement de toutes, elles furent surnommez
de ce nom caleson...»[22].
Henri Estienne, signale en moraliste, ou peu s'en faut, cette mode
nouvelle.
Il y a, avec de l'esprit et du gai savoir en plus, du Père la Pudeur
dans ses appréciations:
«Celtophile.—Or ça, les vertugales ou vertugades qui avoyent la
vogue de mon temps, sont-elles demeurées?
Philosaune.—Ouy, mais elles ont depuis commancé à porter aussi
une façon de haut-de-chausses qu'on appelle des calçons; et comme
elles portent des hauts-de-chausses, aussi portent-elles des
pourpoints: tellement que vous en verriez maintenant beaucoup en
chausses et en pourpoint, aussi bien que les hommes.
Celtophile.—De mon temps cela eust esté trouvé fort estrange.
Philosaune.—Elles ont toutesfois quelque excuse honneste à ceste
sorte d'habillement, je ne dis pas simplement Excuse honneste,
comme on parle ordinairement, mais regardant à l'honnesteté
qu'elles allèguent.
Celtophile.—Comment?
Philosaune.—Qu'elles usent de ces calçons, pour ce qu'elles ont
l'honnesteté en grande recommandation. Car outre ce que ces
calçons les tiennent plus nettes, les gardans de la poudre (comme
aussi ils les gardent du froid), ils empeschent qu'en tumbant de
cheval, ou autrement, elles ne mostrent ha cryptein ommat'
arsen[Greek: omega]n chre[Greek: omega]n: pour user des mots
d'Euripide, où il parle de l'honnesteté de Polyxene, alors mesme
qu'elle allet tumber du coup de la mort.
Celtophile.—I'enten bien ces mots d'Euripide, Dieu merci.
Philosaune.—Ces calçons les asseurent aussi contre quelques
ieunes gens dissolus, car venans mettre la main soubs la cotte, ils ne
peuvent toucher aucunement leur chair. Mais comme l'abus vient en
toute chouse encore que l'invention ne soit pas abusive, quelques-
unes de celles qui au lieu de faire lesdits calçons de toile simple, les
font de quelque estoffe bien riche, pourroyent sembler ne regarder
pas aux chouses que nous avons dictes: mais en se mettant en
chausses et en pourpoint, vouloir plustost attirer les dissolus que se
défendre contre leur impudence»[23].
Donnant à cette nouveauté une raison moins honnête, le regretté
Henri Bouchot, mettait en jeu, dès le début, dans ses Femmes de
Brantôme, la coquetterie bien plus que la pudeur:
«Les maigres ont imaginé mille supercheries pour sauver les
apparences; elles portent des caleçons rembourrés à la façon des
hauts-de-chausses masculins, on a dit par pudeur en dansant la
volte, mais en réalité pour mouler la jambe à leur gré. Du Billon dans
son zèle excessif, mettait au compte de Sémiramis cette invention
biscornue, «tant pour se garder du vent de bise que de la main trop
légère des mignons»; mais le caleçon ne dépendait ni de l'une ni des
autres comme de bien entendu, il était un objet de luxe, une
tromperie. Que de fois la main légère s'égarait sur des tailles
robustes et souples où des cartons élastiques suppléaient aux vices
de nature. Tout est postiche à la cour de France, il n'y a guère que
les dents qu'on ne sache remplacer encore; les patins laissent croire
à l'élégance, les caleçons arrondissent les jambes grêles, les cheveux
rapportés augmentent la chevelure naturelle détruite par les
pommades et les cosmétiques»[24].

Messire Loys Guyon, Dolois, sieur de la Nauche, que nous aurons


occasion de retrouver au sujet d'une jeune fille qui, comme les
Catayennes, n'en portait pas, dit et vante, d'autre part, la richesse
de ces caleçons:
«Les femmes et filles de par deça semblent avoir opinion que les
hommes désirent qu'elles ayent les fesses et les cuisses grosses et
rebondies, comme les Catayens[25] par ce qu'elles s'estudient à
persuader cela aux hommes, par leurs amples vertugadins qu'elles
portent. Davantage, elles font plus que icelles Catayennes, d'autant
qu'icelles avoyent les fesses et cuysses sous leurs vestemens nües,
et les femmes de par deça revestent ces parties de calçons, non pas
de petite estoffe, comme de toille, ou de futaine, mais de satin,
taffetas, veloux toille d'or et d'argent, qu'on ne leur fait monstrer; au
contraire, par nos loix, celles qui les monstrent librement, et sans
raison, sont infames: il eust été bien plus seant aux Catayennes de
porter des calçons de ces riches estoffes, pour encore adiouster de
la grace et allechement à ces parties, pour estre recherchees des
hommes, pour les avoir à mary, que non pas à celles de par deçà,
comme j'ay dit, qui ne leur est permis de les monstrer, encor moins
de se laisser toucher. Ce qui donne occasion à plusieurs, de penser
telles femmes, qui usent de ces façons de faire n'estre chastes»[26].
Une finale qui ressemble fort à celle d'Henri Estienne. L'on sait si
les héroïnes de Brantôme se gênaient peu pour montrer leurs
caleçons et les laisser toucher. Mais qui songea, jamais, à les taxer
de pruderie?
Tous les historiens du costume, Racinet, Challamel, Ary Renan et
autres ne manquent point de mentionner, avec plus ou moins de
détails, cette intrusion du haut-de-chausses dans la toilette féminine.
Racinet et Challamel se montrent, toutefois, moins affirmatif que
Quicherat:
«Les dames portaient sous la cage du vertugadin en tambour, le
haut-de-chausses ajusté selon l'usage masculin; on lui donnait le
nom de caleçon, mais il ne différait pas de celui des hommes; il était
attaché à un pourpoint mis pardessus le corps piqué, ou corset à
armature; les bas de soie de Naples ou d'Espagne étaient attachés
au caleçon avec des aiguillettes ou retenus sous la jarretière comme
on le faisait pour le haut-de-chausses; leur couleur était intense, on
les portait rouges, violets, bleus, verts, noirs»[27].
Culotte d'homme plutôt que pantalon féminin. Ce travesti rappelle
les courtisanes italiennes bien plus que les honnêtes dames du
seigneur de Bourdeilles, «chose italienne», dont Racinet nous fournit
cet autre exemple:
«Peut-on généraliser l'étrange alliance du costume féminin et du
costume masculin dont l'exemple, particularisé par Vecellio et
Bertelli, se rencontre ici? On voit par les gravures d'Abraham Bosse
qu'au moins cette mode bizarre ne s'était point propagée parmi les
courtisanes du nord de l'Europe pendant la première partie du XVIIe
siècle. Quant aux grandes dames françaises, l'habitude que
Catherine de Médicis leur fit prendre, selon Brantôme, de
chevaucher en mettant la jambe dans l'arçon, au lieu de continuer à
être assises sur leur monture en ayant les pieds posés sur la
planchette, pouvait bien avoir contribué à leur faire adopter par-
dessous leurs jupes le complément du costume masculin; leur
corsage clos, avec les épaulettes et le mancheron, se rapprochait
déjà fort du pourpoint.
«Tous les visiteurs de l'Exposition du costume organisée aux
Champs-Élysées, en 1874, par l'Union centrale, ont pu y voir le
portrait en pied, de grandeur naturelle, contemporain de l'époque
dont nous nous occupons, représentant une dame richement vêtue,
qui porte la culotte descendant aux genoux, transparaissant sous
une jupe de gaze des plus claires. Le cas est certes rare, mais il ne
paraissait pas que cette dame fût une courtisane[28]».
Pour Robida, la jambe passée dans l'arçon donna lieu à cette autre
innovation:
«Les femmes empruntèrent au costume masculin une espèce de
pourpoint à hauts-de-chausse qui se mettait sous la robe. Ces
caleçons, ainsi s'appelaient-ils, permettaient, malgré les larges jupes,
d'enfourcher plus commodément les arçons[29]».
Quant à M. Augustin Challamel—sans appuyer son dire sur aucun
texte—il se contente de considérer le caleçon des dames de la cour
comme l'exception et non comme la règle:
«Quelques-unes portèrent des caleçons par-dessous leurs robes.
Mais cette mode ne fut pas généralement adoptée, parce qu'elle ne
s'accordait guère avec les accessoires du costume»[30].
L'Histoire de la Mode peut avoir été écrite pour les jeunes filles, ce
n'est pas une raison pour ignorer à ce point l'œuvre de Brantôme.
Elle fourmille de détails précieux pour qui veut décrire les
élégances du passé: malgré l'encre bleue que devait l'auteur à ses
lectrices, elle ne lui aurait point permis de se montrer aussi
affirmatif.
LES HÉROINES DE BRANTOME
LES COURTISANES DE VENISE ET DE ROME
Cette curiosité qu'elle avoit d'entretenir sa jambe ainsi belle faut
penser que ce n'estoit pour la cacher sous sa juppe, ny son cotillon
ou sa robbe, mais pour en faire parade quelques fois avec de beaux
callessons de toille d'or et d'argent, ou d'autre estoffe, très
proprement et mignonnement faits, qu'elle portoit d'ordinaire.
Brantôme.
La richesse des callessons de la Signora Livia.
Montaigne.
LES HÉROINES DE BRANTOME
LES COURTISANES DE VENISE ET DE ROME
outes les héroïnes de Brantôme, ou presque, portent, en effet,
des pantalons. Parfois même, ils sont de toile d'or ou d'argent;
volontiers, elles les laissent voir, soit pour montrer leur jambe
qu'elles savent belles, soit sous l'effort de quelque main malhonnête,
friande de rondeurs et d'intimités plus haut placées.
Ces caleçons, un satirique anonyme cité par Pierre de l'Estoile, les
chansonnera:

Pour les dames et damoiselles


Sont cent mille modes nouvelles;
Pignouers, tabliers et calessons,
Coiffures de cinq cents façons[31]...

Brantôme n'a garde, en attendant, d'omettre de détailler les


dessous de ses amoureuses. Il célèbre le luxe de leurs culottes ou
dit si elles n'en ont pas.
Deux grandes dames—sans doute élevées dans un pensionnat de
Lesbos—apparaissent ainsi, «toutes retroussées et leurs caleçons
bas», à un écolier, qui, l'œil collé à un trou de la cloison, suit
avidement cette leçon de choses...
Ce bon monsieur de Bourdeilles décrit même assez gentiment la
scène; mais les mœurs sévères qui nous régissent m'empêchent de
suivre son exemple. Baudelaire fut poursuivi pour moins et je serais
inconsolable de faire condamner à mon tour la grande Sapho et de
faire une peine même légère à ces enfants fidèles au «rite inventé».
Je préfère renvoyer l'«hypocrite lecteur» que «ces choses»
peuvent amuser au premier discours des dames galantes où elles
sont décrites par le menu[32].
Telle autre, une Espagnole, qu'un compagnon du conteur connut à
Rome dans un sens à satisfaire pleinement l'Écriture, avait vis-à-vis
de son serviteur des exigences un peu déconcertantes:
«Quand il l'accostoit elle ne vouloit permettre qu'il la vist, ny qu'il
la touchast par ses cuisses nues, sinon avec ses calsons»[33]...
Singulière pudeur, dira-t-on, et des âmes naïves pourront se
demander si c'était la conséquence d'un vœu?
Non pas: la dame avait simplement une cuisse plus maigre que
l'autre.
Mais on peut conclure de cette anecdote que les pantalons de ces
«cinq à sept» étaient forcément ouverts, tandis que ceux du petit
ménage, qui, de nos jours, eût si volontiers fréquenté le Hanneton,
étaient fermés comme ceux de Claudine ou de la Môme Picrate.
Le caleçon ne se contente pas de voiler: il supplée, corrige et
rembourre au besoin. Rien n'est nouveau sous le soleil, ni même
sous la lune, et le coton n'avait pas attendu la création de notre
Académie nationale de musique et la divine aventure de Cléo de
Mérode, pour jouer dans les ballets et la figuration le rôle que l'on
sait.
«A quoy pour suppleer, telles dames sont coustumières de s'ayder
de petits coissins bien mollets et delicats à soustenir le coup et
engarder de la mascheure; ainsy que j'ai ouy parler d'aucunes, qui
s'en sont aydees souvent, voire des callesons gentiment rembourrez
et faits de satin, de sorte que les ignorants, les venans à toucher, n'y
trouvent rien que tout bon, et croyent fermement que c'est leur
embonpoint naturel: car, par-dessus ce satin, il y avoit des petits
callesons de toille volante et blanche; si bien que l'amant donnant le
coup en robbe, s'en alloit de sa dame si content et satisfait, qu'il la
tenoit pour très bonne robe[34]».
Cela faisait, si je ne m'abuse, deux caleçons au lieu d'un et ce
«coup en robbe» induit non moins à supposer qu'ils étaient ouverts
l'un et l'autre.
Quelques-unes, pourtant, avaient déjà la fâcheuse habitude de les
porter fermés, et, non plus une petite amie, mais le Balafré, suivant
M. Lalanne, de déchirer de sa main brutale, dans une embrasure de
fenêtre, cette malencontreuse lingerie:
«L'autre frère, sans cérémonie d'honneur ny de parole, prit la
dame à un coing de fenestre, et, luy ayant tout d'un coup escerté
ses calleçons qui estoyent bridez, car il estoit bien fort, luy fit sentir
qu'il n'aimoyt point à l'espagnole, par les yeux, ny par les gestes du
visage, mais par le vrai et propre point et effet qu'un vray amant
doit souhaitter; et ayant achevé son prix fait s'en part de la
chambre[35]».
Ouverts ou fermés? grave question dont la solution était déjà
soumise, comme on voit, au gré et à la fantaisie de chacune. Il est
de petits plaisirs passagers auxquels il n'est pas bon d'opposer, si
illusoire soit-il, l'obstacle d'une toile d'or ou d'argent. Celles que ne
tentent pas l'imprévu furent toujours l'exception: elles seules les
portaient «bridez» et le conteur prenait soin de le noter.
Comme Béroalde, comme Taboureau, comme Estienne, Brantôme
signale la nouveauté de cette mode. Vingt-cinq ou trente ans plus
tôt, on n'en portait pas encore. C'était le cas des filles de Catherine
de Médicis, qui, au début du règne, ignoraient ce travesti sous la
jupe et la reine de prendre à leur endroit, ou mieux à leur envers,
des privautés auxquelles l'éducation anglaise et quelques vieux
messieurs sont seuls restés fidèles:
«Aucunes fois sans les despouiller, les faisoit trousser en robe, car
pour lors elles ne portoyent point de calsons, et les claquetoit et
fouettoit sur les fesses, selon le sujet qu'elles lui donnoyent ou pour
les faire rire, ou pour plorer[36]».
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like