VBS调用c#编译dll
因为工作需要用到VBS调用dll,网上贴子看了不少,教程不全,成功率低,
于是我研究了几天,本教程亲测可用
1.新建c#类库,这个不多说了
代码如下
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace TestCom
{
[ComVisible(true)]
[Guid("6D7D9956-CB6B-4EF1-BFF2-2ABD0D04CA22")]
public interface iClass1
{
int test(int num1,int num2,string str);
}
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDual)]
//[ClassInterface(ClassInterfaceType.AutoDual)]
public class Class1 : iClass1
{
public str