为什么我不能继承IO.Directory? [英] Why Can't I Inherit IO.Directory?

查看:103
本文介绍了为什么我不能继承IO.Directory?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不能在VB.NET中创建inherits System.IO.Directoryclass?根据Lutz Roeder的说法,不是声明为NotInheritable

Why can't I create a class in VB.NET that inherits System.IO.Directory? According to Lutz Roeder, it is not declared as NotInheritable!

我想创建一个utility class来为Directory class添加功能.例如,我想添加一个Directory.Move函数.

I want to create a utility class that adds functionality to the Directory class. For instance, I want to add a Directory.Move function.

请告知,我将给您寄六包.好的,没关系,我什么都不会寄给您,但是如果您今晚来酒吧,我会勾住您,然后在游泳池中殴打您.

Please advise and I will send you a six pack. OK nevermind I'm not sending you anything but if you come to the bar tonight I will hook you up and then beat you in pool.

推荐答案

来自.NET的元数据

namespace System.IO
{
    // Summary:
    //     Exposes static methods for creating, moving, and enumerating through directories
    //     and subdirectories. This class cannot be inherited.
    [ComVisible(true)]
    public static class Directory

您不能从静态类继承.

这篇关于为什么我不能继承IO.Directory?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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