• 大小: 289KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-14
  • 语言: C/C++
  • 标签: C#  C++  C  DLL  加载  

资源简介

C#加载C++\C的DLL动态链接库

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace DynamicLoadDemo
{
    class CDynamicLoadHelper
    {
       
            [DllImport(“kernel32.dll“ EntryPoint = “LoadLibrary“)]
            public static extern Int32 LoadLibrary(
                [MarshalAs(UnmanagedType.LPStr)] String lpLibFileName);

            [DllImport(“kernel32.dll“ EntryPoint = “GetProcAddress“)]
            public static extern IntPtr GetProcAddress(Int32 hModule
                [MarshalAs(UnmanagedType.LPStr)] String lpProcName);

            [DllImport(“kernel32.dll“ EntryPoint = “FreeLibrary“)]
            public static extern Boolean FreeLibrary(Int32 hModule);
 
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       9216  2017-07-27 11:55  CSharpLoadDLL\bin\Debug_Win32\DynamicLoadDemo.exe

     文件        187  2017-07-27 11:30  CSharpLoadDLL\bin\Debug_Win32\DynamicLoadDemo.exe.config

     文件      23168  2017-07-27 11:41  CSharpLoadDLL\bin\Debug_Win32\DynamicLoadDemo.vshost.exe

     文件        187  2017-07-27 11:30  CSharpLoadDLL\bin\Debug_Win32\DynamicLoadDemo.vshost.exe.config

     文件        490  2012-06-06 02:06  CSharpLoadDLL\bin\Debug_Win32\DynamicLoadDemo.vshost.exe.manifest

     文件       8704  2017-07-27 11:55  CSharpLoadDLL\bin\Debug_Win32\StaticLoadDemo.exe

     文件        187  2017-07-27 11:41  CSharpLoadDLL\bin\Debug_Win32\StaticLoadDemo.exe.config

     文件      30208  2017-07-27 11:29  CSharpLoadDLL\bin\Debug_Win32\TestDLL.dll

     文件        747  2017-07-27 11:56  CSharpLoadDLL\bin\Debug_Win32\TestDLL.exp

     文件     194016  2017-07-27 11:56  CSharpLoadDLL\bin\Debug_Win32\TestDLL.ilk

     文件       1708  2017-07-27 11:56  CSharpLoadDLL\bin\Debug_Win32\TestDLL.lib

     文件    1060864  2017-07-27 11:56  CSharpLoadDLL\bin\Debug_Win32\TestDLL.pdb

     文件       3710  2017-07-27 11:42  CSharpLoadDLL\CSharpLoadDLL.sln

    ..A..H.     74752  2017-07-27 12:17  CSharpLoadDLL\CSharpLoadDLL.v12.suo

     文件        187  2017-07-27 11:30  CSharpLoadDLL\DynamicLoadDemo\App.config

     文件       3867  2017-07-27 11:33  CSharpLoadDLL\DynamicLoadDemo\DynamicLoadDemo.csproj

     文件        805  2017-07-27 11:34  CSharpLoadDLL\DynamicLoadDemo\DynamicLoadHelper.cs

     文件       1623  2017-07-27 11:55  CSharpLoadDLL\DynamicLoadDemo\Form1.cs

     文件       1986  2017-07-27 11:55  CSharpLoadDLL\DynamicLoadDemo\Form1.Designer.cs

     文件       5817  2017-07-27 11:54  CSharpLoadDLL\DynamicLoadDemo\Form1.resx

     文件        527  2017-07-27 11:30  CSharpLoadDLL\DynamicLoadDemo\Program.cs

     文件       1372  2017-07-27 11:30  CSharpLoadDLL\DynamicLoadDemo\Properties\AssemblyInfo.cs

     文件       2882  2017-07-27 11:30  CSharpLoadDLL\DynamicLoadDemo\Properties\Resources.Designer.cs

     文件       5612  2017-07-27 11:30  CSharpLoadDLL\DynamicLoadDemo\Properties\Resources.resx

     文件       1102  2017-07-27 11:30  CSharpLoadDLL\DynamicLoadDemo\Properties\Settings.Designer.cs

     文件        249  2017-07-27 11:30  CSharpLoadDLL\DynamicLoadDemo\Properties\Settings.settings

     文件        187  2017-07-27 11:41  CSharpLoadDLL\StaticLoadDemo\App.config

     文件       1089  2017-07-27 11:55  CSharpLoadDLL\StaticLoadDemo\Form1.cs

     文件       2652  2017-07-27 11:55  CSharpLoadDLL\StaticLoadDemo\Form1.Designer.cs

     文件       5817  2017-07-27 11:54  CSharpLoadDLL\StaticLoadDemo\Form1.resx

............此处省略27个文件信息

评论

共有 条评论