在C#中使用Visa.Interop.ResourceManager时出现异常错误

问题描述

我正在使用C#来控制工具(例如函数生成器),但是当使用ResourceManager构造函数时,会发生一些异常错误... 这是 System.Runtime.InteropServices.COMException'(System.Private.CoreLib.dll)

例外

有人可以帮助我解决该问题吗? 我正在使用Visual Studio,并且尝试在管理员模式下执行Visual Studio,但是它也不起作用。她的是我的密码

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Ivi.Visa;
using Ivi.Visa.Formattedio;
using Ivi.Visa.Interop;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409

namespace upw_test1
{
    public sealed partial class MainPage : Page
    {
        bool isconnected;

        public MainPage()
        {
            this.InitializeComponent();
            isconnected = false;

        }


        void Button_Click(Object sender,RoutedEventArgs e)
        {
            connection_result.Text = "Hello," + Input_num.Text + "!";
            if (!isconnected)
            {
                string srcAddress = "GPIB::";
                srcAddress += Input_num.Text.ToString();
                srcAddress += "::INSTR";

                try
                {
                    ResourceManager mngr = new ResourceManager();
                    
                catch (Exception exp)
                {
                    //MessageBox.Show(exp.Message);
                    connection_result.Text = srcAddress + "  connection fail  ";
                }
                // GPIB address

      

            }
        }

    }
}

below is the full stack trace of exception..

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...