问题
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