Verwenden von REOverride zum Angeben einer Remoteumgebung
Um einen RE programmgesteuert anzugeben, verwendet die Anwendung den Eintrag für den verwalteten Kontext. Die Context-Eigenschaft muss für die Methode aus dem Designer auf true festgelegt werden.
Der folgende Visual Basic-Code zeigt ein Beispiel, das virtuell eine Re-Instanz in der Anwendung erstellt.
' You must set the following references in your project:
' Microsoft.HostIntegration.TI.ClientContext.dll
' Microsoft.HostIntegration.TI.Globals.dll
Imports Microsoft.HostIntegration.TI
Dim TIContext As New ClientContext
Dim DynamicRE As ELMLinkRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.ELMLink, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
TIContext.DynamicRE = DynamicRE
Obj.Method1 parm1, parm2, parm3, TIContext
Der folgende Visual Basic-Code zeigt ein Beispiel für HTTP mit MSHMIRS.
Dim DynamicRE As HTTPLinkRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.HttpLink, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.HttpPort = PortNumber
DynamicRE.MirrorProgramName = "MSHMIRS"
DynamicRE.AliasTransactionId = "CWBA"
TIContext.DynamicRE = DynamicRE
Der folgende Visual Basic-Code zeigt ein Beispiel für HTTP-Benutzerdaten.
Dim TIContext As New ClientContext
Dim DynamicRE As HTTPUserDataRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.HttpUserData, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.HttpPort = PortNumber
DynamicRE.AliasTransactionId = "CWBA"
TIContext.DynamicRE = DynamicRE
Der folgende Visual Basic-Code zeigt ein Beispiel für CICS Link.
Dim TIContext As New ClientContext
Dim DynamicRE As SNALinkRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.SNALink, "MyRE")
DynamicRE.LocalLUName = LocalLUName
DynamicRE.RemoteLUName = RemoteLUName
DynamicRE.ModeName = Mode
TIContext.DynamicRE = DynamicRE
Der folgende Visual Basic-Code zeigt ein Beispiel für CICS LU6.2-Benutzerdaten.
Dim TIContext As New ClientContext
Dim DynamicRE As SNAUserDataRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.SNAUserData, "MyRE")
DynamicRE.LocalLUName = LocalLUName
DynamicRE.RemoteLUName = RemoteLUName
DynamicRE.ModeName = Mode
TIContext.DynamicRE = DynamicRE
Der folgende Visual Basic-Code zeigt ein Beispiel für IMS LU 6.2.
Dim TIContext As New ClientContext
Dim DynamicRE As SNAUserDataRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.IMSLU62, "MyRE")
DynamicRE.LocalLUName = LocalLUName
DynamicRE.RemoteLUName = RemoteLUName
DynamicRE.ModeName = Mode
TIContext.DynamicRE = DynamicRE
Der folgende Visual Basic-Code zeigt ein Beispiel für ELM Link.
Dim TIContext As New ClientContext
Dim DynamicRE As ELMLinkRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.ELMLink, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
TIContext.DynamicRE = DynamicRE
Der folgende Visual Basic-Code zeigt ein Beispiel für TRM-Link mit Sicherheit.
Dim TIContext As New ClientContext
Dim DynamicRE As TRMLinkRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.TRMLink, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
DynamicRE.Security = RemoteEnvironmentSecurity.User
TIContext.DynamicRE = DynamicRE
TIContext.User = "UserId"
TIContext.Password = "Password"
Der folgende Visual Basic-Code zeigt ein Beispiel für TRM-Benutzerdaten mit Sicherheit.
Dim TIContext As New ClientContext
Dim DynamicRE As TRMUserDataRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.TRMUserData, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
DynamicRE.Security = RemoteEnvironmentSecurity.User
TIContext.User = "UserId"
TIContext.Password = "Password"
TIContext.TransactionId = "CICS Transaction name"
TIContext.DynamicRE = DynamicRE
Der folgende Visual Basic-Code zeigt ein Beispiel für IMS Connect ohne Sicherheit, Beenden HWSIMSO0.
Dim TIContext As New ClientContext
Dim DynamicRE As IMSConnectRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.IMSConnect, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
DynamicRE.ItocExitName = "*IRMREQ*"
DynamicRE.OtmaSystemId = "IMS system ID"
TIContext.DynamicRE = DynamicRE
Der folgende Visual Basic-Code zeigt ein Beispiel für IMS Connect with security, exit HWSIMSO1.
Dim TIContext As New ClientContext
Dim DynamicRE As IMSConnectRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.IMSConnect, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
DynamicRE.ItocExitName = "*IRMRE1*"
DynamicRE.OtmaSystemId = "IMS system ID"
DynamicRE.Security = RemoteEnvironmentSecurity.Off Or RemoteEnvironmentSecurity.ImsHWS01SecurityExit
TIContext.DynamicRE = DynamicRE
Der folgende Visual Basic-Code zeigt ein Beispiel für BETRIEBSSYSTEM 400 mit Sicherheit und Bibliotheksname.
Dim TIContext As New ClientContext
Dim DynamicRE As DPCRemoteEnvironment
DynamicRE = RemoteEnvironmentClassFactory.MakeRemoteEnvironment(DynamicRemoteEnvironmentTypes.DistributedProgramCall, "MyRE")
DynamicRE.IPAddress = SystemAddress
DynamicRE.TCPPorts = PortNumber
DynamicRE.Security = RemoteEnvironmentSecurity.User
TIContext.User = "UserID"
TIContext.Password = "Password"
TIContext.LibraryName = "Library Name"
TIContext.DynamicRE = DynamicRE