public bool Connect(string progID, string serverName)
{
try
{
Type typeofOPCserver = Type.GetTypeFromProgID(progID, serverName);
OPCserverObj = Activator.CreateInstance(typeofOPCserver);
ifServer = (IOPCServer)OPCserverObj;
// connect all interfaces
ifCommon = (IOPCCommon)OPCserverObj;
ifBrowse = (IOPCBrowseServerAddressSpace)ifServer;
ifItmProps = (IOPCItemProperties)ifServer;
cpointcontainer = (IConnectionPointContainer)OPCserverObj;
isConnect = true;
return true;
}
catch(Exception ex)
{
isConnect = false
}
}
Type typeofOPCserver = Type.GetTypeFromProgID(progID, serverName);这行代码无法获取远程OPC服务器类型,神马原因啊,如何处理啊啊,谢谢各位大侠了!!!(客户端OPC环境配置没有问题)