Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8105137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:05:14+00:00 2026-06-06T00:05:14+00:00

Background info: I’m using Microsoft Visual C# 2010 for this project. I want to

  • 0

Background info:

I’m using Microsoft Visual C# 2010 for this project. I want to use a class, System.IO.DirectoryInfo, to get a directory listing. However, the implementation of GetDirectories() doesn’t work for me, since upon throwing an UnauthorizedAccessException exception, the function fails.

I would like to create a DLL that defines a derived class having the same functionality of the DirectoryInfo class, but overrides GetDirectories() so I can have the functionality I need.

The problem:

I must be doing something wrong when trying to call the base constructor. I get the error “‘object’ does not contain a constructor that takes 1 arguments”.

using System;
using System.IO;

namespace CompanyName.System.IO
{
    public class FlexibleDirectoryInfo : DirectoryInfo
    {
        public FlexibleDirectoryInfo(string path) : base(path) {}
        [...]

DirectoryInfo does not have a default constructor, and instead has a single constructor taking a string parameter, just like I’m trying to do. However, I’m not sure if it’s resolving the base constructor properly?

I have a feeling this is a simple fix. Please just help point out what I’m overlooking. 🙂

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:05:16+00:00Added an answer on June 6, 2026 at 12:05 am

    DirectoryInfo is a sealed class. So you cannot derive from it.
    From MSDN:

    public sealed class DirectoryInfo : FileSystemInfo

    However, you create a class that inherits FileSystemInfo (superclass for DirectoryInfo). You’ll have to create most of the implementation, but it’s the only way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background-info: I'm using Microsoft Visual Web Developer 2010 Express. Info about my (lack of)
Background info: I'm coding with C#, using Microsoft SQL Server for databases. I didn't
Bit of Background info, I'm using An NSOutlineView with Core Data. This Is What
Background Info: Windows 7, Visual C++ 2010 Express Problem: CreateProcess() keeps returning with 'Invalid
Background info I'm developing a visual form designer in which people with no coding
Background info : I was handed a Tool, which was made using MS-Access 2007,
Background info: I've recently decided to take on a project of making a social
Background info I recently handed in an assigment for my class on algorithms and
First I will give a little background info so this question isn't completely without
Quick background info: of the three database tables that are relevant for this question,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.