VS2019中写程序关编译成dll
代码如下
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XMLDaClientdll.XMLWrapper;
namespace XMLDaClientdll
{
public interface IXMLDaClientdll
{
string Connect(string txtUrl);
}
public class ConnectClass:IXMLDaClientdll
{
public string Connect(string txtUrl)
{
XMLWrapper.OPC_XML_DA_WrapperService service = new XMLWrapper.OPC_XML_DA_WrapperService();
service.Url = "http://" + txtUrl + "/soap";
ReplyBase reply;
ServerStatus Status;
try
{
reply = service.GetStatus("en-US", "", out Status);
return Status.StatusInfo.ToString();
}
catch (Exception excp)
{
return excp.Message;
}
finally
{
}
}
}
}
狐表中引用此dll,全局代码中写
Public Declare Function connectxml Lib "XMLDaClientdll.dll" Alias "Connect" (ByVal txtUrl As String) As String
测试Output.Show(connectxml("192.168.1.222"))
报错
此主题相关图片如下:1.png
![dvubb 图片点击可在新窗口打开查看](UploadFile/2019-11/2019112715482950872.png)
不知道要修改哪里?偶是小白,C#看了一周多,还是云里雾里的。