This sample shows how to send a TSO file transfer from an IBM session.
Send a TSO file transfer |
Copy Code
|
---|---|
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Attachmate.Reflection.UserInterface; using Attachmate.Reflection.Framework; using Attachmate.Reflection.Emulation.IbmHosts; namespace FileTransfer { class Program { public void SendFileTransfer() { //Get the last activated instance of Reflection Application app = MyReflection.ActiveApplication; //Make sure Reflection is running if (app != null) { IFrame frame = (IFrame)app.GetObject("Frame"); IView view = (IView)frame.SelectedView; IIbmTerminal terminal = (IIbmTerminal)view.Control; Attachmate.Reflection.Emulation.IbmHosts.IFileTransfer fTransfer = terminal.FileTransfer; fTransfer.XfrHostSys = HostSystem.Tso; //transfer the test.txt file from the PC to the host using the IND$File protocol fTransfer.INDSendFile(@"C:\Users\Public\Documents\test.txt", "bvtst02.test7.txt", INDFileTransferType.Ascii, FileExistsOption.Overwrite, true); } else { Console.WriteLine("Cannot find instance of Reflection"); } } static void Main(string[] args) { Program app = new Program(); //Send the file transfer app.SendFileTransfer(); } } } |