C#-CSC编译环境搭建

一.Microsoft .NET Framework

    确保系统中安装Microsoft .NET Framework相关版本
下载 .NET Framework 4.7 | 免费官方下载 (microsoft.com)icon-default.png?t=N7T8https://dotnet.microsoft.com/zh-cn/download/dotnet-framework/net47

二.编译环境搭建

    已经集成编译工具csc.exe,归档至gitcode,实现user32.dll弹框功能.

霸王•吕布 / MinCSharpCompiler · GitCodeicon-default.png?t=N7T8https://gitcode.net/qq_35829452/mincsharpcompiler

三.调用外部dll

     编译命令:csc /reference:user32.dll /out:HelloWorld.exe

     代码添加Dllimport调用C/C++方法

     [DllImport("user32.dll", EntryPoint="MessageBoxA")]
     public static extern int MsgBox(int hWnd, string msg, string caption, int type);

四.查看已经assemble的dll库

    C:\Windows\assembly可查看所有装载的.NET依赖库,如文件输入输出等常用API

 

相关推荐

  1. 基于 Docker 交叉编译环境

    2024-01-01 16:52:03       38 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-01 16:52:03       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-01 16:52:03       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-01 16:52:03       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-01 16:52:03       18 阅读

热门阅读

  1. UART通信协议:串行通信的精华

    2024-01-01 16:52:03       35 阅读
  2. Unity检测地面坡度丨人物上坡检测

    2024-01-01 16:52:03       33 阅读
  3. STL——查找算法

    2024-01-01 16:52:03       31 阅读
  4. 八股文打卡day17——计算机网络(17)

    2024-01-01 16:52:03       34 阅读
  5. Go语言程序设计-第6章--方法

    2024-01-01 16:52:03       36 阅读
  6. Linux常见的21条面试命令

    2024-01-01 16:52:03       32 阅读
  7. 深入理解和运用C语言中的Break语句

    2024-01-01 16:52:03       36 阅读
  8. 编码风格之(1)C语言建议规范

    2024-01-01 16:52:03       39 阅读
  9. Docker常用命令

    2024-01-01 16:52:03       38 阅读
  10. 用指针实现冒泡排序

    2024-01-01 16:52:03       36 阅读
  11. 【Vue3】请求参数

    2024-01-01 16:52:03       37 阅读
  12. 牛客小白月赛84

    2024-01-01 16:52:03       29 阅读
  13. Android学习记录(二)

    2024-01-01 16:52:03       36 阅读