动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   .Net → 阅读文章

 .NET Framework Namespaces

作者:未知 来源:CSDN 
阅读 86 人次 , 2008-5-9 16:37:00 

.NET Framework Namespaces
What is a namespace? If Microsoft had simply provided a list of several
thousand classes, attempting to find or work with any specific class would
be next to impossible. Although we're speculating, Microsoft might have
ended up using class names such as SystemDataOleDbDataSet and
SystemTheadingThread. Long names would be required in order to provide some
sort of groupings and perspective.

Instead, Microsoft chose to group the various classes into a hierarchical
set of namespaces. Using a syntax that separates levels in the hierarchy
with dots, you'll find yourself referring to classes like this:

System.Data.OleDb.OleDbDataReader

In this example, the .NET Framework provides a System namespace, a
System.Data namespace, and a System.Data.OleDb namespace. Each provides a
set of classes, and the OleDbDataReader class is a part of the
System.Data.OleDb namespace.

Imagine this scenario: You'd like to send a letter to a friend named Tom
who lives across the country, and you address an envelope to Tom (just
"Tom"), slap on a stamp, and drop it into a mailbox. What's the chance that
the letter will get to your friend? Next to none. If the U.S. Postal
Service had assigned each of us a local "namespace" consisting of
postalcode.state.city.streetaddress, then you might address your letter to
90012.ca.los angeles.123 Smith Street and have it reach your friend.
Microsoft faced the same sort of issue when developing the .NET Framework.
Therefore, each class belongs to a single namespace, and you'll use the
.NET Framework documentation to investigate the various classes and
namespaces.

You are probably asking yourself, which namespaces will I use most often?
This chapter discusses those namespaces you might utilize for typical Web-
or Windows-based business applications. This chapter will not (nor could
it) provide a full reference of every available namespace梩hat would take
several books itself.

The task of limiting the classes to be discussed in this chapter was
daunting梩here are well over 1,000 classes provided by the .NET Framework.
We decided to focus on classes that you're likely to use in applications
that take advantage of Windows Forms, Web Forms, Web Services, databases,
and XML. By using these rather broad areas as the basis for choosing the
namespaces, the list of classes we've included is large but not
overwhelming. Once you understand some of these objects, working with other
objects is easier.

Here's a list of the namespaces covered in this chapter:

System

System.Data

System.Data.OleDb

System.Data.SqlClient

System.IO

System.Text

System.Collections

System.Web.Services

System.Windows.Forms

System.Xml

Although this seems like quite a lot of classes to cover, we'll only
provide a brief introduction to them in this chapter. You will find more
coverage of many of these namespaces in later chapters in the book.

TIP

In order to follow along with the discussion in this chapter, you can load
the Jumpstart\FrameworkClasses\FrameworkClasses.sln solution into Visual
Studio .NET.
  
 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:ASP.NET中实现直接从网页上下载文件,而不须引用文件URL来下载
· 下一篇:.Net FrameWork SDK文档的例子演示
· vs.net 2003在FAT32格式的系统中安装
· JSP教程(五)-JSP Actions的使用下
· ASP.NET: Connection Strings
· 变数
· 10天学会ASP.net之第七天


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077