我正在尝试从 QTP 调用 C# dll(使用 vbscript)。我尝试了很多没有成功的事情:
- 视觉工作室 2010
- 创建 C# 类库 (st.dll)
代码:
using System;
using System.Collections.Generic;
using System.Text;
namespace st
{
public class Class1
{
public static int GetValue()
{
return 34;
}
}
}
regasm /codebase st.dll
- 失败,因为它不是有效的 .NET 程序集
在 QTP/vbscript 中,我尝试过
extern.Declare micInteger, "GetValue", "e:\st.dll", "GetValue"
- 返回消息:'无效的过程调用或参数'
无论 QTP 是什么,我都非常感谢有关如何从 .vbs 文件调用 c# dll 的任何见解。