Exemplo n.º 1
0
        // Keypad state handler
        void myKeypad_ButtonStateChange(GenericBase device, ButtonEventArgs args)
        {
            var sig = args.Button;
            var uo  = sig.UserObject;

            CrestronConsole.PrintLine("Event sig: {0}, Type: {1}, Name: {2}", sig.Number, sig.GetType(), sig.Name);

            // Read a file example
            CrestronConsole.PrintLine("File Read Example");
            MyFileReader myFileReader = new MyFileReader();
            string       myFileContents;
            ushort       i;

            CrestronConsole.PrintLine("Reading File example");
            i = myFileReader.OpenLocalFile("\\NVRAM\\Books.xml");
            myFileContents = myFileReader.myFileStringContents;
            CrestronConsole.PrintLine(myFileContents);

            // HTTP File Example
            CrestronConsole.PrintLine("HTTP Read Example");
            OpenHTTPFile myHTTPFile;

            myHTTPFile = new OpenHTTPFile();
            myHTTPFile.getHTTPPage();

            // SFTP{ File Example
            CrestronConsole.PrintLine("SFTP Read Example");
            CustomSFTP myCustomSFTP;

            myCustomSFTP = new CustomSFTP();
            myCustomSFTP.getFromSFTP(@"SFTP://127.0.0.1/Books.xml");
        }
Exemplo n.º 2
0
        // Keypad state handler
        void myKeypad_ButtonStateChange(GenericBase device, ButtonEventArgs args)
        {
            var sig = args.Button;
            var uo = sig.UserObject;

            CrestronConsole.PrintLine("Event sig: {0}, Type: {1}, Name: {2}", sig.Number, sig.GetType(), sig.Name);

            // Read a file example
            CrestronConsole.PrintLine("File Read Example");
            MyFileReader myFileReader = new MyFileReader();
            string myFileContents;
            ushort i;

            CrestronConsole.PrintLine("Reading File example");
            i = myFileReader.OpenLocalFile("\\NVRAM\\Books.xml");
            myFileContents = myFileReader.myFileStringContents;
            CrestronConsole.PrintLine(myFileContents);

            // HTTP File Example
            CrestronConsole.PrintLine("HTTP Read Example");
            OpenHTTPFile myHTTPFile;

            myHTTPFile = new OpenHTTPFile();
            myHTTPFile.getHTTPPage();

            // SFTP{ File Example
            CrestronConsole.PrintLine("SFTP Read Example");
            CustomSFTP myCustomSFTP;

            myCustomSFTP = new CustomSFTP();
            myCustomSFTP.getFromSFTP(@"SFTP://127.0.0.1/Books.xml");
        }