From 1661f9a5bd46dbd7d2586787c55bfc407c027629 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 23 Jun 2017 20:20:38 -0400 Subject: hacking work Me: [squeaky] IT'S WORKING!! Phil: Michael... You just creeped me out... --- ShiftOS.WinForms/Applications/FileSkimmer.cs | 92 ++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) (limited to 'ShiftOS.WinForms/Applications/FileSkimmer.cs') diff --git a/ShiftOS.WinForms/Applications/FileSkimmer.cs b/ShiftOS.WinForms/Applications/FileSkimmer.cs index 51d7bd8..34f9e9c 100644 --- a/ShiftOS.WinForms/Applications/FileSkimmer.cs +++ b/ShiftOS.WinForms/Applications/FileSkimmer.cs @@ -36,6 +36,7 @@ using System.Windows.Forms; using static ShiftOS.Objects.ShiftFS.Utils; using ShiftOS.Engine; using Newtonsoft.Json; +using ShiftOS.WinForms.Tools; namespace ShiftOS.WinForms.Applications { @@ -46,6 +47,21 @@ namespace ShiftOS.WinForms.Applications [DefaultIcon("iconFileSkimmer")] public partial class FileSkimmer : UserControl, IShiftOSWindow { + + public static Objects.ClientSave CurrentRemoteUser = new Objects.ClientSave(); + public static ShiftOSEnvironment OpenConnection = new ShiftOSEnvironment(); + + private static event Action OnDisconnect; + + public static void DisconnectRemote() + { + OnDisconnect?.Invoke(); + CurrentRemoteUser = new Objects.ClientSave(); + if (!string.IsNullOrWhiteSpace(OpenConnection.SystemName)) + Infobox.Show("Connections terminated.", "All outbound File Skimmer connections have been terminated."); + OpenConnection = new ShiftOSEnvironment(); + } + public FileSkimmer() { InitializeComponent(); @@ -53,6 +69,13 @@ namespace ShiftOS.WinForms.Applications { ChangeDirectory(Paths.GetPath("root")); }; + OnDisconnect += FileSkimmer_OnDisconnect; + } + + private void FileSkimmer_OnDisconnect() + { + currentdir = "__system"; + ResetList(); } private void lvitems_DoubleClick(object sender, EventArgs e) @@ -300,6 +323,7 @@ namespace ShiftOS.WinForms.Applications public bool OnUnload() { + OnDisconnect -= FileSkimmer_OnDisconnect; return true; } @@ -497,5 +521,73 @@ namespace ShiftOS.WinForms.Applications } catch { } } + + private void connectToRemoteServerToolStripMenuItem_Click(object sender, EventArgs e) + { + ShowConnectionBox(); + } + + public void ShowConnectionBox() + { + pnlconnect.Show(); + pnlconnect.BringToFront(); + pnlconnect.CenterParent(); + + //header + lbctitle.CenterParent(); + lbctitle.Top = 5; + + //description + lbcdesc.CenterParent(); + lbcdesc.Top = lbctitle.Top + lbctitle.Height + 5; + + //credentials + pnlcreds.CenterParent(); + pnlcreds.Top = lbcdesc.Top + lbcdesc.Height + 5; + txtcsys.Text = OpenConnection.SystemName; + txtcuser.Text = CurrentRemoteUser.Username; + txtcpass.Text = CurrentRemoteUser.Password; + + //controls + flcbuttons.CenterParent(); + flcbuttons.Top = pnlcreds.Top + pnlcreds.Height + 5; + } + + private void btncancel_Click(object sender, EventArgs e) + { + pnlconnect.Hide(); + } + + private void btnok_Click(object sender, EventArgs e) + { + var sys = VirtualEnvironments.Get(txtcsys.Text); + + if(sys != null) + { + //user auth + var user = sys.Users.FirstOrDefault(x => x.Username == txtcuser.Text && x.Password == txtcpass.Text); + if(user != null) + { + OpenConnection = sys; + CurrentRemoteUser = user; + if (Mounts.Count == 3) + Mounts.RemoveAt(2); + Mounts.Add(sys.Filesystem); + ChangeDirectory("2:"); + pnlconnect.Hide(); + connectToRemoteServerToolStripMenuItem.Text = "Reauthenticate"; + return; + } + Infobox.Show("Access denied.", "Authentication failed for the specified user. Connection aborted."); + return; + } + var t = new System.Threading.Thread(() => + { + System.Threading.Thread.Sleep(5000); + Infobox.Show("Connection timeout.", "Cannot connect to the specified system name..."); + }); + t.IsBackground = true; + t.Start(); + } } } -- cgit v1.2.3 From 8621b3ddffdd8211604f01d90ff40c9b2991f27a Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 24 Jun 2017 14:41:45 -0400 Subject: breaking the bonds storyline --- ShiftOS.WinForms/Applications/FileSkimmer.cs | 13 ++- ShiftOS.WinForms/Commands.cs | 5 +- ShiftOS.WinForms/Properties/Resources.Designer.cs | 10 ++ ShiftOS.WinForms/Properties/Resources.resx | 3 + ShiftOS.WinForms/Resources/brute.mp3 | Bin 0 -> 1206934 bytes ShiftOS.WinForms/ShiftOS.WinForms.csproj | 1 + ShiftOS.WinForms/Stories/LegionStory.cs | 19 +++- ShiftOS.WinForms/VirtualEnvironments.cs | 109 ++++++++++++++++++++++ ShiftOS_TheReturn/AudioManager.cs | 58 +++--------- 9 files changed, 165 insertions(+), 53 deletions(-) create mode 100644 ShiftOS.WinForms/Resources/brute.mp3 (limited to 'ShiftOS.WinForms/Applications/FileSkimmer.cs') diff --git a/ShiftOS.WinForms/Applications/FileSkimmer.cs b/ShiftOS.WinForms/Applications/FileSkimmer.cs index 34f9e9c..dee751b 100644 --- a/ShiftOS.WinForms/Applications/FileSkimmer.cs +++ b/ShiftOS.WinForms/Applications/FileSkimmer.cs @@ -55,11 +55,14 @@ namespace ShiftOS.WinForms.Applications public static void DisconnectRemote() { - OnDisconnect?.Invoke(); - CurrentRemoteUser = new Objects.ClientSave(); - if (!string.IsNullOrWhiteSpace(OpenConnection.SystemName)) - Infobox.Show("Connections terminated.", "All outbound File Skimmer connections have been terminated."); - OpenConnection = new ShiftOSEnvironment(); + Desktop.InvokeOnWorkerThread(() => + { + OnDisconnect?.Invoke(); + CurrentRemoteUser = new Objects.ClientSave(); + if (!string.IsNullOrWhiteSpace(OpenConnection.SystemName)) + Infobox.Show("Connections terminated.", "All outbound File Skimmer connections have been terminated."); + OpenConnection = new ShiftOSEnvironment(); + }); } public FileSkimmer() diff --git a/ShiftOS.WinForms/Commands.cs b/ShiftOS.WinForms/Commands.cs index c7d8f5b..c9e9376 100644 --- a/ShiftOS.WinForms/Commands.cs +++ b/ShiftOS.WinForms/Commands.cs @@ -49,7 +49,10 @@ namespace ShiftOS.Engine [Command("clear", description = "{DESC_CLEAR}")] public static bool Clear() { - AppearanceManager.ConsoleOut.Clear(); + Desktop.InvokeOnWorkerThread(() => + { + AppearanceManager.ConsoleOut.Clear(); + }); return true; } } diff --git a/ShiftOS.WinForms/Properties/Resources.Designer.cs b/ShiftOS.WinForms/Properties/Resources.Designer.cs index 83515c4..dd84e94 100644 --- a/ShiftOS.WinForms/Properties/Resources.Designer.cs +++ b/ShiftOS.WinForms/Properties/Resources.Designer.cs @@ -359,6 +359,16 @@ namespace ShiftOS.WinForms.Properties { } } + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] brute { + get { + object obj = ResourceManager.GetObject("brute", resourceCulture); + return ((byte[])(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShiftOS.WinForms/Properties/Resources.resx b/ShiftOS.WinForms/Properties/Resources.resx index 8390f39..07cf941 100644 --- a/ShiftOS.WinForms/Properties/Resources.resx +++ b/ShiftOS.WinForms/Properties/Resources.resx @@ -34618,6 +34618,9 @@ ..\Resources\strings_fr.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + ..\Resources\brute.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ..\Resources\PebcakDevelFS.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 diff --git a/ShiftOS.WinForms/Resources/brute.mp3 b/ShiftOS.WinForms/Resources/brute.mp3 new file mode 100644 index 0000000..ae20cc2 Binary files /dev/null and b/ShiftOS.WinForms/Resources/brute.mp3 differ diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index f287540..d79a7e3 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -873,6 +873,7 @@ + diff --git a/ShiftOS.WinForms/Stories/LegionStory.cs b/ShiftOS.WinForms/Stories/LegionStory.cs index 0723a37..74e6ea6 100644 --- a/ShiftOS.WinForms/Stories/LegionStory.cs +++ b/ShiftOS.WinForms/Stories/LegionStory.cs @@ -163,6 +163,20 @@ namespace ShiftOS.WinForms.Stories } VirtualEnvironments.Clear(); Applications.FileSkimmer.DisconnectRemote(); + WriteLine("Connections terminated I see.. Alright. Have fun with those dummy documents - you can keep them if you'd like. There's nothing important in them."); + WriteLine("That's one thing you can do with brute and other hacking utilities. I'd recommend buying some of brute's Shiftorium upgrades to make it faster and more efficient."); + WriteLine("Also, along the way, you're going to find a lot of new tricks. Some of them will require more than just brute to get into."); + WriteLine("So be on the lookout on the Shiftnet for other hacking-related tools. You won't find any on Appscape, however..."); + WriteLine("That darn Aiden Nirh guy can't stand hackers."); + WriteLine("Looking at your logs, I see he's contacted you before... Seriously... don't let him find out about brute. He'll report it directly to DevX."); + WriteLine("Oh yeah, one more thing... that virus scanner... you may want to scan any files that you transfer from other systems with it."); + WriteLine("You never know what sorts of digital filth is hidden within such innocent-looking files."); + WriteLine("ALWAYS scan before opening - because if you open a file containing malicious code, it'll get run. It's just how ShiftOS's kernel works."); + Console.WriteLine("User has disconnected."); + Story.Context.MarkComplete(); + TerminalBackend.PrefixEnabled = true; + SaveSystem.SaveGame(); + TerminalBackend.PrintPrompt(); }); }); } @@ -173,6 +187,8 @@ namespace ShiftOS.WinForms.Stories //just to annoy victor tran } + const string VALID_PASSWORD_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_"; + public static string GenRandomPassword() { var rnd = new Random(); @@ -180,7 +196,8 @@ namespace ShiftOS.WinForms.Stories string pass = ""; for(int i = 0; i < len; i++) { - pass += (char)rnd.Next(255); + char c = VALID_PASSWORD_CHARS[rnd.Next(VALID_PASSWORD_CHARS.Length)]; + pass += c; } return pass; } diff --git a/ShiftOS.WinForms/VirtualEnvironments.cs b/ShiftOS.WinForms/VirtualEnvironments.cs index 5faa6ff..fb39569 100644 --- a/ShiftOS.WinForms/VirtualEnvironments.cs +++ b/ShiftOS.WinForms/VirtualEnvironments.cs @@ -2,7 +2,9 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; +using ShiftOS.Engine; namespace ShiftOS.WinForms { @@ -27,6 +29,113 @@ namespace ShiftOS.WinForms _environments.Clear(); } + const string VALID_PASSWORD_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_"; + + + [RequiresUpgrade("brute")] + [Command("brute")] + public static void Brute() + { + TerminalBackend.PrefixEnabled = false; + bool cracked = false; + var brute = Properties.Resources.brute; + var str = new System.IO.MemoryStream(brute); + var reader = new NAudio.Wave.Mp3FileReader(str); + var _out = new NAudio.Wave.WaveOut(); + _out.Init(reader); + _out.PlaybackStopped += (o, a) => + { + if (cracked == false) + { + cracked = true; + TerminalCommands.Clear(); + ConsoleEx.Bold = true; + ConsoleEx.ForegroundColor = ConsoleColor.Red; + Console.WriteLine(" - access denied - "); + ConsoleEx.ForegroundColor = ConsoleColor.Gray; + ConsoleEx.Bold = false; + ConsoleEx.Italic = true; + Console.WriteLine("password could not be cracked before connection termination."); + } + TerminalBackend.PrefixEnabled = true; + TerminalBackend.PrintPrompt(); + _out.Dispose(); + reader.Dispose(); + str.Dispose(); + }; + _out.Play(); + + var t = new Thread(() => + { + + + Console.WriteLine("brute - version 1.0"); + Console.WriteLine("Copyright (c) 2018 hacker101. All rights reserved."); + Console.WriteLine(); + Thread.Sleep(4000); + Console.WriteLine("Scanning outbound connections..."); + if (string.IsNullOrWhiteSpace(Applications.FileSkimmer.OpenConnection.SystemName)) + { + Thread.Sleep(2000); + Console.WriteLine(" - no outbound connections to scan, aborting - "); + _out.Stop(); + _out.Dispose(); + reader.Dispose(); + str.Dispose(); + } + else + { + Thread.Sleep(2000); + var con = Applications.FileSkimmer.OpenConnection; + Console.WriteLine($@"{con.SystemName} +------------------ + +Active connection: ftp, rts +System name: {con.SystemName} +Users: {con.Users.Count}"); + Thread.Sleep(500); + var user = con.Users.FirstOrDefault(x => x.Permissions == Objects.UserPermissions.Root); + if (user == null) + Console.WriteLine(" - no users found with root access - this is a shiftos bug - "); + else + { + Console.WriteLine(" - starting bruteforce attack on user: " + user.Username + " - "); + var rnd = new Random(); + + char[] pass = new char[user.Password.Length]; + for (int i = 0; i < pass.Length; i++) + { + if (cracked == true) + break; + while (pass[i] != user.Password[i]) + { + if (cracked == true) + break; + char c = VALID_PASSWORD_CHARS[rnd.Next(VALID_PASSWORD_CHARS.Length)]; + if (char.IsLetterOrDigit(c)) + { + pass[i] = c; + Console.WriteLine(new string(pass)); + Console.WriteLine(); + Thread.Sleep(1); + } + } + } + if (cracked == false) + { + cracked = true; + TerminalCommands.Clear(); + Console.WriteLine(" - credentials cracked. -"); + Console.WriteLine($@"sysname: {con.SystemName} +user: {user.Username} +password: {user.Password}"); + } + } + } + }); + t.Start(); + } + public static ShiftOSEnvironment Get(string sysname) { return _environments.FirstOrDefault(x => x.SystemName == sysname); diff --git a/ShiftOS_TheReturn/AudioManager.cs b/ShiftOS_TheReturn/AudioManager.cs index 85e1371..a9101b7 100644 --- a/ShiftOS_TheReturn/AudioManager.cs +++ b/ShiftOS_TheReturn/AudioManager.cs @@ -83,28 +83,15 @@ namespace ShiftOS.Engine /// The file to play. public static void Play(string file) { - bool play = true; - float volume = 1f; - if (SaveSystem.CurrentSave != null) + try { - play = (SaveSystem.CurrentSave.SoundEnabled); - volume = (float)SaveSystem.CurrentSave.MusicVolume / 100f; + var bytes = File.ReadAllBytes(file); + var str = new MemoryStream(bytes); + PlayStream(str); } - if (play) + catch { - try - { - _reader = new AudioFileReader(file); - _out = new WaveOut(); - _out.Init(_reader); - _out.Volume = volume; - _out.Play(); - _out.PlaybackStopped += (o, a) => { PlayCompleted?.Invoke(); }; - } - catch (Exception ex) - { - Console.WriteLine("Audio error: " + ex.Message); - } + } } @@ -114,35 +101,14 @@ namespace ShiftOS.Engine /// The stream to read from. public static void PlayStream(Stream str) { - try + bool play = true; + if (SaveSystem.CurrentSave != null) + play = SaveSystem.CurrentSave.SoundEnabled; + if (play) { - bool play = true; - float volume = 1f; - if (SaveSystem.CurrentSave != null) - { - play = (SaveSystem.CurrentSave.SoundEnabled); - volume = (float)SaveSystem.CurrentSave.MusicVolume / 100f; - } - if (play) - { - try - { - while (_out.PlaybackState == PlaybackState.Playing) - { - Thread.Sleep(10); - } - } - catch { } - ShiftOS.Engine.AudioManager.Stop(); - _out = new WaveOut(); - var mp3 = new WaveFileReader(str); - _out.Init(mp3); - _out.Volume = volume; - _out.Play(); - _out.PlaybackStopped += (o, a) => { PlayCompleted?.Invoke(); }; - } + var splayer = new System.Media.SoundPlayer(str); + splayer.Play(); } - catch { } } public static event Action PlayCompleted; -- cgit v1.2.3 From 9c1a409f24da92f1e6d95ee4cdd777b52d53488f Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 24 Jun 2017 14:48:39 -0400 Subject: file skimmer disconnect button --- .../Applications/FileSkimmer.Designer.cs | 177 +++++++++++---------- ShiftOS.WinForms/Applications/FileSkimmer.cs | 8 + 2 files changed, 102 insertions(+), 83 deletions(-) (limited to 'ShiftOS.WinForms/Applications/FileSkimmer.cs') diff --git a/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs b/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs index 4df58c3..91891ba 100644 --- a/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs +++ b/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs @@ -65,23 +65,24 @@ namespace ShiftOS.WinForms.Applications this.moveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pinToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pnlconnect = new System.Windows.Forms.Panel(); - this.lbctitle = new System.Windows.Forms.Label(); - this.lbcdesc = new System.Windows.Forms.Label(); - this.pnlcreds = new System.Windows.Forms.Panel(); - this.label1 = new System.Windows.Forms.Label(); - this.txtcsys = new System.Windows.Forms.TextBox(); - this.txtcuser = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.txtcpass = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); this.flcbuttons = new System.Windows.Forms.FlowLayoutPanel(); this.btncancel = new System.Windows.Forms.Button(); this.btnok = new System.Windows.Forms.Button(); + this.pnlcreds = new System.Windows.Forms.Panel(); + this.txtcpass = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtcuser = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.txtcsys = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.lbcdesc = new System.Windows.Forms.Label(); + this.lbctitle = new System.Windows.Forms.Label(); + this.disconnectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.panel1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.pnlconnect.SuspendLayout(); - this.pnlcreds.SuspendLayout(); this.flcbuttons.SuspendLayout(); + this.pnlcreds.SuspendLayout(); this.SuspendLayout(); // // lvitems @@ -131,6 +132,7 @@ namespace ShiftOS.WinForms.Applications this.newFolderToolStripMenuItem, this.deleteToolStripMenuItem, this.connectToRemoteServerToolStripMenuItem, + this.disconnectToolStripMenuItem, this.copyToolStripMenuItem, this.moveToolStripMenuItem, this.pinToolStripMenuItem}); @@ -194,24 +196,40 @@ namespace ShiftOS.WinForms.Applications this.pnlconnect.TabIndex = 4; this.pnlconnect.Visible = false; // - // lbctitle + // flcbuttons // - this.lbctitle.AutoSize = true; - this.lbctitle.Location = new System.Drawing.Point(13, 18); - this.lbctitle.Name = "lbctitle"; - this.lbctitle.Size = new System.Drawing.Size(133, 13); - this.lbctitle.TabIndex = 0; - this.lbctitle.Tag = "header3"; - this.lbctitle.Text = "Connect to Remote Server"; + this.flcbuttons.AutoSize = true; + this.flcbuttons.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.flcbuttons.Controls.Add(this.btncancel); + this.flcbuttons.Controls.Add(this.btnok); + this.flcbuttons.Location = new System.Drawing.Point(116, 256); + this.flcbuttons.Name = "flcbuttons"; + this.flcbuttons.Size = new System.Drawing.Size(94, 29); + this.flcbuttons.TabIndex = 3; // - // lbcdesc + // btncancel // - this.lbcdesc.Location = new System.Drawing.Point(46, 51); - this.lbcdesc.Name = "lbcdesc"; - this.lbcdesc.Size = new System.Drawing.Size(357, 54); - this.lbcdesc.TabIndex = 1; - this.lbcdesc.Text = resources.GetString("lbcdesc.Text"); - this.lbcdesc.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.btncancel.AutoSize = true; + this.btncancel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btncancel.Location = new System.Drawing.Point(3, 3); + this.btncancel.Name = "btncancel"; + this.btncancel.Size = new System.Drawing.Size(50, 23); + this.btncancel.TabIndex = 0; + this.btncancel.Text = "Cancel"; + this.btncancel.UseVisualStyleBackColor = true; + this.btncancel.Click += new System.EventHandler(this.btncancel_Click); + // + // btnok + // + this.btnok.AutoSize = true; + this.btnok.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnok.Location = new System.Drawing.Point(59, 3); + this.btnok.Name = "btnok"; + this.btnok.Size = new System.Drawing.Size(32, 23); + this.btnok.TabIndex = 1; + this.btnok.Text = "OK"; + this.btnok.UseVisualStyleBackColor = true; + this.btnok.Click += new System.EventHandler(this.btnok_Click); // // pnlcreds // @@ -226,23 +244,23 @@ namespace ShiftOS.WinForms.Applications this.pnlcreds.Size = new System.Drawing.Size(300, 104); this.pnlcreds.TabIndex = 2; // - // label1 + // txtcpass // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 13); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(73, 13); - this.label1.TabIndex = 0; - this.label1.Text = "System name:"; + this.txtcpass.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtcpass.Location = new System.Drawing.Point(91, 62); + this.txtcpass.Name = "txtcpass"; + this.txtcpass.Size = new System.Drawing.Size(196, 20); + this.txtcpass.TabIndex = 5; // - // txtcsys + // label3 // - this.txtcsys.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtcsys.Location = new System.Drawing.Point(91, 10); - this.txtcsys.Name = "txtcsys"; - this.txtcsys.Size = new System.Drawing.Size(196, 20); - this.txtcsys.TabIndex = 1; + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(12, 65); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(56, 13); + this.label3.TabIndex = 4; + this.label3.Text = "Password:"; // // txtcuser // @@ -262,58 +280,50 @@ namespace ShiftOS.WinForms.Applications this.label2.TabIndex = 2; this.label2.Text = "Username:"; // - // txtcpass + // txtcsys // - this.txtcpass.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtcsys.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtcpass.Location = new System.Drawing.Point(91, 62); - this.txtcpass.Name = "txtcpass"; - this.txtcpass.Size = new System.Drawing.Size(196, 20); - this.txtcpass.TabIndex = 5; + this.txtcsys.Location = new System.Drawing.Point(91, 10); + this.txtcsys.Name = "txtcsys"; + this.txtcsys.Size = new System.Drawing.Size(196, 20); + this.txtcsys.TabIndex = 1; // - // label3 + // label1 // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(12, 65); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(56, 13); - this.label3.TabIndex = 4; - this.label3.Text = "Password:"; + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(73, 13); + this.label1.TabIndex = 0; + this.label1.Text = "System name:"; // - // flcbuttons + // lbcdesc // - this.flcbuttons.AutoSize = true; - this.flcbuttons.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.flcbuttons.Controls.Add(this.btncancel); - this.flcbuttons.Controls.Add(this.btnok); - this.flcbuttons.Location = new System.Drawing.Point(116, 256); - this.flcbuttons.Name = "flcbuttons"; - this.flcbuttons.Size = new System.Drawing.Size(94, 29); - this.flcbuttons.TabIndex = 3; + this.lbcdesc.Location = new System.Drawing.Point(46, 51); + this.lbcdesc.Name = "lbcdesc"; + this.lbcdesc.Size = new System.Drawing.Size(357, 54); + this.lbcdesc.TabIndex = 1; + this.lbcdesc.Text = resources.GetString("lbcdesc.Text"); + this.lbcdesc.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // btncancel + // lbctitle // - this.btncancel.AutoSize = true; - this.btncancel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btncancel.Location = new System.Drawing.Point(3, 3); - this.btncancel.Name = "btncancel"; - this.btncancel.Size = new System.Drawing.Size(50, 23); - this.btncancel.TabIndex = 0; - this.btncancel.Text = "Cancel"; - this.btncancel.UseVisualStyleBackColor = true; - this.btncancel.Click += new System.EventHandler(this.btncancel_Click); + this.lbctitle.AutoSize = true; + this.lbctitle.Location = new System.Drawing.Point(13, 18); + this.lbctitle.Name = "lbctitle"; + this.lbctitle.Size = new System.Drawing.Size(133, 13); + this.lbctitle.TabIndex = 0; + this.lbctitle.Tag = "header3"; + this.lbctitle.Text = "Connect to Remote Server"; // - // btnok + // disconnectToolStripMenuItem // - this.btnok.AutoSize = true; - this.btnok.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btnok.Location = new System.Drawing.Point(59, 3); - this.btnok.Name = "btnok"; - this.btnok.Size = new System.Drawing.Size(32, 23); - this.btnok.TabIndex = 1; - this.btnok.Text = "OK"; - this.btnok.UseVisualStyleBackColor = true; - this.btnok.Click += new System.EventHandler(this.btnok_Click); + this.disconnectToolStripMenuItem.Name = "disconnectToolStripMenuItem"; + this.disconnectToolStripMenuItem.Size = new System.Drawing.Size(78, 20); + this.disconnectToolStripMenuItem.Text = "Disconnect"; + this.disconnectToolStripMenuItem.Visible = false; + this.disconnectToolStripMenuItem.Click += new System.EventHandler(this.disconnectToolStripMenuItem_Click); // // FileSkimmer // @@ -330,10 +340,10 @@ namespace ShiftOS.WinForms.Applications this.menuStrip1.PerformLayout(); this.pnlconnect.ResumeLayout(false); this.pnlconnect.PerformLayout(); - this.pnlcreds.ResumeLayout(false); - this.pnlcreds.PerformLayout(); this.flcbuttons.ResumeLayout(false); this.flcbuttons.PerformLayout(); + this.pnlcreds.ResumeLayout(false); + this.pnlcreds.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -365,5 +375,6 @@ namespace ShiftOS.WinForms.Applications private System.Windows.Forms.Label label1; private System.Windows.Forms.Label lbcdesc; private System.Windows.Forms.Label lbctitle; + private System.Windows.Forms.ToolStripMenuItem disconnectToolStripMenuItem; } } \ No newline at end of file diff --git a/ShiftOS.WinForms/Applications/FileSkimmer.cs b/ShiftOS.WinForms/Applications/FileSkimmer.cs index dee751b..3e17420 100644 --- a/ShiftOS.WinForms/Applications/FileSkimmer.cs +++ b/ShiftOS.WinForms/Applications/FileSkimmer.cs @@ -77,6 +77,8 @@ namespace ShiftOS.WinForms.Applications private void FileSkimmer_OnDisconnect() { + connectToRemoteServerToolStripMenuItem.Text = "Start Remote Session"; + disconnectToolStripMenuItem.Visible = false; currentdir = "__system"; ResetList(); } @@ -579,6 +581,7 @@ namespace ShiftOS.WinForms.Applications ChangeDirectory("2:"); pnlconnect.Hide(); connectToRemoteServerToolStripMenuItem.Text = "Reauthenticate"; + disconnectToolStripMenuItem.Visible = true; return; } Infobox.Show("Access denied.", "Authentication failed for the specified user. Connection aborted."); @@ -592,5 +595,10 @@ namespace ShiftOS.WinForms.Applications t.IsBackground = true; t.Start(); } + + private void disconnectToolStripMenuItem_Click(object sender, EventArgs e) + { + DisconnectRemote(); + } } } -- cgit v1.2.3