Exemplo n.º 1
0
        /// <summary>Open a new putty scp window with its settings being passed in a <seealso cref="SessionData"/> object</summary>
        /// <param name="session">The <seealso cref="SessionData"/> object containing the settings</param>
        public static void OpenScpSession(SessionData session)
        {
            Log.InfoFormat("Opening scp session, id={0}", session == null ? "" : session.SessionId);
            if (!IsScpEnabled)
            {
                SuperPuTTY.ReportStatus("Could not open session, pscp not found: {0} [SCP]", session.SessionId);
            }
            else if (session != null)
            {
                PscpBrowserPanel panel = new PscpBrowserPanel(
                    session, new PscpOptions {
                    PscpLocation = Settings.PscpExe, PscpHomePrefix = Settings.PscpHomePrefix
                },
                    Environment.GetFolderPath(Environment.SpecialFolder.Desktop));
                ApplyDockRestrictions(panel);
                ApplyIconForWindow(panel, session);
                panel.Show(MainForm.DockPanel, session.LastDockstate);

                SuperPuTTY.ReportStatus("Opened session: {0} [SCP]", session.SessionId);
            }
            else
            {
                Log.Warn("Could not open null session");
            }
        }
Exemplo n.º 2
0
        /// <summary>Open a new putty scp window with its settings being passed in a <seealso cref="SessionData"/> object</summary>
        /// <param name="session">The <seealso cref="SessionData"/> object containing the settings</param>
        public static void OpenScpSession(SessionData session)
        {
            Log.InfoFormat("Opening scp session, id={0}", session == null ? "" : session.SessionId);
            if (!IsScpEnabled)
            {
                SuperPuTTY.ReportStatus("Could not open session, pscp not found: {0} [SCP]", session.SessionId);
            }
            else if (session != null)
            {
                var homePrefix         = session.Username.ToLower().Equals("root") ? Settings.PscpRootHomePrefix : Settings.PscpHomePrefix;
                PscpBrowserPanel panel = new PscpBrowserPanel(
                    session, new PscpOptions {
                    PscpLocation = Settings.PscpExe, PscpHomePrefix = homePrefix
                });
                ApplyDockRestrictions(panel);
                ApplyIconForWindow(panel, session);
                panel.Show(MainForm.DockPanel, session.LastDockstate);

                SuperPuTTY.ReportStatus("Opened session: {0} [SCP]", session.SessionId);
            }
            else
            {
                Log.Warn("Could not open null session");
            }
        }
Exemplo n.º 3
0
        public void RunPscpBrowserPanel()
        {
            SessionData session = new SessionData
            {
                SessionId   = "Test/SessionId",
                SessionName = "Test SessionName",
                Username    = ScpConfig.UserName,
                Password    = ScpConfig.Password,
                Host        = ScpConfig.KnownHost,
                Port        = 22
            };

            PscpBrowserPanel panel = new PscpBrowserPanel(session, ScpConfig.DefaultOptions);

            panel.Size = new Size(1024, 768);
            panel.Show();
        }