います。純差し替え用ファイルです。タイプFileSystemObjectですか?

StackOverflow https://stackoverflow.com/questions/1583149

  •  21-09-2019
  •  | 
  •  

質問

クラシックAspを使用しましたの ファイルです。タイプ 得するプロパティの名前に関連するファイルタイプからレジストリ(例えば"テキストドキュメント"には".txt").のFileInfoクラスでは一般的に置き換えに古いCOMオブジェクトな複製はこの特徴は、これまでにないんで同意を得なければならない成功であって、利用します。

役に立ちましたか?

解決

私は知らない方法にBCLで読んでから、レジストリ:

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);

    }
}

しかし、使用する方法に リンク によるウラジミールを優先して使用するAPIインタフェース。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top