多个类和命名空间 [英] Multiple Classes and Namespace

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

问题描述

我知道VB.Net中不可能有多个类继承我也知道我可以:


继承类a


并且在课堂上a:


继承课程b

和课程b:


继承System.Web.UI.Page


依此类推,从而让我有效地继承

通过继承我的代码中的类a来支持a,b,c和system.windows.forms.form。现在,针对手头的问题。假设我需要使用以下内容从系统命名空间继承我的项目




继承System.Web.Services.WebService


而且我还需要继承类a,b和c ...我怎样才能使

发生?似乎我可以通过上面描述的hierarhy调用它们来导入无限量的自定义

类。但是,

使用这种方法,我最终只能从一个系统继承整个项目中的
名称空间,而且我有一个项目需要

继承了WebService和WebPage类...我该怎么做?

提前致谢!

I know that multiple class inheritance is not possible in VB.Net I also
know that I can:

inherit class a

and in class a:

inherit class b

and in class b:

inherit System.Web.UI.Page

and so on and so forth, thus allowing me to effectively "inherit"
classes a, b, c, and system.windows.forms.form by inheriting class a in
my code. Now, for the question at hand. Lets say I need my project to
inherit from a system namespace, using the following:

Inherits System.Web.Services.WebService

And I also need to inherit classes a, b, and c... How can I make that
happen? It seems like I can import an unlimited amount of custom
classes by calling them via the hierarhy I described above. However,
using this method, I can only ultimately inherit from one system
namespace in the entire project, and I have a project that needs to
inherit both the WebService and WebPage classes... how can I do that?
Thanks in advance!

推荐答案

Elroy,


当我知道你想要建造一些奇怪的东西时,我正在回答。


你想要建立什么,一个充当网络服务的网页或

的东西。


你无法建立一个马里面放着一匹马跟着一匹马

继承汽车。


只是我的想法


Cor

" Elroyskimms" < el ********* @ yahoo.com>

..
Elroy,

I was making an answer while I got the idea that you are trying to build
something strange.

What are you trying to build, a webpage that acts as a webservice or
something.

You can not build a horse with a carengine inside by letting a horse
inheriting from cars.

Just my thought

Cor
"Elroyskimms" <el*********@yahoo.com>
..
我知道VB.Net中不可能有多个类继承我也
知道我可以:

继承上课a

并在课堂上:

继承课程

/>和b类:

继承System.Web.UI.Page

依此类推,从而使我能够有效地继承
通过在我的代码中继承类a来分类a,b,c和system.windows.forms.form。现在,针对手头的问题。让我说我需要我的项目继承系统命名空间,使用以下内容:

继承System.Web.Services.WebService

我还需要继承a,b和c类...我怎样才能发生这种情况?似乎我可以通过上面描述的hierarhy调用它们来导入无限量的自定义类。但是,使用这种方法,我最终只能从整个项目中的一个系统名称空间继承,而且我有一个项目需要继承WebService和WebPage类......我怎么能这样做?
提前致谢!
I know that multiple class inheritance is not possible in VB.Net I also
know that I can:

inherit class a

and in class a:

inherit class b

and in class b:

inherit System.Web.UI.Page

and so on and so forth, thus allowing me to effectively "inherit"
classes a, b, c, and system.windows.forms.form by inheriting class a in
my code. Now, for the question at hand. Lets say I need my project to
inherit from a system namespace, using the following:

Inherits System.Web.Services.WebService

And I also need to inherit classes a, b, and c... How can I make that
happen? It seems like I can import an unlimited amount of custom
classes by calling them via the hierarhy I described above. However,
using this method, I can only ultimately inherit from one system
namespace in the entire project, and I have a project that needs to
inherit both the WebService and WebPage classes... how can I do that?
Thanks in advance!



Elroy,


我正在制作一个答案,当我知道你正在努力构建

奇怪的东西。


你想要建立什么,一个充当网络服务的网页或者

的东西。


你不能用马来制造一匹带有马桶的马。

继承汽车。


只是我的想法


Cor

" Elroyskimms" < el ********* @ yahoo.com>

..
Elroy,

I was making an answer while I got the idea that you are trying to build
something strange.

What are you trying to build, a webpage that acts as a webservice or
something.

You can not build a horse with a carengine inside by letting a horse
inheriting from cars.

Just my thought

Cor
"Elroyskimms" <el*********@yahoo.com>
..
我知道VB.Net中不可能有多个类继承我也
知道我可以:

继承上课a

并在课堂上:

继承课程

/>和b类:

继承System.Web.UI.Page

依此类推,从而使我能够有效地继承
通过在我的代码中继承类a来分类a,b,c和system.windows.forms.form。现在,针对手头的问题。让我说我需要我的项目继承系统命名空间,使用以下内容:

继承System.Web.Services.WebService

