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

  • SEARCH
  • Home
  • 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 410347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:52:46+00:00 2026-05-12T17:52:46+00:00

In classic Asp we used the File.Type property to get the friendly name associated

  • 0

In classic Asp we used the File.Type property to get the friendly name associated with a file type from the registry (e.g. “Text Document” for “.txt”). The FileInfo class which generally replaces the old COM object doesn’t replicate this feature and so far I’m not having much success in my search of a replacement.

  • 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-05-12T17:52:47+00:00Added an answer on May 12, 2026 at 5:52 pm

    I’m not aware of a method in the BCL, but you could easily read it from the Registry:

    using System;
    using Microsoft.Win32;
    
    class Program
    {
        static void Main(string[] args)
        {
    
            string extension = ".txt";
            string nicename = "";
    
            using (RegistryKey key = Registry.ClassesRoot.OpenSubKey(extension))
            {
                if (key != null)
                {
                    string filetype = key.GetValue(null) as string;
                    using (RegistryKey keyType = Registry.ClassesRoot.OpenSubKey(filetype))
                    {
                        if (keyType != null)
                        {
                            nicename = keyType.GetValue(null) as string;
                        }
                    }
                }
            }
            Console.WriteLine(nicename);
    
        }
    }
    

    However, the method used in the link provided by Vladimir is to be preferred as it uses an API interface.

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

Sidebar

Related Questions

Coming from a Classic ASP background, I'm used to multiple forms on a page,
We've used for some years a home-grown file uploader for our classic ASP website.
Is there an OR/M (object relational mapper) that can be used in Classic ASP?
In classic asp you had the Global.asa file, what's the equivalent in .Net? I
Although the classic ASP method of server-side includes works in ASP.NET, I get the
I have a classic ASP application which inserts some values into a word file
I am new to c#/.net and just switched over to it from classic asp(yesterday).
I've recently upgraded a page on our server from classic asp to asp.net The
I'm trying to get my Classic ASP application (works great on Server 2003/IIS 6)
I used to work a lot with classic asp. I'm currently trying the ASP.NET

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.