コード例 #1
0
 public VideoTerminalCaret(VideoTerminal parent)
 {
     videoterminal       = parent;
     blinkvisible        = true;
     blinktimer          = new DispatcherTimer();
     blinktimer.Interval = new TimeSpan(0, 0, 0, 0, 500);
     blinktimer.Tick    += new EventHandler(Blink);
     blinktimer.Start();
 }
コード例 #2
0
 public VideoTerminalScreen(VideoTerminal parent)
 {
     videoterminal = parent;
     Buffer        = new VideoTerminalChar[80, 24];
     for (int i = 0; i < 80; i++)
     {
         for (int j = 0; j < 24; j++)
         {
             Buffer[i, j] = new VideoTerminalChar(videoterminal);
         }
     }
 }
コード例 #3
0
 public VideoTerminalChar(VideoTerminal parent, char c, int width)
 {
     videoterminal = parent;
     Format(c.ToString(), width);
 }
コード例 #4
0
 public VideoTerminalChar(VideoTerminal parent, char c)
 {
     videoterminal = parent;
     Format(c.ToString(), 1);
 }
コード例 #5
0
 public VideoTerminalChar(VideoTerminal parent)
 {
     videoterminal = parent;
     Format("", 0);
 }
コード例 #6
0
        public void OpenChannel(VideoTerminal x)
        {
            PacketGeneral     packet_openchannel = new PacketGeneral(90);
            NetworkByteWriter nbw = packet_openchannel.GetStreamWriter();

            nbw.WriteString("session");
            nbw.WriteUInt32(0);
            nbw.WriteUInt32(1048576);
            nbw.WriteUInt32(16384);

            SendPacket(crypto_encryptor, packet_openchannel);

            Packet            packet = RecvPacket(crypto_decryptor);
            NetworkByteReader nbr    = packet.GenerateReader();

            nbr.ReadByte();
            uint recipient_channel = nbr.ReadUInt32();

            uint sender_channel      = nbr.ReadUInt32();
            uint initial_window_size = nbr.ReadUInt32();
            uint maximum_packet_size = nbr.ReadUInt32();


            PacketGeneral packet_pty = new PacketGeneral(Packet.SSH_MSG_CHANNEL_REQUEST);

            nbw = packet_pty.GetStreamWriter();
            nbw.WriteUInt32(recipient_channel);
            nbw.WriteString("pty-req");
            nbw.WriteByte(0);
            nbw.WriteString("vt100");
            nbw.WriteUInt32(80);
            nbw.WriteUInt32(24);
            nbw.WriteUInt32(640);
            nbw.WriteUInt32(480);
            nbw.WriteString("");
            SendPacket(crypto_encryptor, packet_pty);

            PacketGeneral packet_shell = new PacketGeneral(Packet.SSH_MSG_CHANNEL_REQUEST);

            nbw = packet_shell.GetStreamWriter();
            nbw.WriteUInt32(recipient_channel);
            nbw.WriteString("shell");
            nbw.WriteByte(0);
            SendPacket(crypto_encryptor, packet_shell);


            while (true)
            {
                if (RecvAvailable())
                {
                    packet = RecvPacket(crypto_decryptor);
                    switch (packet.Message)
                    {
                    case Packet.SSH_MSG_CHANNEL_WINDOW_ADJUST:
                        break;

                    case Packet.SSH_MSG_CHANNEL_DATA:
                        PacketChannelData p = new PacketChannelData(packet);
                        p.Parse();
                        x.HandleServerData(p.data);
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    string data = x.GetClientData();
                    if (data.Length != 0)
                    {
                        PacketGeneral packet_key = new PacketGeneral(Packet.SSH_MSG_CHANNEL_DATA);
                        nbw = packet_key.GetStreamWriter();
                        nbw.WriteUInt32(recipient_channel);
                        nbw.WriteString(data);
                        SendPacket(crypto_encryptor, packet_key);
                    }
                }
            }
        }