我还需要继承a,b和c类...我怎样才能发生这种情况?似乎我可以通过上面描述的hierarhy调用它们来导入无限量的自定义类。但是,使用这种方法,我最终只能从整个项目中的一个系统名称空间继承,而且我有一个项目需要继承WebService和WebPage类......我怎么能这样做?
提前致谢!
I know that multiple class inheritance is not possible in VB.Net I also
know that I can:

inherit class a

and in class a:

inherit class b

and in class b:

inherit System.Web.UI.Page

and so on and so forth, thus allowing me to effectively "inherit"
classes a, b, c, and system.windows.forms.form by inheriting class a in
my code. Now, for the question at hand. Lets say I need my project to
inherit from a system namespace, using the following:

Inherits System.Web.Services.WebService

And I also need to inherit classes a, b, and c... How can I make that
happen? It seems like I can import an unlimited amount of custom
classes by calling them via the hierarhy I described above. However,
using this method, I can only ultimately inherit from one system
namespace in the entire project, and I have a project that needs to
inherit both the WebService and WebPage classes... how can I do that?
Thanks in advance!



Cor,


我为延迟回应...但是,是的,我正在努力构建一些奇怪的东西(我从不挑选那些简单的东西)。这是一个概念:


我有一个Web服务,它运行得很好。多个服务器连接到Web服务的
,它执行其特殊魔法。正如预期的那样,我对结果非常满意。输入想要对系统进行更改的客户...


当Web服务完成后,我需要它来传递XML文件

使用HTTP GET / POST,然后从GET / POST

操作中捕获XML响应。我可以毫无问题地使Web服务GEt / POST,但

我用来捕获响应的XMLTextReader是

System.Web.UI.Page类的一部分,我不能在我的网站

服务中继承该课程。是否有与Web服务等效的XMLTextReader?样品

代码?谢谢你的帮助!


-Elroyskimms

Cor Ligthert写道:
Cor,

I apologize for the delayed response... but yes, I am trying to build
something strange (I never pick the easy ones). Here is the concept:

I have a Web Service, it works very well. Multiple servers connect to
the Web Service, it performs its "special magic" as expected and I am
very happy with the result. Enter the customer who wants to make a
change to the system...

When the Web Service is finished, I need it to pass along an XML file
using HTTP GET/POST and then capture an XML response from the GET/POST
operation. I can make the Web Service GEt/POST without a problem, but
the XMLTextReader I use to capture the response is part of the
System.Web.UI.Page class, and I cannot inherit that class within my Web
Service. Is there an XMLTextReader equivalent for a Web Service? Sample
code? Thanks for your help!

-Elroyskimms
Cor Ligthert wrote:
Elroy,

我当我想到你想要
构建一些奇怪的东西时,我正在回答。

你想要构建什么,一个充当web服务的网页或者什么东西? 。

你不能通过让马继承汽车来制造一匹带有马桶的马。

只是我的想法

Cor

" Elroyskimms" < el ********* @ yahoo.com>
Elroy,

I was making an answer while I got the idea that you are trying to build something strange.

What are you trying to build, a webpage that acts as a webservice or
something.

You can not build a horse with a carengine inside by letting a horse
inheriting from cars.

Just my thought

Cor
"Elroyskimms" <el*********@yahoo.com>
.
我知道VB.Net中不可能有多个类继承I
也知道我可以:

继承课程

并在课堂上a:

继承课程

并在课堂上b:

继承System.Web.UI.Page

依此类推,从而让我有效地继承了类a,b ,c和system.windows.forms.form通过在我的代码中继承类
a。现在,针对手头的问题。让我说我需要我的项目
继承系统名称空间,使用以下内容:

继承System.Web.Services.WebService

我还需要继承类a,b和c ...如何才能使
发生?似乎我可以通过上面描述的hierarhy调用它们来导入无限量的自定义类。
但是,使用这种方法,我最终只能从整个项目中的一个系统名称空间继承,并且我有一个项目需要继承WebService和WebPage类...我该怎么办
那个?提前致谢!
I know that multiple class inheritance is not possible in VB.Net I also know that I can:

inherit class a

and in class a:

inherit class b

and in class b:

inherit System.Web.UI.Page

and so on and so forth, thus allowing me to effectively "inherit"
classes a, b, c, and system.windows.forms.form by inheriting class a in my code. Now, for the question at hand. Lets say I need my project to inherit from a system namespace, using the following:

Inherits System.Web.Services.WebService

And I also need to inherit classes a, b, and c... How can I make that happen? It seems like I can import an unlimited amount of custom
classes by calling them via the hierarhy I described above. However, using this method, I can only ultimately inherit from one system
namespace in the entire project, and I have a project that needs to
inherit both the WebService and WebPage classes... how can I do that? Thanks in advance!






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

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