I have a VB based block of code I need to rewrite in C# and I'm writing a function which creates an instance of a COM object and creates a new terminal session, goes out, reads a screen and returns the contents of the screen. Right now though I feel like I'm not taking the right approach in C# and would appreciate some feedback.
VB Code
set bzlipi = CreateObject("BlueZone.LIPI")
bzlipi.Username = "myuserid"
bzlipi.Password = "mypassword"
bzlipi.HostAddress = "101.122.0.138"
bzlipi.ShowTransferStatusWindow = False
bzlipi.LocalPromptBeforeOverwrite = False
result = bzlipi.ReceiveFile( "local.txt", "MYLIB/F4101" )
MsgBox bzlipi.ErrorMessage
C#
using BZLIPILib;
using BZWHLLLib;
public void Connector() {
object Host = Activator.CreateInstance(Type.GetType("BZLIPILib.LIPI"));
//Set Host properties
}
As it stands, this is not not recognizing any properties within Host as its
VB counterpart does above. I've made all the available COM object
references within package manager of my VS project. What should I be
doing differently?
usingdirectives work. Not actually using it is, well, unwise. But requiresdynamic HostandType.GetTypeFromProgID("BlueZone.LIPI"). IntelliSense still won't show members.