wrap a noninheritable class in vb.net

守給你的承諾、 提交于 2020-01-15 12:39:09

问题


I would like to use a class Cookie in my namespace for convenience, with the same capabilities as System.Web.Cookie, or better be equivalent. I can't derive from System.Web.Cookie because it is noninheritable...

In C, i could simply typedef it to another type, but I don't see any possibility in VB.net other than write a wrapper class that mimics all functions.

Is there another way to "rename" a type in VB.net (Framework 4.0)?

Edit:

I found a solution, to import the class under a different name:

imports Cookie = System.Web.HttpCookie

But I would still be interested in other solutions. Therefore I didn't add this as answer.

来源:https://stackoverflow.com/questions/10945737/wrap-a-noninheritable-class-in-vb-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!