簡體   English   中英

dll似乎沒有被閱讀,為什么?

[英]Dll does not seem to be read, why?

我正在創建一個應用程序表單,以從稱為InTouch的軟件查看/更改標簽。

我添加了dll作為參考,並且我想在IOM.InTouchDataAccess中使用Read(string tagName )fct。 當我編寫InTouchWrapper TagType = new read()時,VS看不到fct Read。 它只會看到我在代碼中編寫的InTouchWrapper,該錯誤給了我IOM.InTouchDataAccess.InTouchWrapper' does not contain a constructor that takes 0 arguments

我不明白為什么會這樣。 我在編碼時正在運行InTouch軟件,可能與該軟件存在訪問沖突。

我的密碼

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 IOM.InTouchDataAccess;

namespace TagBrowser
{
    public partial class TagBrowser : Form
    {
        public TagBrowser()
        {
            InitializeComponent();
        }

        private void TagBrowser_Load(object sender, EventArgs e)
        {
        }

        private void TagBox_TextChanged(object sender, EventArgs e)
        {
        }

        private void TypeBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            InTouchWrapper TagType = new InTouchWrapper();
        }

dll文件

using System;
using System.Collections.Generic;
using System.Text;
using NDde.Client;

namespace IOM.InTouchDataAccess
{
    public class InTouchDdeWrapper : IDisposable
    {
        private int DDE_TIMEOUT = 60000;

        private DdeClient _ddeClient;

        public InTouchDdeWrapper()
        {
            _ddeClient = new DdeClient("View", "Tagname");
        }

        ~InTouchDdeWrapper()
        {
            Dispose();
        }

        public void Initialize()
        {
            _ddeClient.Connect();
        }

        public string Read(string tagName)
        {
            return _ddeClient.Request(tagName, DDE_TIMEOUT).Replace("\0", "");
        }

我將其放在此處,以防其他人遇到相同的問題:

您確定這是您引用的正確的dll嗎? 嘗試在反編譯器( JustDecompile freeReflectordotPeek free )中打開確切引用的dll,然后查看它是否為您所期望的代碼。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM