C#中的命名空间和子命名空间 [英] Namespaces and subnamespaces in C#

查看:481
本文介绍了C#中的命名空间和子命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于C#的入门者问题.

begginers question about C#.

在每个程序中,我都必须包含几个名称空间,例如:

In every program I have to include several namespaces, like:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

为什么必须包括:

using System.Collections.Generic;
using System.Linq;
using System.Text;

...因为它们包含在第一个中:

... since they are included with first one:

using System;

提前谢谢!

推荐答案

因为父命名空间不包含嵌套名称空间.有关详细信息,请参见使用指令文档

Because nested namespaces are not included with parent one. See using directive documentation for details

使用指令不能使您访问嵌套在您指定的名称空间中的任何名称空间.

A using directive does not give you access to any namespaces that are nested in the namespace you specify.

这篇关于C#中的命名空间和子命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