다음을 통해 공유


LU2용 세션 통합자 초기화

트랜잭션 통합자에 대한 LU2 세션에 연결할 때 수행해야 하는 첫 번째 작업은 개체를 만들고 초기화하는 Microsoft.HostIntegration.SNA.Session.SessionDisplay 것입니다. 이름에서 알 수 Microsoft.HostIntegration.SNA.Session.SessionDisplay 있듯이 은 애플리케이션에 표시되는 3270을 나타내며 SNA 네트워크에 액세스하는 데 사용할 기본 인터페이스입니다.

연결을 초기화한 후 LU2 세션을 통해 정보를 보내고 받을 수 있습니다.

절차 제목

  1. 필요한 경우 를 사용하여 새 세션 연결을 Microsoft.HostIntegration.SNA.Session.SessionConnectionDisplay만듭니다.

    모든 관련 정보가 있는 경우 를 직접 만들 Microsoft.HostIntegration.SNA.Session.SessionConnectionDisplay 수 있습니다. 그러나 이 단계를 수행할 필요는 없습니다. 2단계에서 LU 연결 문자열 전달할 가능성이 높습니다.

  2. 를 사용하여 새 세션을 Microsoft.HostIntegration.SNA.Session.SessionDisplay만듭니다.

  3. 연결 정보를 에 전달합니다 Microsoft.HostIntegration.SNA.Session.SessionDisplay.Connect%2A.

    Microsoft.HostIntegration.SNA.Session.SessionDisplay.Connect%2A에는 여러 오버로드가 포함됩니다. 이미 만든 Microsoft.HostIntegration.SNA.Session.SessionDisplay 개체, Microsoft.HostIntegration.SNA.Session.SessionDisplay 개체 및 추가 초기화 정보 또는 연결 문자열 및 초기화 정보와 연결하도록 선택할 수 있습니다.

    연결 문자열 사용하여 를 호출 Microsoft.HostIntegration.SNA.Session.SessionDisplay.Connect%2A 하도록 선택하면 트랜잭션 통합자가 새 Microsoft.HostIntegration.SNA.Session.SessionConnectionDisplay 를 만듭니다. 를 통해 Microsoft.HostIntegration.SNA.Session.SessionDisplay.Connection%2A개체에 Microsoft.HostIntegration.SNA.Session.SessionConnectionDisplay 직접 액세스할 수 있습니다.

  4. 필요한 경우 를 사용하여 Microsoft.HostIntegration.SNA.Session.SessionDisplay.IsConnected%2A연결했는지 확인합니다.

예제

다음 코드는 SDK 샘플 디렉터리의 COM3270 애플리케이션에서 가져옵니다.

private void CreateSession_Click(object sender, EventArgs e)  
        {  
            try  
            {  
                LUName.Text = LUName.Text.Trim();  
                if (LUName.Text.Length == 0)  
                {  
                    MessageBox.Show("You must fill out the LU or Pool Name");  
                    return;  
                }  
                m_Handler = new SessionDisplay();                m_Handler.Connect("TRANSPORT=SNA;LOGICALUNITNAME=" + LUName.Text);  
                m_Handler.Connection.HostCodePage = 37;  
  
                FontFamily fontFamily = new FontFamily("Courier New");  
                m_FixedFont = new Font(fontFamily, 10, FontStyle.Regular, GraphicsUnit.Pixel);  
                ScreenText.Font = m_FixedFont;  
                TraceScreen();  
  
                // Disable every button and text box.  
                DisableEverything();  
  
                m_Handler.WaitForContent("TERM NAME", 20000);  
                TraceScreen();  
  
                // Enable Connect to CICS and Disconnect Session.  
                EnableCICSElements();  
            }  
            catch (Exception ex)  
            {  
                MessageBox.Show(ex.Message);  
            }  
        }  

참고 항목

LU2용 세션 통합자 코드 예제
LU2용 세션 통합자