我创建了一个应用程序表单,用于访问另一个程序中的标记。我使用 dll 来访问标签IOM.InTouchDataAccess。我运行程序,它一直工作,直到我写一个标签,然后按选择。错误:无法加载文件或程序集“IOM.InTouchDataAccess,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null”或其依赖项之一。系统找不到指定的文件。我还是新手程序员。
该程序在Program.cs中停止
Application.Run(new InTouchTagBrowser());
表单代码
public partial class InTouchTagBrowser : Form
{
public string tagName;
public InTouchTagBrowser()
{
InitializeComponent();
}
private void TagBrowser_Load(object sender, EventArgs e)
{
}
private void SelectButton_Click(object sender, EventArgs e)
{
try
{
tagName = tagNameBox.Text;
InTouchDdeWrapper inTouchWrapper = new InTouchDdeWrapper();
string value = inTouchWrapper.Read(tagName);
TagDotField tagDotField = new TagDotField(tagName);
string description = inTouchWrapper.Read(tagDotField.Description);
string engUnits = inTouchWrapper.Read(tagDotField.EngUnits);
descriptionlbl.Text = description;
englbl.Text = engUnits;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void WriteButton_Click(object sender, EventArgs e)
{
try
{
if (tagName != "")
{
MessageBox.Show("Please enter a tag!");
}
else
{
string inputValue = ValueBox.Text;
InTouchDdeWrapper inTouchWrapperWriter = new InTouchDdeWrapper();
TagDotField tagWriter = new TagDotField(inputValue);
inTouchWrapperWriter.Write(tagName, inputValue);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
MessageBox.Show("Tag change successfull");
}
}
答案 0 :(得分:1)
你没有提供太多信息。如果我是你,请列出我应该尝试的事项: