软件编程
位置:首页>> 软件编程>> C#编程>> C#调用易语言写的Dll文件方法

C#调用易语言写的Dll文件方法

作者:threadroc  发布时间:2023-07-21 01:56:10 

标签:C#,易语言

本人是用易语言起步的,起初是为了兴趣,后来由于易语言被杀软误杀严重,连空白程序都杀,后来转到了学C#,随着学习的深入,接触越来越复杂的东西之后,发现有些功能没有用易语言来写方便,所以就想到用C#来调用易语言写的DLL,就和一般的Dll调用一样,没什么技术含量。

易语言中新建个Dll文件

C#调用易语言写的Dll文件方法

C#中和一般的DLL一样调用


<p>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;</p><p> </p><p>namespace e_dll
{
 public partial class Form1 : Form
 {
   public Form1()
   {
     InitializeComponent();
   }
   [DllImport("msg.dll")]
   public static extern void msgbox(string text,string title);
   private void button1_Click(object sender, EventArgs e)
   {
     msgbox("成功调用易语言dll!", "测试");
   }
 }
}
</p>

感谢大家对脚本之家的支持,测试一下以上代码内容吧。

来源:https://blog.csdn.net/threadroc/article/details/39322445

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com