在winform 类中和方法上设置属性[ComVisible(true)],使其com可见。

[ComVisible(true)]
public partial class frm_main : Form
{
    [ComVisible(true)]
    public  string  a()
    {
        return "000";
    }    
}

 js中函数可以直接写 var result= window.external.a();

result ="000";

相关文章:

  • 2022-02-27
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2021-05-02
  • 2021-10-19
  • 2021-08-05
相关资源
相似解决方案