在C#代码编写中,我们常常用Add Reference(增加引用)来增加一个程序集的引用,在弹开的对话框中,第一页为.NET,列出了系统程序集以及我们所装的一些软件的DLL。我现在想知道取得这些程序集的API函数,有谁知道??谢谢!

解决方案 »

  1.   

    没见过这样的API。
    是要取得这些程序集的列表还是什么?要取得列表的话读取你系统安装路径下的assembly文件夹(类似C:\WINDOWS\assembly)内文件名即可获得绝大部分程序集。
      

  2.   

    http://www.pinvoke.net/default.aspx/iphlpapi.GetAdaptersInfo
      

  3.   

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders找这下面的目录
      

  4.   

    然后再加上.NET本身的,就全了
      

  5.   

    .NET本身的目录也可以在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFrameworkInstallRoot下找到
      

  6.   

    在MSDN上看到的一段,显示多少是要自己配置的,不知道配置好了以后,是否可以直接通过一个函数取得,我还在研究中。楼上的楼上给的链接还没有打开!谢谢大家的发言The Add Reference dialog box does not automatically display every assembly, even if it has been installed to the Global Assembly Cache (GAC). The Add Reference dialog box is path based, and requires a registry key to be added that specifies the location of assemblies to display.To display assemblies in the Add Reference dialog box :
    1.
    Add one of the following registry keys, where <AssemblyLocation> is the directory of the assemblies that you want to appear in the Add Reference dialog box, for example, C:\\MyAssemblies.[HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework\<version>\AssemblyFoldersEx\MyAssemblies]@="<AssemblyLocation>"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\<version>\AssemblyFoldersEx\MyAssemblies]@="<AssemblyLocation>"Note  
    Creating the registry key under the HKEY_LOCAL_MACHINE hive allows all users to see the assemblies in the specified location in the Add Reference dialog box. Creating the registry key under the HKEY_CURRENT_USER hive only affects the setting for the current user.
     
    2.
    Restart Visual Studio.