Compare commits

...

7 Commits

Author SHA1 Message Date
Riley McArdle
5835e5f72c Revert "Merge pull request #101 from ozkanpakdil/develop"
This reverts commit 7350e94662, reversing
changes made to 14d1f6cde2.
2014-03-16 13:45:20 -05:00
Andreas Rehm
7350e94662 Merge pull request #101 from ozkanpakdil/develop
multi command for ssh
2014-03-16 16:52:57 +01:00
ozkan.pakdil
d5d2d5bf82 multi command for ssh 2014-03-16 17:44:53 +02:00
Riley McArdle
14d1f6cde2 Add support for importing files from PuTTY Connection Manager. Improve the import and export functionality. 2013-12-17 22:10:24 -06:00
Riley McArdle
9f17b917f7 Change icon for "Full Screen (RDP)" in connection tab context menu. 2013-11-26 16:17:21 -06:00
Riley McArdle
c046b48ee9 Update CHANGELOG.TXT. 2013-11-24 22:21:37 -06:00
Riley McArdle
cb6cf7c01f Move SharedLibraryNG into mRemoteNG solution folder. 2013-11-24 22:18:17 -06:00
45 changed files with 3540 additions and 1805 deletions

View File

@@ -1,3 +1,8 @@
1.73 Beta 2 ():
Fixed issue MR-619 - Keyboard shortcuts stop working after locking the screen with Win+L
Added support for importing files from PuTTY Connection Manager.
Improved the import and export functionality.
1.73 Beta 1 (2013-11-19):
Added feature MR-16 - Add keyboard shortcuts to switch between tabs
Added feature MR-141 - Add a default protocol option

View File

@@ -0,0 +1,331 @@
using System.Collections;
using System.Collections.Generic;
using System.Windows.Forms;
//
// Hotkey selection control, written by serenity@exscape.org, 2006-08-03
// Please mail me if you find a bug.
//
namespace SharedLibraryNG
{
/// <summary>
/// A simple control that allows the user to select pretty much any valid hotkey combination
/// </summary>
public class HotkeyControl : TextBox
{
private const string KeySeparator = " + ";
// These variables store the current hotkey and modifier(s)
private Keys _keyCode = Keys.None;
private Keys _modifiers = Keys.None;
// ArrayLists used to enforce the use of proper modifiers.
// Shift+A isn't a valid hotkey, for instance, as it would screw up when the user is typing.
private readonly ArrayList _needNonShiftModifier;
private readonly ArrayList _needNonAltGrModifier;
private readonly ContextMenu _emptyContextMenu = new ContextMenu();
/// <summary>
/// Used to make sure that there is no right-click menu available
/// </summary>
public override ContextMenu ContextMenu
{
get
{
return _emptyContextMenu;
}
// ReSharper disable once ValueParameterNotUsed
set
{
base.ContextMenu = _emptyContextMenu;
}
}
/// <summary>
/// Forces the control to be non-multiline
/// </summary>
public override bool Multiline
{
get
{
return base.Multiline;
}
// ReSharper disable once ValueParameterNotUsed
set
{
// Ignore what the user wants; force Multiline to false
base.Multiline = false;
}
}
/// <summary>
/// Creates a new HotkeyControl
/// </summary>
public HotkeyControl()
{
// Handle events that occurs when keys are pressed
KeyUp += HotkeyControl_KeyUp;
// Fill the ArrayLists that contain all invalid hotkey combinations
_needNonShiftModifier = new ArrayList();
_needNonAltGrModifier = new ArrayList();
PopulateModifierLists();
}
protected override void OnCreateControl()
{
base.OnCreateControl();
ContextMenu = _emptyContextMenu; // Disable right-clicking
Multiline = false;
Text = "None";
}
/// <summary>
/// Populates the ArrayLists specifying disallowed hotkeys
/// such as Shift+A, Ctrl+Alt+4 (would produce a dollar sign) etc
/// </summary>
private void PopulateModifierLists()
{
// Shift + 0 - 9, A - Z
for (var k = Keys.D0; k <= Keys.Z; k++)
_needNonShiftModifier.Add((int)k);
// Shift + Numpad keys
for (var k = Keys.NumPad0; k <= Keys.NumPad9; k++)
_needNonShiftModifier.Add((int)k);
// Shift + Misc (,;<./ etc)
for (var k = Keys.Oem1; k <= Keys.OemBackslash; k++)
_needNonShiftModifier.Add((int)k);
// Misc keys that we can't loop through
_needNonShiftModifier.Add((int)Keys.Insert);
_needNonShiftModifier.Add((int)Keys.Help);
_needNonShiftModifier.Add((int)Keys.Multiply);
_needNonShiftModifier.Add((int)Keys.Add);
_needNonShiftModifier.Add((int)Keys.Subtract);
_needNonShiftModifier.Add((int)Keys.Divide);
_needNonShiftModifier.Add((int)Keys.Decimal);
_needNonShiftModifier.Add((int)Keys.Return);
_needNonShiftModifier.Add((int)Keys.Escape);
_needNonShiftModifier.Add((int)Keys.NumLock);
_needNonShiftModifier.Add((int)Keys.Scroll);
_needNonShiftModifier.Add((int)Keys.Pause);
// Ctrl+Alt + 0 - 9
for (var k = Keys.D0; k <= Keys.D9; k++)
_needNonAltGrModifier.Add((int)k);
}
/// <summary>
/// Fires when all keys are released. If the current hotkey isn't valid, reset it.
/// Otherwise, do nothing and keep the text and hotkey as it was.
/// </summary>
void HotkeyControl_KeyUp(object sender, KeyEventArgs e)
{
if (_keyCode == Keys.None && ModifierKeys == Keys.None) ResetHotkey();
}
/// <summary>
/// Handles some misc keys, such as Ctrl+Delete and Shift+Insert
/// </summary>
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
var keyCode = keyData & Keys.KeyCode;
var modifiers = keyData & Keys.Modifiers;
if (keyData == Keys.Back || keyData == Keys.Delete)
{
ResetHotkey();
return true;
}
_keyCode = keyCode;
_modifiers = modifiers;
Redraw();
return true;
}
/// <summary>
/// Clears the current hotkey and resets the TextBox
/// </summary>
public void ResetHotkey()
{
_keyCode = Keys.None;
_modifiers = Keys.None;
Text = "None";
}
/// <summary>
/// Used to get/set the hotkey (e.g. Keys.A)
/// </summary>
public Keys KeyCode
{
get
{
return _keyCode;
}
set
{
_keyCode = value;
Redraw(false);
}
}
/// <summary>
/// Used to get/set the modifier keys (e.g. Keys.Alt | Keys.Control)
/// </summary>
public Keys HotkeyModifiers
{
get
{
return _modifiers;
}
set
{
_modifiers = value;
Redraw(false);
}
}
/// <summary>
/// Redraws the TextBox when necessary.
/// </summary>
/// <param name="validate">Specifies whether this function was called by the Hotkey/HotkeyModifiers properties or by the user.</param>
private void Redraw(bool validate = true)
{
// Only validate input if it comes from the user
if (validate)
{
// No modifier or shift only, AND a hotkey that needs another modifier
if ((_modifiers == Keys.Shift || _modifiers == Keys.None) &&
_needNonShiftModifier.Contains((int) _keyCode))
{
if (_modifiers == Keys.None)
{
// Set Ctrl+Alt as the modifier unless Ctrl+Alt+<key> won't work...
if (_needNonAltGrModifier.Contains((int) _keyCode) == false)
_modifiers = Keys.Alt | Keys.Control;
else // ... in that case, use Shift+Alt instead.
_modifiers = Keys.Alt | Keys.Shift;
}
else
{
// User pressed Shift and an invalid key (e.g. a letter or a number),
// that needs another set of modifier keys
_keyCode = Keys.None;
Text = _modifiers + " + Invalid Key";
return;
}
}
// Check all Ctrl+Alt keys
if ((_modifiers == (Keys.Alt | Keys.Control)) &&
_needNonAltGrModifier.Contains((int) _keyCode))
{
// Ctrl+Alt+4 etc won't work; reset hotkey and tell the user
_keyCode = Keys.None;
Text = _modifiers + " + Invalid Key";
return;
}
}
// Don't allow modifiers keys for _keyCode
if (_keyCode == Keys.ShiftKey ||
_keyCode == Keys.LShiftKey ||
_keyCode == Keys.RShiftKey ||
_keyCode == Keys.ControlKey ||
_keyCode == Keys.LControlKey ||
_keyCode == Keys.RControlKey ||
_keyCode == Keys.Menu ||
_keyCode == Keys.LMenu ||
_keyCode == Keys.RMenu ||
_keyCode == Keys.LWin ||
_keyCode == Keys.RWin)
_keyCode = Keys.None;
if (_modifiers == Keys.None)
{
if (_keyCode == Keys.None)
{
ResetHotkey();
return;
}
// We get here if we've got a hotkey that is valid without a modifier,
// like F1-F12, Media-keys etc.
Text = _keyCode.ToString();
return;
}
Text = string.Join(KeySeparator, new[] { KeysToString(_modifiers), KeysToString(_keyCode) });
}
public static string KeysToString(Keys keys)
{
if (keys == Keys.None) return "None";
var modifiers = (keys & Keys.Modifiers);
var keyCode = (keys & Keys.KeyCode);
var strings = new List<string>();
if (modifiers != 0)
{
var modifierStrings = new List<string>(modifiers.ToString().Replace(", ", ",").Split(','));
modifierStrings.Sort(new KeyModifierComparer());
strings.AddRange(modifierStrings);
}
if (keyCode != 0)
{
var keyString = keyCode.ToString();
var keyHashtable = new Dictionary<string, string>
{
{"Next", "PageDown"},
{"Oemcomma", ","},
{"OemMinus", "-"},
{"OemOpenBrackets", "["},
{"OemPeriod", "."},
{"Oemplus", "="},
{"OemQuestion", "/"},
{"Oemtilde", "`"},
{"D0", "0"},
{"D1", "1"},
{"D2", "2"},
{"D3", "3"},
{"D4", "4"},
{"D5", "5"},
{"D6", "6"},
{"D7", "7"},
{"D8", "8"},
{"D9", "9"},
};
if (keyHashtable.ContainsKey(keyString)) keyString = keyHashtable[keyString];
strings.Add(keyString);
}
return string.Join(KeySeparator, strings.ToArray());
}
private class KeyModifierComparer : IComparer<string>
{
private static readonly List<string> ModifierOrder = new List<string>
{
"control",
"alt",
"shift",
};
public int Compare(string x, string y)
{
var xIndex = ModifierOrder.IndexOf(x.ToLowerInvariant());
var yIndex = ModifierOrder.IndexOf(y.ToLowerInvariant());
return xIndex - yIndex;
}
}
}
}

View File

@@ -0,0 +1,258 @@
//
// Based on code from Stephen Toub's MSDN blog at
// http://blogs.msdn.com/b/toub/archive/2006/05/03/589423.aspx
//
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Collections.Generic;
namespace SharedLibraryNG
{
public class KeyboardHook
{
// ReSharper disable InconsistentNaming
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool PostMessage(IntPtr hWnd, Int32 Msg, IntPtr wParam, HookKeyMsgData lParam);
// ReSharper restore InconsistentNaming
[Flags]
public enum ModifierKeys
{
None = 0x0000,
Shift = 0x0001,
LeftShift = 0x002,
RightShift = 0x004,
Control = 0x0008,
LeftControl = 0x010,
RightControl = 0x20,
Alt = 0x0040,
LeftAlt = 0x0080,
RightAlt = 0x0100,
Win = 0x0200,
LeftWin = 0x0400,
RightWin = 0x0800,
}
protected class KeyNotificationEntry
: IEquatable<KeyNotificationEntry>
{
public IntPtr WindowHandle;
public Int32 KeyCode;
public ModifierKeys ModifierKeys;
public Boolean Block;
public bool Equals(KeyNotificationEntry obj)
{
return (WindowHandle == obj.WindowHandle &&
KeyCode == obj.KeyCode &&
ModifierKeys == obj.ModifierKeys &&
Block == obj.Block);
}
}
public const string HookKeyMsgName = "HOOKKEYMSG-{56BE0940-34DA-11E1-B308-C6714824019B}";
private static Int32 _hookKeyMsg;
public static Int32 HookKeyMsg
{
get
{
if (_hookKeyMsg == 0)
{
_hookKeyMsg = Win32.RegisterWindowMessage(HookKeyMsgName).ToInt32();
if (_hookKeyMsg == 0)
throw new Win32Exception(Marshal.GetLastWin32Error());
}
return _hookKeyMsg;
}
}
// this is a custom structure that will be passed to
// the requested hWnd via a WM_APP_HOOKKEYMSG message
[StructLayout(LayoutKind.Sequential)]
public class HookKeyMsgData
{
public Int32 KeyCode;
public ModifierKeys ModifierKeys;
public Boolean WasBlocked;
}
private static int _referenceCount;
private static IntPtr _hook;
private static readonly Win32.LowLevelKeyboardProcDelegate LowLevelKeyboardProcStaticDelegate = LowLevelKeyboardProc;
private static readonly List<KeyNotificationEntry> NotificationEntries = new List<KeyNotificationEntry>();
public KeyboardHook()
{
_referenceCount++;
SetHook();
}
~KeyboardHook()
{
_referenceCount--;
if (_referenceCount < 1) UnsetHook();
}
private static void SetHook()
{
if (_hook != IntPtr.Zero) return;
var curProcess = Process.GetCurrentProcess();
var curModule = curProcess.MainModule;
var hook = Win32.SetWindowsHookEx(Win32.WH_KEYBOARD_LL, LowLevelKeyboardProcStaticDelegate, Win32.GetModuleHandle(curModule.ModuleName), 0);
if (hook == IntPtr.Zero)
throw new Win32Exception(Marshal.GetLastWin32Error());
_hook = hook;
}
private static void UnsetHook()
{
if (_hook == IntPtr.Zero) return;
Win32.UnhookWindowsHookEx(_hook);
_hook = IntPtr.Zero;
}
private static IntPtr LowLevelKeyboardProc(Int32 nCode, IntPtr wParam, Win32.KBDLLHOOKSTRUCT lParam)
{
var wParamInt = wParam.ToInt32();
var result = 0;
if (nCode == Win32.HC_ACTION)
{
switch (wParamInt)
{
case Win32.WM_KEYDOWN:
case Win32.WM_SYSKEYDOWN:
case Win32.WM_KEYUP:
case Win32.WM_SYSKEYUP:
result = OnKey(wParamInt, lParam);
break;
}
}
if (result != 0) return new IntPtr(result);
return Win32.CallNextHookEx(_hook, nCode, wParam, lParam);
}
private static int OnKey(Int32 msg, Win32.KBDLLHOOKSTRUCT key)
{
var result = 0;
foreach (var notificationEntry in NotificationEntries)
if (GetFocusWindow() == notificationEntry.WindowHandle && notificationEntry.KeyCode == key.vkCode)
{
var modifierKeys = GetModifierKeyState();
if (!ModifierKeysMatch(notificationEntry.ModifierKeys, modifierKeys)) continue;
var wParam = new IntPtr(msg);
var lParam = new HookKeyMsgData
{
KeyCode = key.vkCode,
ModifierKeys = modifierKeys,
WasBlocked = notificationEntry.Block,
};
if (!PostMessage(notificationEntry.WindowHandle, HookKeyMsg, wParam, lParam))
throw new Win32Exception(Marshal.GetLastWin32Error());
if (notificationEntry.Block) result = 1;
}
return result;
}
private static IntPtr GetFocusWindow()
{
var guiThreadInfo = new Win32.GUITHREADINFO();
if (!Win32.GetGUIThreadInfo(0, guiThreadInfo))
throw new Win32Exception(Marshal.GetLastWin32Error());
return Win32.GetAncestor(guiThreadInfo.hwndFocus, Win32.GA_ROOT);
}
protected static Dictionary<Int32, ModifierKeys> ModifierKeyTable = new Dictionary<Int32, ModifierKeys>
{
{ Win32.VK_SHIFT, ModifierKeys.Shift },
{ Win32.VK_LSHIFT, ModifierKeys.LeftShift },
{ Win32.VK_RSHIFT, ModifierKeys.RightShift },
{ Win32.VK_CONTROL, ModifierKeys.Control },
{ Win32.VK_LCONTROL, ModifierKeys.LeftControl },
{ Win32.VK_RCONTROL, ModifierKeys.RightControl },
{ Win32.VK_MENU, ModifierKeys.Alt },
{ Win32.VK_LMENU, ModifierKeys.LeftAlt },
{ Win32.VK_RMENU, ModifierKeys.RightAlt },
{ Win32.VK_LWIN, ModifierKeys.LeftWin },
{ Win32.VK_RWIN, ModifierKeys.RightWin },
};
public static ModifierKeys GetModifierKeyState()
{
var modifierKeyState = ModifierKeys.None;
foreach (KeyValuePair<Int32, ModifierKeys> pair in ModifierKeyTable)
{
if ((Win32.GetAsyncKeyState(pair.Key) & Win32.KEYSTATE_PRESSED) != 0) modifierKeyState |= pair.Value;
}
if ((modifierKeyState & ModifierKeys.LeftWin) != 0) modifierKeyState |= ModifierKeys.Win;
if ((modifierKeyState & ModifierKeys.RightWin) != 0) modifierKeyState |= ModifierKeys.Win;
return modifierKeyState;
}
public static Boolean ModifierKeysMatch(ModifierKeys requestedKeys, ModifierKeys pressedKeys)
{
if ((requestedKeys & ModifierKeys.Shift) != 0) pressedKeys &= ~(ModifierKeys.LeftShift | ModifierKeys.RightShift);
if ((requestedKeys & ModifierKeys.Control) != 0) pressedKeys &= ~(ModifierKeys.LeftControl | ModifierKeys.RightControl);
if ((requestedKeys & ModifierKeys.Alt) != 0) pressedKeys &= ~(ModifierKeys.LeftAlt | ModifierKeys.RightAlt);
if ((requestedKeys & ModifierKeys.Win) != 0) pressedKeys &= ~(ModifierKeys.LeftWin | ModifierKeys.RightWin);
return requestedKeys == pressedKeys;
}
public static void RequestKeyNotification(IntPtr windowHandle, Int32 keyCode, Boolean block)
{
RequestKeyNotification(windowHandle, keyCode, ModifierKeys.None, block);
}
public static void RequestKeyNotification(IntPtr windowHandle, Int32 keyCode, ModifierKeys modifierKeys = ModifierKeys.None, Boolean block = false)
{
var newNotificationEntry = new KeyNotificationEntry
{
WindowHandle = windowHandle,
KeyCode = keyCode,
ModifierKeys = modifierKeys,
Block = block,
};
foreach (var notificationEntry in NotificationEntries)
if (notificationEntry == newNotificationEntry) return;
NotificationEntries.Add(newNotificationEntry);
}
public static void CancelKeyNotification(IntPtr windowHandle, Int32 keyCode, Boolean block)
{
CancelKeyNotification(windowHandle, keyCode, ModifierKeys.None, block);
}
public static void CancelKeyNotification(IntPtr windowHandle, Int32 keyCode, ModifierKeys modifierKeys = ModifierKeys.None, Boolean block = false)
{
var notificationEntry = new KeyNotificationEntry
{
WindowHandle = windowHandle,
KeyCode = keyCode,
ModifierKeys = modifierKeys,
Block = block,
};
NotificationEntries.Remove(notificationEntry);
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SharedLibraryNG")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SharedLibraryNG")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f4470853-f933-4203-9d2a-b3c731e225c7")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0F615504-5F30-4CF2-8341-1DE7FEC95A23}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SharedLibraryNG</RootNamespace>
<AssemblyName>SharedLibraryNG</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="HotkeyControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="KeyboardHook.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Win32.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

171
SharedLibraryNG/Win32.cs Normal file
View File

@@ -0,0 +1,171 @@
using System;
using System.Runtime.InteropServices;
namespace SharedLibraryNG
{
// ReSharper disable InconsistentNaming
public static class Win32
{
#region Functions
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProcDelegate lpfn, IntPtr hMod, Int32 dwThreadId);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool UnhookWindowsHookEx(IntPtr hhk);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, KBDLLHOOKSTRUCT lParam);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr GetModuleHandle(string lpModuleName);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr RegisterWindowMessage(string lpString);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetGUIThreadInfo(Int32 idThread, GUITHREADINFO lpgui);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern IntPtr GetAncestor(IntPtr hwnd, UInt32 gaFlags);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern Int16 GetAsyncKeyState(Int32 vKey);
#endregion
#region Delegates
public delegate IntPtr LowLevelKeyboardProcDelegate(Int32 nCode, IntPtr wParam, KBDLLHOOKSTRUCT lParam);
#endregion
#region Structures
[StructLayout(LayoutKind.Sequential)]
public class KBDLLHOOKSTRUCT
{
public Int32 vkCode;
public Int32 scanCode;
public Int32 flags;
public Int32 time;
public IntPtr dwExtraInfo;
};
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
[StructLayout(LayoutKind.Sequential)]
public class GUITHREADINFO
{
public GUITHREADINFO()
{
cbSize = Convert.ToInt32(Marshal.SizeOf(this));
}
public Int32 cbSize;
public Int32 flags;
public IntPtr hwndActive;
public IntPtr hwndFocus;
public IntPtr hwndCapture;
public IntPtr hwndMenuOwner;
public IntPtr hwndMoveSize;
public IntPtr hwndCaret;
public RECT rcCaret;
}
#endregion
#region Constants
// GetAncestor
public const int GA_ROOT = 2;
// SetWindowsHookEx
public const int WH_KEYBOARD_LL = 13;
// LowLevelKeyboardProcDelegate
public const int HC_ACTION = 0;
// SendMessage
public const int WM_KEYDOWN = 0x0100;
public const int WM_KEYUP = 0x0101;
public const int WM_SYSKEYDOWN = 0x0104;
public const int WM_SYSKEYUP = 0x0105;
// GetAsyncKeyState
public const int KEYSTATE_PRESSED = 0x8000;
#region Virtual Keys
public const int VK_CANCEL = 0x0003;
public const int VK_BACK = 0x0008;
public const int VK_TAB = 0x0009;
public const int VK_CLEAR = 0x000C;
public const int VK_RETURN = 0x000D;
public const int VK_PAUSE = 0x0013;
public const int VK_ESCAPE = 0x001B;
public const int VK_SNAPSHOT = 0x002C;
public const int VK_INSERT = 0x002D;
public const int VK_DELETE = 0x002E;
public const int VK_HOME = 0x0024;
public const int VK_END = 0x0023;
public const int VK_PRIOR = 0x0021;
public const int VK_NEXT = 0x0022;
public const int VK_LEFT = 0x0025;
public const int VK_UP = 0x0026;
public const int VK_RIGHT = 0x0027;
public const int VK_DOWN = 0x0028;
public const int VK_SELECT = 0x0029;
public const int VK_PRINT = 0x002A;
public const int VK_EXECUTE = 0x002B;
public const int VK_HELP = 0x002F;
public const int VK_LWIN = 0x005B;
public const int VK_RWIN = 0x005C;
public const int VK_APPS = 0x005D;
public const int VK_F1 = 0x0070;
public const int VK_F2 = 0x0071;
public const int VK_F3 = 0x0072;
public const int VK_F4 = 0x0073;
public const int VK_F5 = 0x0074;
public const int VK_F6 = 0x0075;
public const int VK_F7 = 0x0076;
public const int VK_F8 = 0x0077;
public const int VK_F9 = 0x0078;
public const int VK_F10 = 0x0079;
public const int VK_F11 = 0x007A;
public const int VK_F12 = 0x007B;
public const int VK_SHIFT = 0x0010;
public const int VK_LSHIFT = 0x00A0;
public const int VK_RSHIFT = 0x00A1;
public const int VK_CONTROL = 0x0011;
public const int VK_LCONTROL = 0x00A2;
public const int VK_RCONTROL = 0x00A3;
public const int VK_MENU = 0x0012;
public const int VK_LMENU = 0x00A4;
public const int VK_RMENU = 0x00A5;
public const int VK_OEM_1 = 0x00BA;
public const int VK_OEM_2 = 0x00BF;
public const int VK_OEM_3 = 0x00C0;
public const int VK_OEM_4 = 0x00DB;
public const int VK_OEM_5 = 0x00DC;
public const int VK_OEM_6 = 0x00DD;
public const int VK_OEM_7 = 0x00DE;
public const int VK_OEM_8 = 0x00DF;
public const int VK_OEM_102 = 0x00E2;
#endregion
#endregion
// ReSharper restore InconsistentNaming
}
}

View File

@@ -25,6 +25,7 @@
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>TestProject.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -34,6 +35,7 @@
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>TestProject.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
@@ -161,10 +163,6 @@
<Shadow Include="Test References\mRemoteNG.accessor" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharedLibraryNG\SharedLibraryNG\SharedLibraryNG.csproj">
<Project>{0F615504-5F30-4CF2-8341-1DE7FEC95A23}</Project>
<Name>SharedLibraryNG</Name>
</ProjectReference>
<ProjectReference Include="..\mRemoteV1\mRemoteV1.vbproj">
<Project>{4934A491-40BC-4E5B-9166-EA1169A220F6}</Project>
<Name>mRemoteV1</Name>

View File

@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "mRemoteV1", "mRemoteV1\mRemoteV1.vbproj", "{4934A491-40BC-4E5B-9166-EA1169A220F6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedLibraryNG", "..\SharedLibraryNG\SharedLibraryNG\SharedLibraryNG.csproj", "{0F615504-5F30-4CF2-8341-1DE7FEC95A23}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "TestProject", "TestProject\TestProject.vbproj", "{24E0689D-95C0-4AAB-A93F-B8D6B7F0CB97}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{38EB1EFD-C8C8-49A2-BCA7-63F7A02B3153}"
@@ -14,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedLibraryNG", "SharedLibraryNG\SharedLibraryNG.csproj", "{0F615504-5F30-4CF2-8341-1DE7FEC95A23}"
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = mRemoteV1.vsmdi
@@ -33,14 +33,6 @@ Global
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release Portable|Any CPU.Build.0 = Release Portable|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4934A491-40BC-4E5B-9166-EA1169A220F6}.Release|Any CPU.Build.0 = Release|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Debug Portable|Any CPU.ActiveCfg = Debug|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Debug Portable|Any CPU.Build.0 = Debug|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Release Portable|Any CPU.ActiveCfg = Release|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Release Portable|Any CPU.Build.0 = Release|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Release|Any CPU.Build.0 = Release|Any CPU
{24E0689D-95C0-4AAB-A93F-B8D6B7F0CB97}.Debug Portable|Any CPU.ActiveCfg = Debug|Any CPU
{24E0689D-95C0-4AAB-A93F-B8D6B7F0CB97}.Debug Portable|Any CPU.Build.0 = Debug|Any CPU
{24E0689D-95C0-4AAB-A93F-B8D6B7F0CB97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -49,6 +41,14 @@ Global
{24E0689D-95C0-4AAB-A93F-B8D6B7F0CB97}.Release Portable|Any CPU.Build.0 = Release|Any CPU
{24E0689D-95C0-4AAB-A93F-B8D6B7F0CB97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24E0689D-95C0-4AAB-A93F-B8D6B7F0CB97}.Release|Any CPU.Build.0 = Release|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Debug Portable|Any CPU.ActiveCfg = Debug|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Debug Portable|Any CPU.Build.0 = Debug|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Release Portable|Any CPU.ActiveCfg = Release|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Release Portable|Any CPU.Build.0 = Release|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F615504-5F30-4CF2-8341-1DE7FEC95A23}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -7,7 +7,6 @@ Imports mRemoteNG.Connection
Imports mRemoteNG.Tools
Imports mRemoteNG.Forms.OptionsPages
Imports PSTaskDialog
Imports mRemoteNG.Config.Putty
Imports WeifenLuo.WinFormsUI.Docking
Imports System.IO
Imports Crownwood
@@ -222,7 +221,7 @@ Namespace App
Public Shared sessionsPanel As New DockContent
Public Shared screenshotForm As UI.Window.ScreenshotManager
Public Shared screenshotPanel As New DockContent
Public Shared exportForm As UI.Window.Export
Public Shared exportForm As ExportForm
Public Shared exportPanel As New DockContent
Public Shared aboutForm As UI.Window.About
Public Shared aboutPanel As New DockContent
@@ -230,7 +229,7 @@ Namespace App
Public Shared updatePanel As New DockContent
Public Shared sshtransferForm As UI.Window.SSHTransfer
Public Shared sshtransferPanel As New DockContent
Public Shared adimportForm As UI.Window.ADImport
Public Shared adimportForm As UI.Window.ActiveDirectoryImport
Public Shared adimportPanel As New DockContent
Public Shared helpForm As UI.Window.Help
Public Shared helpPanel As New DockContent
@@ -245,7 +244,7 @@ Namespace App
Public Shared AnnouncementForm As UI.Window.Announcement
Public Shared AnnouncementPanel As New DockContent
Public Shared Sub Show(ByVal windowType As UI.Window.Type, Optional ByVal portScanMode As PortScan.PortScanMode = PortScan.PortScanMode.Normal)
Public Shared Sub Show(ByVal windowType As UI.Window.Type, Optional ByVal portScanImport As Boolean = False)
Try
Select Case windowType
Case UI.Window.Type.About
@@ -255,9 +254,9 @@ Namespace App
End If
aboutForm.Show(frmMain.pnlDock)
Case UI.Window.Type.ADImport
Case UI.Window.Type.ActiveDirectoryImport
If adimportForm Is Nothing OrElse adimportForm.IsDisposed Then
adimportForm = New UI.Window.ADImport(adimportPanel)
adimportForm = New UI.Window.ActiveDirectoryImport(adimportPanel)
adimportPanel = adimportForm
End If
@@ -266,13 +265,6 @@ Namespace App
Using optionsForm As New OptionsForm()
optionsForm.ShowDialog(frmMain)
End Using
Case UI.Window.Type.Export
If exportForm Is Nothing OrElse exportForm.IsDisposed Then
exportForm = New UI.Window.Export(exportPanel)
exportPanel = exportForm
End If
exportForm.Show(frmMain.pnlDock)
Case UI.Window.Type.SSHTransfer
sshtransferForm = New UI.Window.SSHTransfer(sshtransferPanel)
sshtransferPanel = sshtransferForm
@@ -300,7 +292,7 @@ Namespace App
externalappsForm.Show(frmMain.pnlDock)
Case UI.Window.Type.PortScan
portscanForm = New UI.Window.PortScan(portscanPanel, portScanMode)
portscanForm = New UI.Window.PortScan(portscanPanel, portScanImport)
portscanPanel = portscanForm
portscanForm.Show(frmMain.pnlDock)
@@ -1211,255 +1203,6 @@ Namespace App
End If
End Function
Public Shared Sub ImportConnections()
Try
Dim lD As OpenFileDialog = Tools.Controls.ConnectionsLoadDialog
lD.Multiselect = True
If lD.ShowDialog = DialogResult.OK Then
Dim nNode As TreeNode = Nothing
For i As Integer = 0 To lD.FileNames.Length - 1
nNode = Tree.Node.AddNode(Tree.Node.Type.Container, "Import #" & i)
Dim nContI As New mRemoteNG.Container.Info()
nContI.TreeNode = nNode
nContI.ConnectionInfo = New mRemoteNG.Connection.Info(nContI)
If Tree.Node.SelectedNode IsNot Nothing Then
If Tree.Node.GetNodeType(Tree.Node.SelectedNode) = Tree.Node.Type.Container Then
nContI.Parent = Tree.Node.SelectedNode.Tag
End If
End If
nNode.Tag = nContI
ContainerList.Add(nContI)
Dim conL As New Config.Connections.Load
conL.ConnectionFileName = lD.FileNames(i)
conL.RootTreeNode = nNode
conL.ConnectionList = App.Runtime.ConnectionList
conL.ContainerList = App.Runtime.ContainerList
conL.Load(True)
Windows.treeForm.tvConnections.SelectedNode.Nodes.Add(nNode)
Next
End If
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, My.Language.strConnectionsFileCouldNotBeImported & vbNewLine & ex.Message)
End Try
End Sub
Public Shared Sub ImportConnectionsRdpFile()
Try
Dim openFileDialog As OpenFileDialog = Tools.Controls.ImportConnectionsRdpFileDialog
If Not openFileDialog.ShowDialog = DialogResult.OK Then Return
For Each fileName As String In openFileDialog.FileNames
Dim lines As String() = File.ReadAllLines(fileName)
Dim treeNode As TreeNode = Tree.Node.AddNode(Tree.Node.Type.Connection, Path.GetFileNameWithoutExtension(fileName))
Dim connectionInfo As New Connection.Info()
connectionInfo.Inherit = New Connection.Info.Inheritance(connectionInfo)
connectionInfo.Name = treeNode.Text
For Each line As String In lines
Dim parts() As String = line.Split(New Char() {":"}, 3)
If parts.Length < 3 Then Continue For
Dim key As String = parts(0)
Dim value As String = parts(2)
Select Case LCase(key)
Case "full address"
Dim uri As New Uri("dummyscheme" + uri.SchemeDelimiter + value)
If Not String.IsNullOrEmpty(uri.Host) Then connectionInfo.Hostname = uri.Host
If Not uri.Port = -1 Then connectionInfo.Port = uri.Port
Case "server port"
connectionInfo.Port = value
Case "username"
connectionInfo.Username = value
Case "domain"
connectionInfo.Domain = value
Case "session bpp"
Select Case value
Case 8
connectionInfo.Colors = Protocol.RDP.RDPColors.Colors256
Case 15
connectionInfo.Colors = Protocol.RDP.RDPColors.Colors15Bit
Case 16
connectionInfo.Colors = Protocol.RDP.RDPColors.Colors16Bit
Case 24
connectionInfo.Colors = Protocol.RDP.RDPColors.Colors24Bit
Case 32
connectionInfo.Colors = Protocol.RDP.RDPColors.Colors32Bit
End Select
Case "bitmapcachepersistenable"
If value = 1 Then
connectionInfo.CacheBitmaps = True
Else
connectionInfo.CacheBitmaps = False
End If
Case "screen mode id"
If value = 2 Then
connectionInfo.Resolution = Protocol.RDP.RDPResolutions.Fullscreen
Else
connectionInfo.Resolution = Protocol.RDP.RDPResolutions.FitToWindow
End If
Case "connect to console"
If value = 1 Then
connectionInfo.UseConsoleSession = True
End If
Case "disable wallpaper"
If value = 1 Then
connectionInfo.DisplayWallpaper = True
Else
connectionInfo.DisplayWallpaper = False
End If
Case "disable themes"
If value = 1 Then
connectionInfo.DisplayThemes = True
Else
connectionInfo.DisplayThemes = False
End If
Case "allow font smoothing"
If value = 1 Then
connectionInfo.EnableFontSmoothing = True
Else
connectionInfo.EnableFontSmoothing = False
End If
Case "allow desktop composition"
If value = 1 Then
connectionInfo.EnableDesktopComposition = True
Else
connectionInfo.EnableDesktopComposition = False
End If
Case "redirectsmartcards"
If value = 1 Then
connectionInfo.RedirectSmartCards = True
Else
connectionInfo.RedirectSmartCards = False
End If
Case "redirectdrives"
If value = 1 Then
connectionInfo.RedirectDiskDrives = True
Else
connectionInfo.RedirectDiskDrives = False
End If
Case "redirectcomports"
If value = 1 Then
connectionInfo.RedirectPorts = True
Else
connectionInfo.RedirectPorts = False
End If
Case "redirectprinters"
If value = 1 Then
connectionInfo.RedirectPrinters = True
Else
connectionInfo.RedirectPrinters = False
End If
Case "audiomode"
Select Case value
Case 0
connectionInfo.RedirectSound = Protocol.RDP.RDPSounds.BringToThisComputer
Case 1
connectionInfo.RedirectSound = Protocol.RDP.RDPSounds.LeaveAtRemoteComputer
Case 2
connectionInfo.RedirectSound = Protocol.RDP.RDPSounds.DoNotPlay
End Select
End Select
Next
treeNode.Tag = connectionInfo
Windows.treeForm.tvConnections.SelectedNode.Nodes.Add(treeNode)
If Tree.Node.GetNodeType(treeNode.Parent) = Tree.Node.Type.Container Then
connectionInfo.Parent = treeNode.Parent.Tag
End If
ConnectionList.Add(connectionInfo)
Next
Catch ex As Exception
MessageCollector.AddExceptionMessage(My.Language.strRdpFileCouldNotBeImported, ex)
End Try
End Sub
Public Shared Sub ImportConnectionsFromPortScan(ByVal Hosts As ArrayList, ByVal Protocol As mRemoteNG.Connection.Protocol.Protocols)
For Each Host As Tools.PortScan.ScanHost In Hosts
Dim finalProt As mRemoteNG.Connection.Protocol.Protocols
Dim protOK As Boolean = False
Dim nNode As TreeNode = Tree.Node.AddNode(Tree.Node.Type.Connection, Host.HostNameWithoutDomain)
Dim nConI As New mRemoteNG.Connection.Info()
nConI.Inherit = New Connection.Info.Inheritance(nConI)
nConI.Name = Host.HostNameWithoutDomain
nConI.Hostname = Host.HostName
Select Case Protocol
Case Connection.Protocol.Protocols.SSH2
If Host.SSH Then
finalProt = Connection.Protocol.Protocols.SSH2
protOK = True
End If
Case Connection.Protocol.Protocols.Telnet
If Host.Telnet Then
finalProt = Connection.Protocol.Protocols.Telnet
protOK = True
End If
Case Connection.Protocol.Protocols.HTTP
If Host.HTTP Then
finalProt = Connection.Protocol.Protocols.HTTP
protOK = True
End If
Case Connection.Protocol.Protocols.HTTPS
If Host.HTTPS Then
finalProt = Connection.Protocol.Protocols.HTTPS
protOK = True
End If
Case Connection.Protocol.Protocols.Rlogin
If Host.Rlogin Then
finalProt = Connection.Protocol.Protocols.Rlogin
protOK = True
End If
Case Connection.Protocol.Protocols.RDP
If Host.RDP Then
finalProt = Connection.Protocol.Protocols.RDP
protOK = True
End If
Case Connection.Protocol.Protocols.VNC
If Host.VNC Then
finalProt = Connection.Protocol.Protocols.VNC
protOK = True
End If
End Select
If protOK = False Then
nConI = Nothing
Else
nConI.Protocol = finalProt
nConI.SetDefaultPort()
nNode.Tag = nConI
Windows.treeForm.tvConnections.SelectedNode.Nodes.Add(nNode)
If Tree.Node.GetNodeType(nNode.Parent) = Tree.Node.Type.Container Then
nConI.Parent = nNode.Parent.Tag
End If
ConnectionList.Add(nConI)
End If
Next
End Sub
Public Shared Sub ImportConnectionsFromCSV()
End Sub
Public Shared Sub SaveConnectionsBG()
_saveUpdate = True
@@ -1525,9 +1268,9 @@ Namespace App
End Try
End Sub
Public Shared Sub SaveConnectionsAs(Optional ByVal rootNode As TreeNode = Nothing, Optional ByVal saveSecurity As Security.Save = Nothing)
Dim connectionsSave As New Connections.Save
Public Shared Sub SaveConnectionsAs()
Dim previousTimerState As Boolean = False
Dim connectionsSave As New Connections.Save
Try
If TimerSqlWatcher IsNot Nothing Then
@@ -1535,50 +1278,41 @@ Namespace App
TimerSqlWatcher.Enabled = False
End If
Dim export As Boolean = False
Dim saveAsDialog As SaveFileDialog
If rootNode Is Nothing Then
rootNode = Windows.treeForm.tvConnections.Nodes(0)
saveAsDialog = Tools.Controls.ConnectionsSaveAsDialog
Else
export = True
saveAsDialog = Tools.Controls.ConnectionsExportDialog
End If
Using saveFileDialog As New SaveFileDialog()
With saveFileDialog
.CheckPathExists = True
.InitialDirectory = Info.Connections.DefaultConnectionsPath
.FileName = Info.Connections.DefaultConnectionsFile
.OverwritePrompt = True
If Not saveAsDialog.ShowDialog() = DialogResult.OK Then Return
Dim fileTypes As New List(Of String)
fileTypes.AddRange({My.Language.strFiltermRemoteXML, "*.xml"})
fileTypes.AddRange({My.Language.strFilterAll, "*.*"})
connectionsSave.ConnectionFileName = saveAsDialog.FileName
.Filter = String.Join("|", fileTypes.ToArray())
End With
If export Then
Select Case saveAsDialog.FilterIndex
Case 1
connectionsSave.SaveFormat = Connections.Save.Format.mRXML
Case 2
connectionsSave.SaveFormat = Connections.Save.Format.mRCSV
Case 3
connectionsSave.SaveFormat = Connections.Save.Format.vRDCSV
End Select
Else
connectionsSave.SaveFormat = Connections.Save.Format.mRXML
If Not saveFileDialog.ShowDialog(frmMain) = DialogResult.OK Then Return
If connectionsSave.ConnectionFileName = GetDefaultStartupConnectionFileName() Then
With connectionsSave
.SaveFormat = Connections.Save.Format.mRXML
.ConnectionFileName = saveFileDialog.FileName
.Export = False
.SaveSecurity = New Security.Save()
.ConnectionList = ConnectionList
.ContainerList = ContainerList
.RootTreeNode = Windows.treeForm.tvConnections.Nodes(0)
End With
connectionsSave.Save()
If saveFileDialog.FileName = GetDefaultStartupConnectionFileName() Then
My.Settings.LoadConsFromCustomLocation = False
Else
My.Settings.LoadConsFromCustomLocation = True
My.Settings.CustomConsPath = connectionsSave.ConnectionFileName
My.Settings.CustomConsPath = saveFileDialog.FileName
End If
End If
connectionsSave.ConnectionList = ConnectionList
connectionsSave.ContainerList = ContainerList
connectionsSave.RootTreeNode = rootNode
connectionsSave.Export = export
If saveSecurity Is Nothing Then saveSecurity = New Security.Save
connectionsSave.SaveSecurity = saveSecurity
connectionsSave.Save()
End Using
Catch ex As Exception
MessageCollector.AddExceptionMessage(String.Format(My.Language.strConnectionsFileCouldNotSaveAs, connectionsSave.ConnectionFileName), ex)
Finally

79
mRemoteV1/App/Export.vb Normal file
View File

@@ -0,0 +1,79 @@
Imports mRemoteNG.Forms
Imports mRemoteNG.App.Runtime
Namespace App
Public Class Export
Public Shared Sub ExportToFile(ByVal rootTreeNode As TreeNode, ByVal selectedTreeNode As TreeNode)
Try
Dim exportTreeNode As TreeNode
Dim saveSecurity As New Security.Save()
Using exportForm As New ExportForm()
With exportForm
Select Case Tree.Node.GetNodeType(selectedTreeNode)
Case Tree.Node.Type.Container
.SelectedFolder = selectedTreeNode
Case Tree.Node.Type.Connection
If Tree.Node.GetNodeType(selectedTreeNode.Parent) = Tree.Node.Type.Container Then
.SelectedFolder = selectedTreeNode.Parent
End If
.SelectedConnection = selectedTreeNode
End Select
If Not exportForm.ShowDialog(frmMain) = DialogResult.OK Then Return
Select Case .Scope
Case exportForm.ExportScope.SelectedFolder
exportTreeNode = .SelectedFolder
Case exportForm.ExportScope.SelectedConnection
exportTreeNode = .SelectedConnection
Case Else
exportTreeNode = rootTreeNode
End Select
saveSecurity.Username = .IncludeUsername
saveSecurity.Password = .IncludePassword
saveSecurity.Domain = .IncludeDomain
saveSecurity.Inheritance = .IncludeInheritance
End With
SaveExportFile(exportForm.FileName, exportForm.SaveFormat, exportTreeNode, saveSecurity)
End Using
Catch ex As Exception
MessageCollector.AddExceptionMessage("App.Export.ExportToFile() failed.", ex, , True)
End Try
End Sub
Private Shared Sub SaveExportFile(ByVal fileName As String, ByVal saveFormat As Config.Connections.Save.Format, ByVal rootNode As TreeNode, ByVal saveSecurity As Security.Save)
Dim previousTimerEnabled As Boolean = False
Try
If TimerSqlWatcher IsNot Nothing Then
previousTimerEnabled = TimerSqlWatcher.Enabled
TimerSqlWatcher.Enabled = False
End If
Dim connectionsSave As New Config.Connections.Save
With connectionsSave
.Export = True
.ConnectionFileName = fileName
.SaveFormat = saveFormat
.ConnectionList = ConnectionList
.ContainerList = ContainerList
.RootTreeNode = rootNode
.SaveSecurity = saveSecurity
End With
connectionsSave.Save()
Catch ex As Exception
MessageCollector.AddExceptionMessage(String.Format("Export.SaveExportFile(""{0}"") failed.", fileName), ex)
Finally
If TimerSqlWatcher IsNot Nothing Then
TimerSqlWatcher.Enabled = previousTimerEnabled
End If
End Try
End Sub
End Class
End Namespace

171
mRemoteV1/App/Import.vb Normal file
View File

@@ -0,0 +1,171 @@
Imports System.Windows.Forms
Imports System.IO
Imports mRemoteNG.My
Imports mRemoteNG.App.Runtime
Imports PSTaskDialog
Namespace App
Public Class Import
#Region "Public Methods"
Public Shared Sub ImportFromFile(ByVal rootTreeNode As TreeNode, ByVal selectedTreeNode As TreeNode, Optional ByVal alwaysUseSelectedTreeNode As Boolean = False)
Try
Using openFileDialog As New OpenFileDialog()
With openFileDialog
.CheckFileExists = True
.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
.Multiselect = True
Dim fileTypes As New List(Of String)
fileTypes.AddRange({Language.strFilterAllImportable, "*.xml;*.rdp;*.rdg;*.dat"})
fileTypes.AddRange({Language.strFiltermRemoteXML, "*.xml"})
fileTypes.AddRange({Language.strFilterRDP, "*.rdp"})
fileTypes.AddRange({Language.strFilterRdgFiles, "*.rdg"})
fileTypes.AddRange({Language.strFilterPuttyConnectionManager, "*.dat"})
fileTypes.AddRange({Language.strFilterAll, "*.*"})
.Filter = String.Join("|", fileTypes.ToArray())
End With
If Not openFileDialog.ShowDialog = DialogResult.OK Then Return
Dim parentTreeNode As TreeNode = GetParentTreeNode(rootTreeNode, selectedTreeNode, alwaysUseSelectedTreeNode)
If parentTreeNode Is Nothing Then Return
For Each fileName As String In openFileDialog.FileNames
Try
Select Case DetermineFileType(fileName)
Case FileType.mRemoteXml
Config.Import.mRemoteNG.Import(fileName, parentTreeNode)
Case FileType.RemoteDesktopConnection
Config.Import.RemoteDesktopConnection.Import(fileName, parentTreeNode)
Case FileType.RemoteDesktopConnectionManager
Config.Import.RemoteDesktopConnectionManager.Import(fileName, parentTreeNode)
Case FileType.PuttyConnectionManager
Config.Import.PuttyConnectionManager.Import(fileName, parentTreeNode)
Case Else
Throw New FileFormatException("Unrecognized file format.")
End Select
Catch ex As Exception
cTaskDialog.ShowTaskDialogBox(Application.ProductName, Language.strImportFileFailedMainInstruction, String.Format(Language.strImportFileFailedContent, fileName), Tools.Misc.GetExceptionMessageRecursive(ex), "", "", "", "", eTaskDialogButtons.OK, eSysIcons.Error, Nothing)
End Try
Next
parentTreeNode.Expand()
Dim parentContainer As Container.Info = TryCast(parentTreeNode.Tag, Container.Info)
If parentContainer IsNot Nothing Then parentContainer.IsExpanded = True
SaveConnectionsBG()
End Using
Catch ex As Exception
MessageCollector.AddExceptionMessage("App.Import.ImportFromFile() failed.", ex, , True)
End Try
End Sub
Public Shared Sub ImportFromActiveDirectory(ByVal ldapPath As String)
Try
Dim rootTreeNode As TreeNode = Tree.Node.TreeView.Nodes(0)
Dim selectedTreeNode As TreeNode = Tree.Node.TreeView.SelectedNode
Dim parentTreeNode As TreeNode = GetParentTreeNode(rootTreeNode, selectedTreeNode)
If parentTreeNode Is Nothing Then Return
Config.Import.ActiveDirectory.Import(ldapPath, parentTreeNode)
parentTreeNode.Expand()
Dim parentContainer As Container.Info = TryCast(parentTreeNode.Tag, Container.Info)
If parentContainer IsNot Nothing Then parentContainer.IsExpanded = True
SaveConnectionsBG()
Catch ex As Exception
MessageCollector.AddExceptionMessage("App.Import.ImportFromActiveDirectory() failed.", ex, , True)
End Try
End Sub
Public Shared Sub ImportFromPortScan(ByVal hosts As IEnumerable, ByVal protocol As Connection.Protocol.Protocols)
Try
Dim rootTreeNode As TreeNode = Tree.Node.TreeView.Nodes(0)
Dim selectedTreeNode As TreeNode = Tree.Node.TreeView.SelectedNode
Dim parentTreeNode As TreeNode = GetParentTreeNode(rootTreeNode, selectedTreeNode)
If parentTreeNode Is Nothing Then Return
Config.Import.PortScan.Import(hosts, protocol, parentTreeNode)
parentTreeNode.Expand()
Dim parentContainer As Container.Info = TryCast(parentTreeNode.Tag, Container.Info)
If parentContainer IsNot Nothing Then parentContainer.IsExpanded = True
SaveConnectionsBG()
Catch ex As Exception
MessageCollector.AddExceptionMessage("App.Import.ImportFromPortScan() failed.", ex, , True)
End Try
End Sub
#End Region
#Region "Private Methods"
Private Shared Function GetParentTreeNode(ByVal rootTreeNode As TreeNode, ByVal selectedTreeNode As TreeNode, Optional ByVal alwaysUseSelectedTreeNode As Boolean = False) As TreeNode
Dim parentTreeNode As TreeNode
selectedTreeNode = GetContainerTreeNode(selectedTreeNode)
If selectedTreeNode Is Nothing OrElse selectedTreeNode Is rootTreeNode Then
parentTreeNode = rootTreeNode
Else
If alwaysUseSelectedTreeNode Then
parentTreeNode = GetContainerTreeNode(selectedTreeNode)
Else
cTaskDialog.ShowCommandBox(Application.ProductName, Language.strImportLocationMainInstruction, Language.strImportLocationContent, "", "", "", String.Format(Language.strImportLocationCommandButtons, vbLf, rootTreeNode.Text, selectedTreeNode.Text), True, eSysIcons.Question, 0)
Select Case cTaskDialog.CommandButtonResult
Case 0 ' Root
parentTreeNode = rootTreeNode
Case 1 ' Selected Folder
parentTreeNode = GetContainerTreeNode(selectedTreeNode)
Case Else ' Cancel
parentTreeNode = Nothing
End Select
End If
End If
Return parentTreeNode
End Function
Private Shared Function GetContainerTreeNode(ByVal treeNode As TreeNode) As TreeNode
Select Case Tree.Node.GetNodeType(treeNode)
Case Tree.Node.Type.Root, Tree.Node.Type.Container
Return treeNode
Case Tree.Node.Type.Connection
Return treeNode.Parent
Case Else
Return Nothing
End Select
End Function
Private Shared Function DetermineFileType(ByVal fileName As String) As FileType
' TODO: Use the file contents to determine the file type instead of trusting the extension
Dim fileExtension As String = Path.GetExtension(fileName).ToLowerInvariant()
Select Case fileExtension
Case ".xml"
Return FileType.mRemoteXml
Case ".rdp"
Return FileType.RemoteDesktopConnection
Case ".rdg"
Return FileType.RemoteDesktopConnectionManager
Case ".dat"
Return FileType.PuttyConnectionManager
Case Else
Return FileType.Unknown
End Select
End Function
#End Region
#Region "Private Enumerations"
Private Enum FileType As Integer
Unknown = 0
' ReSharper disable once InconsistentNaming
mRemoteXml
RemoteDesktopConnection
RemoteDesktopConnectionManager
PuttyConnectionManager
End Enum
#End Region
End Class
End Namespace

View File

@@ -604,7 +604,7 @@ Namespace Config
Private Sub LoadFromXML(ByVal cons As String, ByVal import As Boolean)
Try
App.Runtime.IsConnectionsFileLoaded = False
If Not import Then IsConnectionsFileLoaded = False
' SECTION 1. Create a DOM Document and load the XML data into it.
Me.xDom = New XmlDocument()
@@ -627,20 +627,25 @@ Namespace Config
End If
' SECTION 2. Initialize the treeview control.
Dim rootNodeName As String = ""
If xDom.DocumentElement.HasAttribute("Name") Then rootNodeName = xDom.DocumentElement.Attributes("Name").Value.Trim()
If Not String.IsNullOrEmpty(rootNodeName) Then
RootTreeNode.Name = rootNodeName
Dim rootInfo As Root.Info
If import Then
rootInfo = Nothing
Else
RootTreeNode.Name = xDom.DocumentElement.Name
Dim rootNodeName As String = ""
If xDom.DocumentElement.HasAttribute("Name") Then rootNodeName = xDom.DocumentElement.Attributes("Name").Value.Trim()
If Not String.IsNullOrEmpty(rootNodeName) Then
RootTreeNode.Name = rootNodeName
Else
RootTreeNode.Name = xDom.DocumentElement.Name
End If
RootTreeNode.Text = RootTreeNode.Name
rootInfo = New Root.Info(Root.Info.RootType.Connection)
rootInfo.Name = RootTreeNode.Name
rootInfo.TreeNode = RootTreeNode
RootTreeNode.Tag = rootInfo
End If
RootTreeNode.Text = RootTreeNode.Name
Dim rootInfo As New Root.Info(Root.Info.RootType.Connection)
rootInfo.Name = RootTreeNode.Name
rootInfo.TreeNode = RootTreeNode
RootTreeNode.Tag = rootInfo
If Me.confVersion > 1.3 Then '1.4
If Security.Crypt.Decrypt(xDom.DocumentElement.Attributes("Protected").Value, pW) <> "ThisIsNotProtected" Then
@@ -697,7 +702,7 @@ Namespace Config
RootTreeNode.EnsureVisible()
IsConnectionsFileLoaded = True
If Not import Then IsConnectionsFileLoaded = True
Windows.treeForm.InitialRefresh()
SetSelectedNode(RootTreeNode)
Catch ex As Exception
@@ -1032,7 +1037,7 @@ Namespace Config
Return conI
End Function
Private Function Authenticate(ByVal Value As String, ByVal CompareToOriginalValue As Boolean, Optional ByVal RootInfo As mRemoteNG.Root.Info = Nothing) As Boolean
Private Function Authenticate(ByVal Value As String, ByVal CompareToOriginalValue As Boolean, Optional ByVal rootInfo As Root.Info = Nothing) As Boolean
Dim passwordName As String
If UseSQL Then
passwordName = Language.strSQLServer.TrimEnd(":")
@@ -1057,8 +1062,10 @@ Namespace Config
End If
Loop
RootInfo.Password = True
RootInfo.PasswordString = pW
If rootInfo IsNot Nothing Then
rootInfo.Password = True
rootInfo.PasswordString = pW
End If
End If
Return True

View File

@@ -0,0 +1,97 @@
Imports System.DirectoryServices
Imports mRemoteNG.App.Runtime
Imports System.Text.RegularExpressions
Imports mRemoteNG.My
Namespace Config.Import
Public Class ActiveDirectory
Public Shared Sub Import(ByVal ldapPath As String, ByVal parentTreeNode As TreeNode)
Try
Dim treeNode As TreeNode = Tree.Node.AddNode(Tree.Node.Type.Container)
Dim containerInfo As New Container.Info()
containerInfo.TreeNode = treeNode
containerInfo.ConnectionInfo = New Connection.Info(containerInfo)
Dim name As String
Dim match As Match = Regex.Match(ldapPath, "ou=([^,]*)", RegexOptions.IgnoreCase)
If match.Success Then
name = match.Groups(1).Captures(0).Value
Else
name = Language.strActiveDirectory
End If
containerInfo.Name = name
' We can only inherit from a container node, not the root node or connection nodes
If Tree.Node.GetNodeType(parentTreeNode) = Tree.Node.Type.Container Then
containerInfo.Parent = parentTreeNode.Tag
Else
containerInfo.ConnectionInfo.Inherit.TurnOffInheritanceCompletely()
End If
treeNode.Text = name
treeNode.Name = name
treeNode.Tag = containerInfo
ContainerList.Add(containerInfo)
ImportComputers(ldapPath, treeNode)
parentTreeNode.Nodes.Add(treeNode)
Catch ex As Exception
MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.Import() failed.", ex, , True)
End Try
End Sub
Private Shared Sub ImportComputers(ByVal ldapPath As String, ByVal parentTreeNode As TreeNode)
Try
Dim strDisplayName, strDescription, strHostName As String
Const ldapFilter As String = "(objectClass=computer)"
Dim ldapSearcher As New DirectorySearcher
Dim ldapResults As SearchResultCollection
Dim ldapResult As SearchResult
With ldapSearcher
.SearchRoot = New DirectoryEntry(ldapPath)
.PropertiesToLoad.AddRange({"securityEquals", "cn"})
.Filter = ldapFilter
.SearchScope = SearchScope.OneLevel
End With
ldapResults = ldapSearcher.FindAll()
For Each ldapResult In ldapResults
With ldapResult.GetDirectoryEntry()
strDisplayName = .Properties("cn").Value
strDescription = .Properties("Description").Value
strHostName = .Properties("dNSHostName").Value
End With
Dim treeNode As TreeNode = Tree.Node.AddNode(Tree.Node.Type.Connection, strDisplayName)
Dim connectionInfo As New Connection.Info()
Dim inheritanceInfo As New Connection.Info.Inheritance(connectionInfo, True)
inheritanceInfo.Description = False
If TypeOf parentTreeNode.Tag Is Container.Info Then
connectionInfo.Parent = parentTreeNode.Tag
End If
connectionInfo.Inherit = inheritanceInfo
connectionInfo.Name = strDisplayName
connectionInfo.Hostname = strHostName
connectionInfo.Description = strDescription
connectionInfo.TreeNode = treeNode
treeNode.Name = strDisplayName
treeNode.Tag = connectionInfo 'set the nodes tag to the conI
'add connection to connections
ConnectionList.Add(connectionInfo)
parentTreeNode.Nodes.Add(treeNode)
Next
Catch ex As Exception
MessageCollector.AddExceptionMessage("Config.Import.ActiveDirectory.ImportComputers() failed.", ex, , True)
End Try
End Sub
End Class
End Namespace

View File

@@ -0,0 +1,72 @@
Imports mRemoteNG.App.Runtime
Namespace Config.Import
Public Class PortScan
Public Shared Sub Import(ByVal hosts As IEnumerable, ByVal protocol As Connection.Protocol.Protocols, ByVal parentTreeNode As TreeNode)
For Each host As Tools.PortScan.ScanHost In hosts
Dim finalProtocol As Connection.Protocol.Protocols
Dim protocolValid As Boolean = False
Dim treeNode As TreeNode = Tree.Node.AddNode(Tree.Node.Type.Connection, host.HostNameWithoutDomain)
Dim connectionInfo As New Connection.Info()
connectionInfo.Inherit = New Connection.Info.Inheritance(connectionInfo)
connectionInfo.Name = host.HostNameWithoutDomain
connectionInfo.Hostname = host.HostName
Select Case protocol
Case Connection.Protocol.Protocols.SSH2
If host.SSH Then
finalProtocol = Connection.Protocol.Protocols.SSH2
protocolValid = True
End If
Case Connection.Protocol.Protocols.Telnet
If host.Telnet Then
finalProtocol = Connection.Protocol.Protocols.Telnet
protocolValid = True
End If
Case Connection.Protocol.Protocols.HTTP
If host.HTTP Then
finalProtocol = Connection.Protocol.Protocols.HTTP
protocolValid = True
End If
Case Connection.Protocol.Protocols.HTTPS
If host.HTTPS Then
finalProtocol = Connection.Protocol.Protocols.HTTPS
protocolValid = True
End If
Case Connection.Protocol.Protocols.Rlogin
If host.Rlogin Then
finalProtocol = Connection.Protocol.Protocols.Rlogin
protocolValid = True
End If
Case Connection.Protocol.Protocols.RDP
If host.RDP Then
finalProtocol = Connection.Protocol.Protocols.RDP
protocolValid = True
End If
Case Connection.Protocol.Protocols.VNC
If host.VNC Then
finalProtocol = Connection.Protocol.Protocols.VNC
protocolValid = True
End If
End Select
If protocolValid Then
connectionInfo.Protocol = finalProtocol
connectionInfo.SetDefaultPort()
treeNode.Tag = connectionInfo
parentTreeNode.Nodes.Add(treeNode)
If TypeOf parentTreeNode.Tag Is Container.Info Then
connectionInfo.Parent = parentTreeNode.Tag
End If
ConnectionList.Add(connectionInfo)
End If
Next
End Sub
End Class
End Namespace

View File

@@ -0,0 +1,160 @@
Imports System.Xml
Imports System.IO
Imports mRemoteNG.App.Runtime
Imports mRemoteNG.Connection.Protocol
Namespace Config.Import
Public Class PuttyConnectionManager
Public Shared Sub Import(ByVal fileName As String, ByVal parentTreeNode As TreeNode)
Dim xmlDocument As New XmlDocument()
xmlDocument.Load(fileName)
Dim configurationNode As XmlNode = xmlDocument.SelectSingleNode("/configuration")
'Dim version As New Version(configurationNode.Attributes("version").Value)
'If Not version = New Version(0, 7, 1, 136) Then
' Throw New FileFormatException(String.Format("Unsupported file version ({0}).", version))
'End If
For Each rootNode As XmlNode In configurationNode.SelectNodes("./root")
ImportRootOrContainer(rootNode, parentTreeNode)
Next
End Sub
Private Shared Sub ImportRootOrContainer(ByVal xmlNode As XmlNode, ByVal parentTreeNode As TreeNode)
Dim xmlNodeType As String = xmlNode.Attributes("type").Value
Select Case xmlNode.Name
Case "root"
If Not String.Compare(xmlNodeType, "database", ignoreCase:=True) = 0 Then
Throw New FileFormatException(String.Format("Unrecognized root node type ({0}).", xmlNodeType))
End If
Case "container"
If Not String.Compare(xmlNodeType, "folder", ignoreCase:=True) = 0 Then
Throw New FileFormatException(String.Format("Unrecognized root node type ({0}).", xmlNodeType))
End If
Case Else
' ReSharper disable once LocalizableElement
Throw New ArgumentException("Argument must be either a root or a container node.", "xmlNode")
End Select
If parentTreeNode Is Nothing Then
Throw New InvalidOperationException("parentInfo.TreeNode must not be null.")
End If
Dim name As String = xmlNode.Attributes("name").Value
Dim treeNode As New TreeNode(name)
parentTreeNode.Nodes.Add(treeNode)
Dim containerInfo As New Container.Info
containerInfo.TreeNode = treeNode
containerInfo.Name = name
Dim connectionInfo As Connection.Info = CreateConnectionInfo(name)
connectionInfo.Parent = containerInfo
connectionInfo.IsContainer = True
containerInfo.ConnectionInfo = connectionInfo
' We can only inherit from a container node, not the root node or connection nodes
If Tree.Node.GetNodeType(parentTreeNode) = Tree.Node.Type.Container Then
containerInfo.Parent = parentTreeNode.Tag
Else
connectionInfo.Inherit.TurnOffInheritanceCompletely()
End If
treeNode.Name = name
treeNode.Tag = containerInfo
treeNode.ImageIndex = Images.Enums.TreeImage.Container
treeNode.SelectedImageIndex = Images.Enums.TreeImage.Container
For Each childNode As XmlNode In xmlNode.SelectNodes("./*")
Select Case childNode.Name
Case "container"
ImportRootOrContainer(childNode, treeNode)
Case "connection"
ImportConnection(childNode, treeNode)
Case Else
Throw New FileFormatException(String.Format("Unrecognized child node ({0}).", childNode.Name))
End Select
Next
containerInfo.IsExpanded = xmlNode.Attributes("expanded").InnerText
If containerInfo.IsExpanded Then treeNode.Expand()
ContainerList.Add(containerInfo)
End Sub
Private Shared Sub ImportConnection(ByVal connectionNode As XmlNode, ByVal parentTreeNode As TreeNode)
Dim connectionNodeType As String = connectionNode.Attributes("type").Value
If Not String.Compare(connectionNodeType, "PuTTY", ignoreCase:=True) = 0 Then
Throw New FileFormatException(String.Format("Unrecognized connection node type ({0}).", connectionNodeType))
End If
Dim name As String = connectionNode.Attributes("name").Value
Dim treeNode As New TreeNode(name)
parentTreeNode.Nodes.Add(treeNode)
Dim connectionInfo As Connection.Info = ConnectionInfoFromXml(connectionNode)
connectionInfo.TreeNode = treeNode
connectionInfo.Parent = parentTreeNode.Tag
treeNode.Name = name
treeNode.Tag = connectionInfo
treeNode.ImageIndex = Images.Enums.TreeImage.ConnectionClosed
treeNode.SelectedImageIndex = Images.Enums.TreeImage.ConnectionClosed
ConnectionList.Add(connectionInfo)
End Sub
Private Shared Function CreateConnectionInfo(ByVal name As String) As Connection.Info
Dim connectionInfo As New Connection.Info
connectionInfo.Inherit = New Connection.Info.Inheritance(connectionInfo)
connectionInfo.Name = name
Return connectionInfo
End Function
Private Shared Function ConnectionInfoFromXml(ByVal xmlNode As XmlNode) As Connection.Info
Dim connectionInfoNode As XmlNode = xmlNode.SelectSingleNode("./connection_info")
Dim name As String = connectionInfoNode.SelectSingleNode("./name").InnerText
Dim connectionInfo As Connection.Info = CreateConnectionInfo(name)
Dim protocol As String = connectionInfoNode.SelectSingleNode("./protocol").InnerText
Select Case protocol.ToLowerInvariant()
Case "telnet"
connectionInfo.Protocol = Protocols.Telnet
Case "ssh"
connectionInfo.Protocol = Protocols.SSH2
Case Else
Throw New FileFormatException(String.Format("Unrecognized protocol ({0}).", protocol))
End Select
connectionInfo.Hostname = connectionInfoNode.SelectSingleNode("./host").InnerText
connectionInfo.Port = connectionInfoNode.SelectSingleNode("./port").InnerText
connectionInfo.PuttySession = connectionInfoNode.SelectSingleNode("./session").InnerText
' ./commandline
connectionInfo.Description = connectionInfoNode.SelectSingleNode("./description").InnerText
Dim loginNode As XmlNode = xmlNode.SelectSingleNode("./login")
connectionInfo.Username = loginNode.SelectSingleNode("login").InnerText
connectionInfo.Password = loginNode.SelectSingleNode("password").InnerText
' ./prompt
' ./timeout/connectiontimeout
' ./timeout/logintimeout
' ./timeout/passwordtimeout
' ./timeout/commandtimeout
' ./command/command1
' ./command/command2
' ./command/command3
' ./command/command4
' ./command/command5
' ./options/loginmacro
' ./options/postcommands
' ./options/endlinechar
Return connectionInfo
End Function
End Class
End Namespace

View File

@@ -0,0 +1,141 @@
Imports System.IO
Imports mRemoteNG.App.Runtime
Namespace Config.Import
Public Class RemoteDesktopConnection
Public Shared Sub Import(ByVal fileName As String, ByVal parentTreeNode As TreeNode)
Dim lines As String() = File.ReadAllLines(fileName)
Dim name As String = Path.GetFileNameWithoutExtension(fileName)
Dim treeNode As TreeNode = New TreeNode(name)
parentTreeNode.Nodes.Add(treeNode)
Dim connectionInfo As New Connection.Info
connectionInfo.Inherit = New Connection.Info.Inheritance(connectionInfo)
connectionInfo.Name = name
connectionInfo.TreeNode = treeNode
If TypeOf treeNode.Parent.Tag Is Container.Info Then
connectionInfo.Parent = treeNode.Parent.Tag
End If
treeNode.Name = name
treeNode.Tag = connectionInfo
treeNode.ImageIndex = Images.Enums.TreeImage.ConnectionClosed
treeNode.SelectedImageIndex = Images.Enums.TreeImage.ConnectionClosed
For Each line As String In lines
Dim parts() As String = line.Split(New Char() {":"}, 3)
If parts.Length < 3 Then Continue For
Dim key As String = parts(0)
Dim value As String = parts(2)
SetConnectionInfoParameter(connectionInfo, key, value)
Next
ConnectionList.Add(connectionInfo)
End Sub
Private Shared Sub SetConnectionInfoParameter(ByRef connectionInfo As Connection.Info, ByVal key As String, ByVal value As String)
Select Case LCase(key)
Case "full address"
Dim uri As New Uri("dummyscheme" + uri.SchemeDelimiter + value)
If Not String.IsNullOrEmpty(uri.Host) Then connectionInfo.Hostname = uri.Host
If Not uri.Port = -1 Then connectionInfo.Port = uri.Port
Case "server port"
connectionInfo.Port = value
Case "username"
connectionInfo.Username = value
Case "domain"
connectionInfo.Domain = value
Case "session bpp"
Select Case value
Case 8
connectionInfo.Colors = Connection.Protocol.RDP.RDPColors.Colors256
Case 15
connectionInfo.Colors = Connection.Protocol.RDP.RDPColors.Colors15Bit
Case 16
connectionInfo.Colors = Connection.Protocol.RDP.RDPColors.Colors16Bit
Case 24
connectionInfo.Colors = Connection.Protocol.RDP.RDPColors.Colors24Bit
Case 32
connectionInfo.Colors = Connection.Protocol.RDP.RDPColors.Colors32Bit
End Select
Case "bitmapcachepersistenable"
If value = 1 Then
connectionInfo.CacheBitmaps = True
Else
connectionInfo.CacheBitmaps = False
End If
Case "screen mode id"
If value = 2 Then
connectionInfo.Resolution = Connection.Protocol.RDP.RDPResolutions.Fullscreen
Else
connectionInfo.Resolution = Connection.Protocol.RDP.RDPResolutions.FitToWindow
End If
Case "connect to console"
If value = 1 Then
connectionInfo.UseConsoleSession = True
End If
Case "disable wallpaper"
If value = 1 Then
connectionInfo.DisplayWallpaper = True
Else
connectionInfo.DisplayWallpaper = False
End If
Case "disable themes"
If value = 1 Then
connectionInfo.DisplayThemes = True
Else
connectionInfo.DisplayThemes = False
End If
Case "allow font smoothing"
If value = 1 Then
connectionInfo.EnableFontSmoothing = True
Else
connectionInfo.EnableFontSmoothing = False
End If
Case "allow desktop composition"
If value = 1 Then
connectionInfo.EnableDesktopComposition = True
Else
connectionInfo.EnableDesktopComposition = False
End If
Case "redirectsmartcards"
If value = 1 Then
connectionInfo.RedirectSmartCards = True
Else
connectionInfo.RedirectSmartCards = False
End If
Case "redirectdrives"
If value = 1 Then
connectionInfo.RedirectDiskDrives = True
Else
connectionInfo.RedirectDiskDrives = False
End If
Case "redirectcomports"
If value = 1 Then
connectionInfo.RedirectPorts = True
Else
connectionInfo.RedirectPorts = False
End If
Case "redirectprinters"
If value = 1 Then
connectionInfo.RedirectPrinters = True
Else
connectionInfo.RedirectPrinters = False
End If
Case "audiomode"
Select Case value
Case 0
connectionInfo.RedirectSound = Connection.Protocol.RDP.RDPSounds.BringToThisComputer
Case 1
connectionInfo.RedirectSound = Connection.Protocol.RDP.RDPSounds.LeaveAtRemoteComputer
Case 2
connectionInfo.RedirectSound = Connection.Protocol.RDP.RDPSounds.DoNotPlay
End Select
End Select
End Sub
End Class
End Namespace

View File

@@ -6,7 +6,7 @@ Imports mRemoteNG.App.Runtime
Namespace Config.Import
Public Class RemoteDesktopConnectionManager
Public Shared Sub Import(ByVal fileName As String, ByVal rootInfo As Root.Info)
Public Shared Sub Import(ByVal fileName As String, ByVal parentTreeNode As TreeNode)
Dim xmlDocument As New XmlDocument()
xmlDocument.Load(fileName)
@@ -18,53 +18,22 @@ Namespace Config.Import
Dim versionNode As XmlNode = rdcManNode.SelectSingleNode("./version")
Dim version As New Version(versionNode.InnerText)
If Not version = New Version(2.2) Then
If Not version = New Version(2, 2) Then
Throw New FileFormatException(String.Format("Unsupported file version ({0}).", version))
End If
Dim fileNode As XmlNode = rdcManNode.SelectSingleNode("./file")
ImportFileOrGroup(fileNode, rootInfo)
ImportFileOrGroup(fileNode, parentTreeNode)
End Sub
Private Shared Sub ImportFileOrGroup(ByVal xmlNode As XmlNode, ByVal parentInfo As Object)
Dim parentTreeNode As TreeNode
Dim childNodePath As String
Select Case xmlNode.Name
Case "file"
Dim rootInfo As Root.Info = TryCast(parentInfo, Root.Info)
If rootInfo Is Nothing Then
' ReSharper disable once LocalizableElement
Throw New ArgumentException("Argument must be a Root.Info object.", "parentInfo")
End If
parentTreeNode = rootInfo.TreeNode
childNodePath = "./group"
Case "group"
Dim parentContainerInfo As Container.Info = TryCast(parentInfo, Container.Info)
If parentContainerInfo Is Nothing Then
' ReSharper disable once LocalizableElement
Throw New ArgumentException("Argument must be a Container.Info object.", "parentInfo")
End If
parentTreeNode = parentContainerInfo.TreeNode
childNodePath = "./server"
Case Else
' ReSharper disable once LocalizableElement
Throw New ArgumentException("Argument must be either a file or a group node.", "xmlNode")
End Select
If parentTreeNode Is Nothing Then
Throw New InvalidOperationException("parentInfo.TreeNode must not be null.")
End If
Debug.Assert(Not String.IsNullOrEmpty(childNodePath))
Private Shared Sub ImportFileOrGroup(ByVal xmlNode As XmlNode, ByVal parentTreeNode As TreeNode)
Dim propertiesNode As XmlNode = xmlNode.SelectSingleNode("./properties")
Dim name As String = propertiesNode.SelectSingleNode("./name").InnerText
Dim treeNode As TreeNode = New TreeNode(name)
Dim treeNode As New TreeNode(name)
parentTreeNode.Nodes.Add(treeNode)
Dim containerInfo As New Container.Info
containerInfo.Parent = parentInfo
containerInfo.TreeNode = treeNode
containerInfo.Name = name
@@ -73,38 +42,48 @@ Namespace Config.Import
connectionInfo.IsContainer = True
containerInfo.ConnectionInfo = connectionInfo
' We can only inherit from a container node, not the root node or connection nodes
If Tree.Node.GetNodeType(parentTreeNode) = Tree.Node.Type.Container Then
containerInfo.Parent = parentTreeNode.Tag
Else
connectionInfo.Inherit.TurnOffInheritanceCompletely()
End If
treeNode.Name = name
treeNode.Tag = containerInfo
treeNode.ImageIndex = Images.Enums.TreeImage.Container
treeNode.SelectedImageIndex = Images.Enums.TreeImage.Container
For Each childNode As XmlNode In xmlNode.SelectNodes(childNodePath)
For Each childNode As XmlNode In xmlNode.SelectNodes("./group|./server")
Select Case childNode.Name
Case "group"
ImportFileOrGroup(childNode, containerInfo)
ImportFileOrGroup(childNode, treeNode)
Case "server"
ImportServer(childNode, containerInfo)
ImportServer(childNode, treeNode)
End Select
Next
containerInfo.IsExpanded = propertiesNode.SelectSingleNode("./expanded").InnerText
If containerInfo.IsExpanded Then treeNode.Expand()
ContainerList.Add(containerInfo)
End Sub
Private Shared Sub ImportServer(ByVal serverNode As XmlNode, ByVal parentContainerInfo As Container.Info)
Dim parentTreeNode As TreeNode = parentContainerInfo.TreeNode
Dim displayName As String = serverNode.SelectSingleNode("./displayName").InnerText
Dim treeNode As TreeNode = New TreeNode(displayName)
Private Shared Sub ImportServer(ByVal serverNode As XmlNode, ByVal parentTreeNode As TreeNode)
Dim name As String = serverNode.SelectSingleNode("./displayName").InnerText
Dim treeNode As New TreeNode(name)
parentTreeNode.Nodes.Add(treeNode)
Dim connectionInfo As Connection.Info = ConnectionInfoFromXml(serverNode)
connectionInfo.TreeNode = treeNode
connectionInfo.Parent = parentContainerInfo
connectionInfo.Name = displayName
connectionInfo.Parent = parentTreeNode.Tag
treeNode.Name = name
treeNode.Tag = connectionInfo
treeNode.ImageIndex = Images.Enums.TreeImage.ConnectionClosed
treeNode.SelectedImageIndex = Images.Enums.TreeImage.ConnectionClosed
ConnectionList.Add(connectionInfo)
End Sub
Private Shared Function ConnectionInfoFromXml(ByVal xmlNode As XmlNode) As Connection.Info

View File

@@ -0,0 +1,49 @@
Imports System.IO
Imports mRemoteNG.App.Runtime
Namespace Config.Import
' ReSharper disable once InconsistentNaming
Public Class mRemoteNG
Public Shared Sub Import(ByVal fileName As String, ByVal parentTreeNode As TreeNode)
Dim name As String = Path.GetFileNameWithoutExtension(fileName)
Dim treeNode As New TreeNode(name)
parentTreeNode.Nodes.Add(treeNode)
Dim containerInfo As New Container.Info
containerInfo.TreeNode = treeNode
containerInfo.Name = name
Dim connectionInfo As New Connection.Info
connectionInfo.Inherit = New Connection.Info.Inheritance(connectionInfo)
connectionInfo.Name = name
connectionInfo.TreeNode = treeNode
connectionInfo.Parent = containerInfo
connectionInfo.IsContainer = True
containerInfo.ConnectionInfo = connectionInfo
' We can only inherit from a container node, not the root node or connection nodes
If Tree.Node.GetNodeType(parentTreeNode) = Tree.Node.Type.Container Then
containerInfo.Parent = parentTreeNode.Tag
Else
connectionInfo.Inherit.TurnOffInheritanceCompletely()
End If
treeNode.Name = name
treeNode.Tag = containerInfo
treeNode.ImageIndex = Images.Enums.TreeImage.Container
treeNode.SelectedImageIndex = Images.Enums.TreeImage.Container
Dim connectionsLoad As New Connections.Load
With connectionsLoad
.ConnectionFileName = fileName
.RootTreeNode = treeNode
.ConnectionList = ConnectionList
.ContainerList = ContainerList
End With
connectionsLoad.Load(True)
ContainerList.Add(containerInfo)
End Sub
End Class
End Namespace

294
mRemoteV1/Forms/ExportForm.Designer.vb generated Normal file
View File

@@ -0,0 +1,294 @@
Namespace Forms
Partial Public Class ExportForm
Inherits Form
#Region " Windows Form Designer generated code "
Private Sub InitializeComponent()
Me.btnCancel = New System.Windows.Forms.Button()
Me.btnOK = New System.Windows.Forms.Button()
Me.lblUncheckProperties = New System.Windows.Forms.Label()
Me.chkUsername = New System.Windows.Forms.CheckBox()
Me.chkPassword = New System.Windows.Forms.CheckBox()
Me.chkDomain = New System.Windows.Forms.CheckBox()
Me.chkInheritance = New System.Windows.Forms.CheckBox()
Me.txtFileName = New System.Windows.Forms.TextBox()
Me.btnBrowse = New System.Windows.Forms.Button()
Me.grpProperties = New System.Windows.Forms.GroupBox()
Me.grpFile = New System.Windows.Forms.GroupBox()
Me.lblFileFormat = New System.Windows.Forms.Label()
Me.lblFileName = New System.Windows.Forms.Label()
Me.cboFileFormat = New System.Windows.Forms.ComboBox()
Me.grpItems = New System.Windows.Forms.GroupBox()
Me.lblSelectedConnection = New System.Windows.Forms.Label()
Me.lblSelectedFolder = New System.Windows.Forms.Label()
Me.rdoExportSelectedConnection = New System.Windows.Forms.RadioButton()
Me.rdoExportSelectedFolder = New System.Windows.Forms.RadioButton()
Me.rdoExportEverything = New System.Windows.Forms.RadioButton()
Me.grpProperties.SuspendLayout()
Me.grpFile.SuspendLayout()
Me.grpItems.SuspendLayout()
Me.SuspendLayout()
'
'btnCancel
'
Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnCancel.Location = New System.Drawing.Point(447, 473)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 3
Me.btnCancel.Text = "&Cancel"
Me.btnCancel.UseVisualStyleBackColor = True
'
'btnOK
'
Me.btnOK.Location = New System.Drawing.Point(366, 473)
Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(75, 23)
Me.btnOK.TabIndex = 2
Me.btnOK.Text = "&OK"
Me.btnOK.UseVisualStyleBackColor = True
'
'lblUncheckProperties
'
Me.lblUncheckProperties.AutoSize = True
Me.lblUncheckProperties.Location = New System.Drawing.Point(12, 134)
Me.lblUncheckProperties.Name = "lblUncheckProperties"
Me.lblUncheckProperties.Size = New System.Drawing.Size(244, 13)
Me.lblUncheckProperties.TabIndex = 4
Me.lblUncheckProperties.Text = "Uncheck the properties you want not to be saved!"
'
'chkUsername
'
Me.chkUsername.AutoSize = True
Me.chkUsername.Checked = True
Me.chkUsername.CheckState = System.Windows.Forms.CheckState.Checked
Me.chkUsername.Location = New System.Drawing.Point(15, 32)
Me.chkUsername.Name = "chkUsername"
Me.chkUsername.Size = New System.Drawing.Size(74, 17)
Me.chkUsername.TabIndex = 0
Me.chkUsername.Text = "Username"
Me.chkUsername.UseVisualStyleBackColor = True
'
'chkPassword
'
Me.chkPassword.AutoSize = True
Me.chkPassword.Checked = True
Me.chkPassword.CheckState = System.Windows.Forms.CheckState.Checked
Me.chkPassword.Location = New System.Drawing.Point(15, 55)
Me.chkPassword.Name = "chkPassword"
Me.chkPassword.Size = New System.Drawing.Size(72, 17)
Me.chkPassword.TabIndex = 1
Me.chkPassword.Text = "Password"
Me.chkPassword.UseVisualStyleBackColor = True
'
'chkDomain
'
Me.chkDomain.AutoSize = True
Me.chkDomain.Checked = True
Me.chkDomain.CheckState = System.Windows.Forms.CheckState.Checked
Me.chkDomain.Location = New System.Drawing.Point(15, 78)
Me.chkDomain.Name = "chkDomain"
Me.chkDomain.Size = New System.Drawing.Size(62, 17)
Me.chkDomain.TabIndex = 2
Me.chkDomain.Text = "Domain"
Me.chkDomain.UseVisualStyleBackColor = True
'
'chkInheritance
'
Me.chkInheritance.AutoSize = True
Me.chkInheritance.Checked = True
Me.chkInheritance.CheckState = System.Windows.Forms.CheckState.Checked
Me.chkInheritance.Location = New System.Drawing.Point(15, 101)
Me.chkInheritance.Name = "chkInheritance"
Me.chkInheritance.Size = New System.Drawing.Size(79, 17)
Me.chkInheritance.TabIndex = 3
Me.chkInheritance.Text = "Inheritance"
Me.chkInheritance.UseVisualStyleBackColor = True
'
'txtFileName
'
Me.txtFileName.Location = New System.Drawing.Point(15, 48)
Me.txtFileName.Name = "txtFileName"
Me.txtFileName.Size = New System.Drawing.Size(396, 20)
Me.txtFileName.TabIndex = 1
'
'btnBrowse
'
Me.btnBrowse.Location = New System.Drawing.Point(417, 46)
Me.btnBrowse.Name = "btnBrowse"
Me.btnBrowse.Size = New System.Drawing.Size(75, 23)
Me.btnBrowse.TabIndex = 2
Me.btnBrowse.Text = "&Browse"
Me.btnBrowse.UseVisualStyleBackColor = True
'
'grpProperties
'
Me.grpProperties.Controls.Add(Me.lblUncheckProperties)
Me.grpProperties.Controls.Add(Me.chkInheritance)
Me.grpProperties.Controls.Add(Me.chkUsername)
Me.grpProperties.Controls.Add(Me.chkDomain)
Me.grpProperties.Controls.Add(Me.chkPassword)
Me.grpProperties.Location = New System.Drawing.Point(12, 304)
Me.grpProperties.Name = "grpProperties"
Me.grpProperties.Size = New System.Drawing.Size(510, 163)
Me.grpProperties.TabIndex = 1
Me.grpProperties.TabStop = False
Me.grpProperties.Text = "Export Properties"
'
'grpFile
'
Me.grpFile.Controls.Add(Me.lblFileFormat)
Me.grpFile.Controls.Add(Me.lblFileName)
Me.grpFile.Controls.Add(Me.cboFileFormat)
Me.grpFile.Controls.Add(Me.txtFileName)
Me.grpFile.Controls.Add(Me.btnBrowse)
Me.grpFile.Location = New System.Drawing.Point(12, 12)
Me.grpFile.Name = "grpFile"
Me.grpFile.Size = New System.Drawing.Size(510, 140)
Me.grpFile.TabIndex = 0
Me.grpFile.TabStop = False
Me.grpFile.Text = "Export File"
'
'lblFileFormat
'
Me.lblFileFormat.AutoSize = True
Me.lblFileFormat.Location = New System.Drawing.Point(12, 84)
Me.lblFileFormat.Name = "lblFileFormat"
Me.lblFileFormat.Size = New System.Drawing.Size(61, 13)
Me.lblFileFormat.TabIndex = 3
Me.lblFileFormat.Text = "File &Format:"
'
'lblFileName
'
Me.lblFileName.AutoSize = True
Me.lblFileName.Location = New System.Drawing.Point(12, 32)
Me.lblFileName.Name = "lblFileName"
Me.lblFileName.Size = New System.Drawing.Size(52, 13)
Me.lblFileName.TabIndex = 0
Me.lblFileName.Text = "Filename:"
'
'cboFileFormat
'
Me.cboFileFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboFileFormat.FormattingEnabled = True
Me.cboFileFormat.Location = New System.Drawing.Point(15, 100)
Me.cboFileFormat.Name = "cboFileFormat"
Me.cboFileFormat.Size = New System.Drawing.Size(294, 21)
Me.cboFileFormat.TabIndex = 4
'
'grpItems
'
Me.grpItems.Controls.Add(Me.lblSelectedConnection)
Me.grpItems.Controls.Add(Me.lblSelectedFolder)
Me.grpItems.Controls.Add(Me.rdoExportSelectedConnection)
Me.grpItems.Controls.Add(Me.rdoExportSelectedFolder)
Me.grpItems.Controls.Add(Me.rdoExportEverything)
Me.grpItems.Location = New System.Drawing.Point(12, 158)
Me.grpItems.Name = "grpItems"
Me.grpItems.Size = New System.Drawing.Size(510, 140)
Me.grpItems.TabIndex = 4
Me.grpItems.TabStop = False
Me.grpItems.Text = "Export Items"
'
'lblSelectedConnection
'
Me.lblSelectedConnection.AutoSize = True
Me.lblSelectedConnection.Location = New System.Drawing.Point(48, 111)
Me.lblSelectedConnection.Name = "lblSelectedConnection"
Me.lblSelectedConnection.Size = New System.Drawing.Size(92, 13)
Me.lblSelectedConnection.TabIndex = 4
Me.lblSelectedConnection.Text = "Connection Name"
'
'lblSelectedFolder
'
Me.lblSelectedFolder.AutoSize = True
Me.lblSelectedFolder.Location = New System.Drawing.Point(48, 75)
Me.lblSelectedFolder.Name = "lblSelectedFolder"
Me.lblSelectedFolder.Size = New System.Drawing.Size(67, 13)
Me.lblSelectedFolder.TabIndex = 3
Me.lblSelectedFolder.Text = "Folder Name"
'
'rdoExportSelectedConnection
'
Me.rdoExportSelectedConnection.AutoSize = True
Me.rdoExportSelectedConnection.Location = New System.Drawing.Point(15, 91)
Me.rdoExportSelectedConnection.Name = "rdoExportSelectedConnection"
Me.rdoExportSelectedConnection.Size = New System.Drawing.Size(215, 17)
Me.rdoExportSelectedConnection.TabIndex = 2
Me.rdoExportSelectedConnection.TabStop = True
Me.rdoExportSelectedConnection.Text = "Export the currently selected connection"
Me.rdoExportSelectedConnection.UseVisualStyleBackColor = True
'
'rdoExportSelectedFolder
'
Me.rdoExportSelectedFolder.AutoSize = True
Me.rdoExportSelectedFolder.Location = New System.Drawing.Point(15, 55)
Me.rdoExportSelectedFolder.Name = "rdoExportSelectedFolder"
Me.rdoExportSelectedFolder.Size = New System.Drawing.Size(188, 17)
Me.rdoExportSelectedFolder.TabIndex = 1
Me.rdoExportSelectedFolder.TabStop = True
Me.rdoExportSelectedFolder.Text = "Export the currently selected folder"
Me.rdoExportSelectedFolder.UseVisualStyleBackColor = True
'
'rdoExportEverything
'
Me.rdoExportEverything.AutoSize = True
Me.rdoExportEverything.Checked = True
Me.rdoExportEverything.Location = New System.Drawing.Point(15, 32)
Me.rdoExportEverything.Name = "rdoExportEverything"
Me.rdoExportEverything.Size = New System.Drawing.Size(107, 17)
Me.rdoExportEverything.TabIndex = 0
Me.rdoExportEverything.TabStop = True
Me.rdoExportEverything.Text = "Export everything"
Me.rdoExportEverything.UseVisualStyleBackColor = True
'
'ExportForm
'
Me.AcceptButton = Me.btnOK
Me.CancelButton = Me.btnCancel
Me.ClientSize = New System.Drawing.Size(534, 508)
Me.Controls.Add(Me.grpItems)
Me.Controls.Add(Me.grpFile)
Me.Controls.Add(Me.grpProperties)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnOK)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.Icon = Global.mRemoteNG.My.Resources.Resources.Connections_SaveAs_Icon
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "ExportForm"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Export Connections"
Me.grpProperties.ResumeLayout(False)
Me.grpProperties.PerformLayout()
Me.grpFile.ResumeLayout(False)
Me.grpFile.PerformLayout()
Me.grpItems.ResumeLayout(False)
Me.grpItems.PerformLayout()
Me.ResumeLayout(False)
End Sub
Private WithEvents btnCancel As System.Windows.Forms.Button
Private WithEvents btnOK As System.Windows.Forms.Button
Private WithEvents lblUncheckProperties As System.Windows.Forms.Label
Private WithEvents chkUsername As System.Windows.Forms.CheckBox
Private WithEvents chkPassword As System.Windows.Forms.CheckBox
Private WithEvents chkDomain As System.Windows.Forms.CheckBox
Private WithEvents chkInheritance As System.Windows.Forms.CheckBox
Private WithEvents txtFileName As System.Windows.Forms.TextBox
Private WithEvents btnBrowse As System.Windows.Forms.Button
Private WithEvents grpProperties As System.Windows.Forms.GroupBox
Private WithEvents grpFile As System.Windows.Forms.GroupBox
Private WithEvents lblFileFormat As System.Windows.Forms.Label
Private WithEvents lblFileName As System.Windows.Forms.Label
Private WithEvents cboFileFormat As System.Windows.Forms.ComboBox
Private WithEvents grpItems As System.Windows.Forms.GroupBox
Private WithEvents lblSelectedConnection As System.Windows.Forms.Label
Private WithEvents lblSelectedFolder As System.Windows.Forms.Label
Private WithEvents rdoExportSelectedConnection As System.Windows.Forms.RadioButton
Private WithEvents rdoExportSelectedFolder As System.Windows.Forms.RadioButton
Private WithEvents rdoExportEverything As System.Windows.Forms.RadioButton
#End Region
End Class
End Namespace

View File

@@ -0,0 +1,260 @@
Imports System.ComponentModel
Imports mRemoteNG.Config.Connections
Imports mRemoteNG.App
Imports mRemoteNG.My
Namespace Forms
Public Class ExportForm
Inherits Form
#Region "Public Properties"
Public Property FileName As String
Get
Return txtFileName.Text
End Get
Set(value As String)
txtFileName.Text = value
End Set
End Property
Public Property SaveFormat As Config.Connections.Save.Format
Get
Dim exportFormat As ExportFormat = TryCast(cboFileFormat.SelectedItem, ExportFormat)
If exportFormat Is Nothing Then
Return Config.Connections.Save.Format.mRXML
Else
Return exportFormat.Format
End If
End Get
Set(value As Config.Connections.Save.Format)
For Each item As Object In cboFileFormat.Items
Dim exportFormat As ExportFormat = TryCast(item, ExportFormat)
If exportFormat Is Nothing Then Continue For
If exportFormat.Format = value Then
cboFileFormat.SelectedItem = item
Exit For
End If
Next
End Set
End Property
Public Property Scope As ExportScope
Get
If rdoExportSelectedFolder.Checked Then
Return ExportScope.SelectedFolder
ElseIf rdoExportSelectedConnection.Checked Then
Return ExportScope.SelectedConnection
Else
Return ExportScope.Everything
End If
End Get
Set(value As ExportScope)
Select Case value
Case ExportScope.Everything
rdoExportEverything.Checked = True
Case ExportScope.SelectedFolder
rdoExportSelectedFolder.Checked = True
Case ExportScope.SelectedConnection
rdoExportSelectedConnection.Checked = True
End Select
End Set
End Property
Private _selectedFolder As TreeNode
Public Property SelectedFolder As TreeNode
Get
Return _selectedFolder
End Get
Set(value As TreeNode)
_selectedFolder = value
If value Is Nothing Then
lblSelectedFolder.Text = String.Empty
Else
lblSelectedFolder.Text = value.Text
End If
rdoExportSelectedFolder.Enabled = (value IsNot Nothing)
End Set
End Property
Private _selectedConnection As TreeNode
Public Property SelectedConnection As TreeNode
Get
Return _selectedConnection
End Get
Set(value As TreeNode)
_selectedConnection = value
If value Is Nothing Then
lblSelectedConnection.Text = String.Empty
Else
lblSelectedConnection.Text = value.Text
End If
rdoExportSelectedConnection.Enabled = (value IsNot Nothing)
End Set
End Property
Public Property IncludeUsername As Boolean
Get
Return chkUsername.Checked
End Get
Set(value As Boolean)
chkUsername.Checked = value
End Set
End Property
Public Property IncludePassword As Boolean
Get
Return chkPassword.Checked
End Get
Set(value As Boolean)
chkPassword.Checked = value
End Set
End Property
Public Property IncludeDomain As Boolean
Get
Return chkDomain.Checked
End Get
Set(value As Boolean)
chkDomain.Checked = value
End Set
End Property
Public Property IncludeInheritance As Boolean
Get
Return chkInheritance.Checked
End Get
Set(value As Boolean)
chkInheritance.Checked = value
End Set
End Property
#End Region
#Region "Constructors"
Public Sub New()
InitializeComponent()
Runtime.FontOverride(Me)
SelectedFolder = Nothing
SelectedConnection = Nothing
btnOK.Enabled = False
End Sub
#End Region
#Region "Private Methods"
#Region "Event Handlers"
Private Sub ExportForm_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
cboFileFormat.Items.Clear()
cboFileFormat.Items.Add(New ExportFormat(Save.Format.mRXML))
cboFileFormat.Items.Add(New ExportFormat(Save.Format.mRCSV))
cboFileFormat.Items.Add(New ExportFormat(Save.Format.vRDCSV))
cboFileFormat.SelectedIndex = 0
ApplyLanguage()
End Sub
Private Sub txtFileName_TextChanged(sender As System.Object, e As EventArgs) Handles txtFileName.TextChanged
btnOK.Enabled = Not String.IsNullOrEmpty(txtFileName.Text)
End Sub
Private Sub btnBrowse_Click(sender As System.Object, e As EventArgs) Handles btnBrowse.Click
Using saveFileDialog As New SaveFileDialog()
With saveFileDialog
.CheckPathExists = True
.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
.OverwritePrompt = True
Dim fileTypes As New List(Of String)
fileTypes.AddRange({Language.strFiltermRemoteXML, "*.xml"})
fileTypes.AddRange({Language.strFiltermRemoteCSV, "*.csv"})
fileTypes.AddRange({Language.strFiltervRD2008CSV, "*.csv"})
fileTypes.AddRange({Language.strFilterAll, "*.*"})
.Filter = String.Join("|", fileTypes.ToArray())
End With
If Not saveFileDialog.ShowDialog(Me) = DialogResult.OK Then Return
txtFileName.Text = saveFileDialog.FileName
End Using
End Sub
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnOK.Click
DialogResult = DialogResult.OK
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnCancel.Click
DialogResult = DialogResult.Cancel
End Sub
#End Region
Private Sub ApplyLanguage()
Text = Language.strExport
grpFile.Text = Language.strExportFile
lblFileName.Text = Language.strLabelFilename
btnBrowse.Text = Language.strButtonBrowse
lblFileFormat.Text = Language.strFileFormatLabel
grpItems.Text = Language.strExportItems
rdoExportEverything.Text = Language.strExportEverything
rdoExportSelectedFolder.Text = Language.strExportSelectedFolder
rdoExportSelectedConnection.Text = Language.strExportSelectedConnection
grpProperties.Text = Language.strExportProperties
chkUsername.Text = Language.strCheckboxUsername
chkPassword.Text = Language.strCheckboxPassword
chkDomain.Text = Language.strCheckboxDomain
chkInheritance.Text = Language.strCheckboxInheritance
lblUncheckProperties.Text = Language.strUncheckProperties
btnOK.Text = Language.strButtonOK
btnCancel.Text = Language.strButtonCancel
End Sub
#End Region
#Region "Public Enumerations"
Public Enum ExportScope As Integer
Everything
SelectedFolder
SelectedConnection
End Enum
#End Region
#Region "Private Classes"
<ImmutableObject(True)> _
Private Class ExportFormat
#Region "Public Properties"
Private ReadOnly _format As Config.Connections.Save.Format
Public ReadOnly Property Format As Config.Connections.Save.Format
Get
Return _format
End Get
End Property
#End Region
#Region "Constructors"
Public Sub New(ByVal format As Config.Connections.Save.Format)
_format = format
End Sub
#End Region
#Region "Public Methods"
Public Overrides Function ToString() As String
Select Case Format
Case Config.Connections.Save.Format.mRXML
Return Language.strMremoteNgXml
Case Config.Connections.Save.Format.mRCSV
Return Language.strMremoteNgCsv
Case Config.Connections.Save.Format.vRDCSV
Return Language.strVisionAppRemoteDesktopCsv
Case Else
Return Format.ToString()
End Select
End Function
#End Region
End Class
#End Region
End Class
End Namespace

View File

@@ -23,21 +23,21 @@ Partial Class frmMain
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim DockPanelSkin1 As WeifenLuo.WinFormsUI.Docking.DockPanelSkin = New WeifenLuo.WinFormsUI.Docking.DockPanelSkin()
Dim AutoHideStripSkin1 As WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin = New WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin()
Dim DockPanelGradient1 As WeifenLuo.WinFormsUI.Docking.DockPanelGradient = New WeifenLuo.WinFormsUI.Docking.DockPanelGradient()
Dim TabGradient1 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim DockPaneStripSkin1 As WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin = New WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin()
Dim DockPaneStripGradient1 As WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient = New WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient()
Dim TabGradient2 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim DockPanelGradient2 As WeifenLuo.WinFormsUI.Docking.DockPanelGradient = New WeifenLuo.WinFormsUI.Docking.DockPanelGradient()
Dim TabGradient3 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim DockPaneStripToolWindowGradient1 As WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient = New WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient()
Dim TabGradient4 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim TabGradient5 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim DockPanelGradient3 As WeifenLuo.WinFormsUI.Docking.DockPanelGradient = New WeifenLuo.WinFormsUI.Docking.DockPanelGradient()
Dim TabGradient6 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim TabGradient7 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim DockPanelSkin2 As WeifenLuo.WinFormsUI.Docking.DockPanelSkin = New WeifenLuo.WinFormsUI.Docking.DockPanelSkin()
Dim AutoHideStripSkin2 As WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin = New WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin()
Dim DockPanelGradient4 As WeifenLuo.WinFormsUI.Docking.DockPanelGradient = New WeifenLuo.WinFormsUI.Docking.DockPanelGradient()
Dim TabGradient8 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim DockPaneStripSkin2 As WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin = New WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin()
Dim DockPaneStripGradient2 As WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient = New WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient()
Dim TabGradient9 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim DockPanelGradient5 As WeifenLuo.WinFormsUI.Docking.DockPanelGradient = New WeifenLuo.WinFormsUI.Docking.DockPanelGradient()
Dim TabGradient10 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim DockPaneStripToolWindowGradient2 As WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient = New WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient()
Dim TabGradient11 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim TabGradient12 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim DockPanelGradient6 As WeifenLuo.WinFormsUI.Docking.DockPanelGradient = New WeifenLuo.WinFormsUI.Docking.DockPanelGradient()
Dim TabGradient13 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim TabGradient14 As WeifenLuo.WinFormsUI.Docking.TabGradient = New WeifenLuo.WinFormsUI.Docking.TabGradient()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain))
Me.pnlDock = New WeifenLuo.WinFormsUI.Docking.DockPanel()
Me.msMain = New System.Windows.Forms.MenuStrip()
@@ -50,13 +50,11 @@ Partial Class frmMain
Me.mMenFileSave = New System.Windows.Forms.ToolStripMenuItem()
Me.mMenFileSaveAs = New System.Windows.Forms.ToolStripMenuItem()
Me.mMenFileSep2 = New System.Windows.Forms.ToolStripSeparator()
Me.mMenFileImportExport = New System.Windows.Forms.ToolStripMenuItem()
Me.ImportFromXMLFileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ImportFromRDPFileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ImportFromActiveDirectoryToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ImportFromPortScanToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripSeparator6 = New System.Windows.Forms.ToolStripSeparator()
Me.ExportToXMLFileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.mMenFileImport = New System.Windows.Forms.ToolStripMenuItem()
Me.mMenFileImportFromFile = New System.Windows.Forms.ToolStripMenuItem()
Me.mMenFileImportFromActiveDirectory = New System.Windows.Forms.ToolStripMenuItem()
Me.mMenFileImportFromPortScan = New System.Windows.Forms.ToolStripMenuItem()
Me.mMenFileExport = New System.Windows.Forms.ToolStripMenuItem()
Me.mMenFileSep3 = New System.Windows.Forms.ToolStripSeparator()
Me.mMenFileDelete = New System.Windows.Forms.ToolStripMenuItem()
Me.mMenFileRename = New System.Windows.Forms.ToolStripMenuItem()
@@ -143,52 +141,52 @@ Partial Class frmMain
Me.pnlDock.Location = New System.Drawing.Point(0, 0)
Me.pnlDock.Name = "pnlDock"
Me.pnlDock.Size = New System.Drawing.Size(842, 449)
DockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight
DockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight
AutoHideStripSkin1.DockStripGradient = DockPanelGradient1
TabGradient1.EndColor = System.Drawing.SystemColors.Control
TabGradient1.StartColor = System.Drawing.SystemColors.Control
TabGradient1.TextColor = System.Drawing.SystemColors.ControlDarkDark
AutoHideStripSkin1.TabGradient = TabGradient1
AutoHideStripSkin1.TextFont = New System.Drawing.Font("Segoe UI", 9.0!)
DockPanelSkin1.AutoHideStripSkin = AutoHideStripSkin1
TabGradient2.EndColor = System.Drawing.SystemColors.ControlLightLight
TabGradient2.StartColor = System.Drawing.SystemColors.ControlLightLight
TabGradient2.TextColor = System.Drawing.SystemColors.ControlText
DockPaneStripGradient1.ActiveTabGradient = TabGradient2
DockPanelGradient2.EndColor = System.Drawing.SystemColors.Control
DockPanelGradient2.StartColor = System.Drawing.SystemColors.Control
DockPaneStripGradient1.DockStripGradient = DockPanelGradient2
TabGradient3.EndColor = System.Drawing.SystemColors.ControlLight
TabGradient3.StartColor = System.Drawing.SystemColors.ControlLight
TabGradient3.TextColor = System.Drawing.SystemColors.ControlText
DockPaneStripGradient1.InactiveTabGradient = TabGradient3
DockPaneStripSkin1.DocumentGradient = DockPaneStripGradient1
DockPaneStripSkin1.TextFont = New System.Drawing.Font("Segoe UI", 9.0!)
TabGradient4.EndColor = System.Drawing.SystemColors.ActiveCaption
TabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical
TabGradient4.StartColor = System.Drawing.SystemColors.GradientActiveCaption
TabGradient4.TextColor = System.Drawing.SystemColors.ActiveCaptionText
DockPaneStripToolWindowGradient1.ActiveCaptionGradient = TabGradient4
TabGradient5.EndColor = System.Drawing.SystemColors.Control
TabGradient5.StartColor = System.Drawing.SystemColors.Control
TabGradient5.TextColor = System.Drawing.SystemColors.ControlText
DockPaneStripToolWindowGradient1.ActiveTabGradient = TabGradient5
DockPanelGradient3.EndColor = System.Drawing.SystemColors.ControlLight
DockPanelGradient3.StartColor = System.Drawing.SystemColors.ControlLight
DockPaneStripToolWindowGradient1.DockStripGradient = DockPanelGradient3
TabGradient6.EndColor = System.Drawing.SystemColors.GradientInactiveCaption
TabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical
TabGradient6.StartColor = System.Drawing.SystemColors.GradientInactiveCaption
TabGradient6.TextColor = System.Drawing.SystemColors.ControlText
DockPaneStripToolWindowGradient1.InactiveCaptionGradient = TabGradient6
TabGradient7.EndColor = System.Drawing.Color.Transparent
TabGradient7.StartColor = System.Drawing.Color.Transparent
TabGradient7.TextColor = System.Drawing.SystemColors.ControlDarkDark
DockPaneStripToolWindowGradient1.InactiveTabGradient = TabGradient7
DockPaneStripSkin1.ToolWindowGradient = DockPaneStripToolWindowGradient1
DockPanelSkin1.DockPaneStripSkin = DockPaneStripSkin1
Me.pnlDock.Skin = DockPanelSkin1
DockPanelGradient4.EndColor = System.Drawing.SystemColors.ControlLight
DockPanelGradient4.StartColor = System.Drawing.SystemColors.ControlLight
AutoHideStripSkin2.DockStripGradient = DockPanelGradient4
TabGradient8.EndColor = System.Drawing.SystemColors.Control
TabGradient8.StartColor = System.Drawing.SystemColors.Control
TabGradient8.TextColor = System.Drawing.SystemColors.ControlDarkDark
AutoHideStripSkin2.TabGradient = TabGradient8
AutoHideStripSkin2.TextFont = New System.Drawing.Font("Segoe UI", 9.0!)
DockPanelSkin2.AutoHideStripSkin = AutoHideStripSkin2
TabGradient9.EndColor = System.Drawing.SystemColors.ControlLightLight
TabGradient9.StartColor = System.Drawing.SystemColors.ControlLightLight
TabGradient9.TextColor = System.Drawing.SystemColors.ControlText
DockPaneStripGradient2.ActiveTabGradient = TabGradient9
DockPanelGradient5.EndColor = System.Drawing.SystemColors.Control
DockPanelGradient5.StartColor = System.Drawing.SystemColors.Control
DockPaneStripGradient2.DockStripGradient = DockPanelGradient5
TabGradient10.EndColor = System.Drawing.SystemColors.ControlLight
TabGradient10.StartColor = System.Drawing.SystemColors.ControlLight
TabGradient10.TextColor = System.Drawing.SystemColors.ControlText
DockPaneStripGradient2.InactiveTabGradient = TabGradient10
DockPaneStripSkin2.DocumentGradient = DockPaneStripGradient2
DockPaneStripSkin2.TextFont = New System.Drawing.Font("Segoe UI", 9.0!)
TabGradient11.EndColor = System.Drawing.SystemColors.ActiveCaption
TabGradient11.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical
TabGradient11.StartColor = System.Drawing.SystemColors.GradientActiveCaption
TabGradient11.TextColor = System.Drawing.SystemColors.ActiveCaptionText
DockPaneStripToolWindowGradient2.ActiveCaptionGradient = TabGradient11
TabGradient12.EndColor = System.Drawing.SystemColors.Control
TabGradient12.StartColor = System.Drawing.SystemColors.Control
TabGradient12.TextColor = System.Drawing.SystemColors.ControlText
DockPaneStripToolWindowGradient2.ActiveTabGradient = TabGradient12
DockPanelGradient6.EndColor = System.Drawing.SystemColors.ControlLight
DockPanelGradient6.StartColor = System.Drawing.SystemColors.ControlLight
DockPaneStripToolWindowGradient2.DockStripGradient = DockPanelGradient6
TabGradient13.EndColor = System.Drawing.SystemColors.GradientInactiveCaption
TabGradient13.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical
TabGradient13.StartColor = System.Drawing.SystemColors.GradientInactiveCaption
TabGradient13.TextColor = System.Drawing.SystemColors.ControlText
DockPaneStripToolWindowGradient2.InactiveCaptionGradient = TabGradient13
TabGradient14.EndColor = System.Drawing.Color.Transparent
TabGradient14.StartColor = System.Drawing.Color.Transparent
TabGradient14.TextColor = System.Drawing.SystemColors.ControlDarkDark
DockPaneStripToolWindowGradient2.InactiveTabGradient = TabGradient14
DockPaneStripSkin2.ToolWindowGradient = DockPaneStripToolWindowGradient2
DockPanelSkin2.DockPaneStripSkin = DockPaneStripSkin2
Me.pnlDock.Skin = DockPanelSkin2
Me.pnlDock.TabIndex = 13
'
'msMain
@@ -207,7 +205,7 @@ Partial Class frmMain
'
'mMenFile
'
Me.mMenFile.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mMenFileNewConnection, Me.mMenFileNewFolder, Me.mMenFileSep1, Me.mMenFileNew, Me.mMenFileLoad, Me.mMenFileSave, Me.mMenFileSaveAs, Me.mMenFileSep2, Me.mMenFileImportExport, Me.mMenFileSep3, Me.mMenFileDelete, Me.mMenFileRename, Me.mMenFileDuplicate, Me.mMenFileSep4, Me.mMenFileExit})
Me.mMenFile.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mMenFileNewConnection, Me.mMenFileNewFolder, Me.mMenFileSep1, Me.mMenFileNew, Me.mMenFileLoad, Me.mMenFileSave, Me.mMenFileSaveAs, Me.mMenFileSep2, Me.mMenFileDelete, Me.mMenFileRename, Me.mMenFileDuplicate, Me.mMenFileSep3, Me.mMenFileImport, Me.mMenFileExport, Me.mMenFileSep4, Me.mMenFileExit})
Me.mMenFile.Name = "mMenFile"
Me.mMenFile.Size = New System.Drawing.Size(37, 20)
Me.mMenFile.Text = "&File"
@@ -271,54 +269,41 @@ Partial Class frmMain
Me.mMenFileSep2.Name = "mMenFileSep2"
Me.mMenFileSep2.Size = New System.Drawing.Size(278, 6)
'
'mMenFileImportExport
'mMenFileImport
'
Me.mMenFileImportExport.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ImportFromXMLFileToolStripMenuItem, Me.ImportFromRDPFileToolStripMenuItem, Me.ImportFromActiveDirectoryToolStripMenuItem, Me.ImportFromPortScanToolStripMenuItem, Me.ToolStripSeparator6, Me.ExportToXMLFileToolStripMenuItem})
Me.mMenFileImportExport.Name = "mMenFileImportExport"
Me.mMenFileImportExport.Size = New System.Drawing.Size(281, 22)
Me.mMenFileImportExport.Text = "Import/Export Folder"
Me.mMenFileImportExport.Visible = False
Me.mMenFileImport.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mMenFileImportFromFile, Me.mMenFileImportFromActiveDirectory, Me.mMenFileImportFromPortScan})
Me.mMenFileImport.Name = "mMenFileImport"
Me.mMenFileImport.Size = New System.Drawing.Size(281, 22)
Me.mMenFileImport.Text = "&Import"
'
'ImportFromXMLFileToolStripMenuItem
'mMenFileImportFromFile
'
Me.ImportFromXMLFileToolStripMenuItem.Name = "ImportFromXMLFileToolStripMenuItem"
Me.ImportFromXMLFileToolStripMenuItem.Size = New System.Drawing.Size(235, 22)
Me.ImportFromXMLFileToolStripMenuItem.Text = "Import from XML File..."
Me.mMenFileImportFromFile.Name = "mMenFileImportFromFile"
Me.mMenFileImportFromFile.Size = New System.Drawing.Size(235, 22)
Me.mMenFileImportFromFile.Text = "Import from &File..."
'
'ImportFromRDPFileToolStripMenuItem
'mMenFileImportFromActiveDirectory
'
Me.ImportFromRDPFileToolStripMenuItem.Name = "ImportFromRDPFileToolStripMenuItem"
Me.ImportFromRDPFileToolStripMenuItem.Size = New System.Drawing.Size(235, 22)
Me.ImportFromRDPFileToolStripMenuItem.Text = "Import from RDP File..."
Me.mMenFileImportFromActiveDirectory.Name = "mMenFileImportFromActiveDirectory"
Me.mMenFileImportFromActiveDirectory.Size = New System.Drawing.Size(235, 22)
Me.mMenFileImportFromActiveDirectory.Text = "Import from &Active Directory..."
'
'ImportFromActiveDirectoryToolStripMenuItem
'mMenFileImportFromPortScan
'
Me.ImportFromActiveDirectoryToolStripMenuItem.Name = "ImportFromActiveDirectoryToolStripMenuItem"
Me.ImportFromActiveDirectoryToolStripMenuItem.Size = New System.Drawing.Size(235, 22)
Me.ImportFromActiveDirectoryToolStripMenuItem.Text = "Import from Active Directory..."
Me.mMenFileImportFromPortScan.Name = "mMenFileImportFromPortScan"
Me.mMenFileImportFromPortScan.Size = New System.Drawing.Size(235, 22)
Me.mMenFileImportFromPortScan.Text = "Import from &Port Scan..."
'
'ImportFromPortScanToolStripMenuItem
'mMenFileExport
'
Me.ImportFromPortScanToolStripMenuItem.Name = "ImportFromPortScanToolStripMenuItem"
Me.ImportFromPortScanToolStripMenuItem.Size = New System.Drawing.Size(235, 22)
Me.ImportFromPortScanToolStripMenuItem.Text = "Import from Port Scan..."
'
'ToolStripSeparator6
'
Me.ToolStripSeparator6.Name = "ToolStripSeparator6"
Me.ToolStripSeparator6.Size = New System.Drawing.Size(232, 6)
'
'ExportToXMLFileToolStripMenuItem
'
Me.ExportToXMLFileToolStripMenuItem.Name = "ExportToXMLFileToolStripMenuItem"
Me.ExportToXMLFileToolStripMenuItem.Size = New System.Drawing.Size(235, 22)
Me.ExportToXMLFileToolStripMenuItem.Text = "Export to XML File..."
Me.mMenFileExport.Name = "mMenFileExport"
Me.mMenFileExport.Size = New System.Drawing.Size(281, 22)
Me.mMenFileExport.Text = "&Export to File..."
'
'mMenFileSep3
'
Me.mMenFileSep3.Name = "mMenFileSep3"
Me.mMenFileSep3.Size = New System.Drawing.Size(278, 6)
Me.mMenFileSep3.Visible = False
'
'mMenFileDelete
'
@@ -910,13 +895,6 @@ Partial Class frmMain
Friend WithEvents mMenFileSep2 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents mMenFileNewConnection As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenFileNewFolder As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenFileImportExport As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ImportFromXMLFileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ImportFromRDPFileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ImportFromActiveDirectoryToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ImportFromPortScanToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator6 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents ExportToXMLFileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenFileSep3 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents mMenFileDelete As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenFileRename As System.Windows.Forms.ToolStripMenuItem
@@ -931,5 +909,10 @@ Partial Class frmMain
Friend WithEvents mnuQuickConnectProtocol As System.Windows.Forms.ContextMenuStrip
Friend WithEvents btnConnections As System.Windows.Forms.ToolStripDropDownButton
Friend WithEvents mnuConnections As System.Windows.Forms.ContextMenuStrip
Friend WithEvents mMenFileExport As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenFileImportFromFile As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenFileImportFromActiveDirectory As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenFileImportFromPortScan As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenFileImport As System.Windows.Forms.ToolStripMenuItem
End Class

View File

@@ -216,12 +216,6 @@
<metadata name="tsQuickConnect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>367, 17</value>
</metadata>
<metadata name="mnuQuickConnectProtocol.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>778, 17</value>
</metadata>
<metadata name="mnuConnections.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="tsExternalTools.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
@@ -231,6 +225,12 @@
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>671, 17</value>
</metadata>
<metadata name="mnuQuickConnectProtocol.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>778, 17</value>
</metadata>
<metadata name="mnuConnections.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="tmrAutoSave.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>245, 17</value>
</metadata>

View File

@@ -1,4 +1,5 @@
Imports System.IO
Imports mRemoteNG.App
Imports mRemoteNG.My
Imports SharedLibraryNG
Imports System.Text
@@ -162,12 +163,11 @@ Public Class frmMain
mMenFileLoad.Text = My.Language.strMenuOpenConnectionFile
mMenFileSave.Text = My.Language.strMenuSaveConnectionFile
mMenFileSaveAs.Text = My.Language.strMenuSaveConnectionFileAs
mMenFileImportExport.Text = My.Language.strImportExport
ImportFromActiveDirectoryToolStripMenuItem.Text = My.Language.strImportAD
ImportFromPortScanToolStripMenuItem.Text = My.Language.strImportPortScan
ImportFromRDPFileToolStripMenuItem.Text = My.Language.strImportRDPFiles
ImportFromXMLFileToolStripMenuItem.Text = My.Language.strImportmRemoteXML
ExportToXMLFileToolStripMenuItem.Text = My.Language.strExportmRemoteXML
mMenFileImport.Text = Language.strImportMenuItem
mMenFileImportFromFile.Text = Language.strImportFromFileMenuItem
mMenFileImportFromActiveDirectory.Text = Language.strImportAD
mMenFileImportFromPortScan.Text = Language.strImportPortScan
mMenFileExport.Text = Language.strExportToFileMenuItem
mMenFileExit.Text = My.Language.strMenuExit
mMenView.Text = My.Language.strMenuView
@@ -402,7 +402,6 @@ Public Class frmMain
Case Tree.Node.Type.Root
mMenFileNewConnection.Enabled = True
mMenFileNewFolder.Enabled = True
mMenFileImportExport.Enabled = True
mMenFileDelete.Enabled = False
mMenFileRename.Enabled = True
mMenFileDuplicate.Enabled = False
@@ -412,7 +411,6 @@ Public Class frmMain
Case Tree.Node.Type.Container
mMenFileNewConnection.Enabled = True
mMenFileNewFolder.Enabled = True
mMenFileImportExport.Enabled = True
mMenFileDelete.Enabled = True
mMenFileRename.Enabled = True
mMenFileDuplicate.Enabled = True
@@ -422,7 +420,6 @@ Public Class frmMain
Case Tree.Node.Type.Connection
mMenFileNewConnection.Enabled = True
mMenFileNewFolder.Enabled = True
mMenFileImportExport.Enabled = False
mMenFileDelete.Enabled = True
mMenFileRename.Enabled = True
mMenFileDuplicate.Enabled = True
@@ -432,7 +429,6 @@ Public Class frmMain
Case Tree.Node.Type.PuttyRoot, Tree.Node.Type.PuttySession
mMenFileNewConnection.Enabled = False
mMenFileNewFolder.Enabled = False
mMenFileImportExport.Enabled = False
mMenFileDelete.Enabled = False
mMenFileRename.Enabled = False
mMenFileDuplicate.Enabled = False
@@ -442,7 +438,6 @@ Public Class frmMain
Case Else
mMenFileNewConnection.Enabled = True
mMenFileNewFolder.Enabled = True
mMenFileImportExport.Enabled = False
mMenFileDelete.Enabled = False
mMenFileRename.Enabled = False
mMenFileDuplicate.Enabled = False
@@ -452,64 +447,78 @@ Public Class frmMain
End Select
End Sub
Private Sub mMenFileNewConnection_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenFileNewConnection.Click
App.Runtime.Windows.treeForm.AddConnection()
Private Shared Sub mMenFileNewConnection_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenFileNewConnection.Click
Windows.treeForm.AddConnection()
SaveConnectionsBG()
End Sub
Private Sub mMenFileNewFolder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenFileNewFolder.Click
App.Runtime.Windows.treeForm.AddFolder()
Private Shared Sub mMenFileNewFolder_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenFileNewFolder.Click
Windows.treeForm.AddFolder()
SaveConnectionsBG()
End Sub
Private Sub mMenFileNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenFileNew.Click
Dim lD As SaveFileDialog = Tools.Controls.ConnectionsSaveAsDialog
If lD.ShowDialog = System.Windows.Forms.DialogResult.OK Then
NewConnections(lD.FileName)
Else
Exit Sub
End If
Private Shared Sub mMenFileNew_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenFileNew.Click
Dim saveFileDialog As SaveFileDialog = Tools.Controls.ConnectionsSaveAsDialog
If Not saveFileDialog.ShowDialog() = DialogResult.OK Then Return
NewConnections(saveFileDialog.FileName)
End Sub
Private Sub mMenFileLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenFileLoad.Click
If App.Runtime.IsConnectionsFileLoaded Then
Select Case MsgBox(My.Language.strSaveConnectionsFileBeforeOpeningAnother, MsgBoxStyle.YesNoCancel Or MsgBoxStyle.Question)
Private Shared Sub mMenFileLoad_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenFileLoad.Click
If IsConnectionsFileLoaded Then
Select Case MsgBox(Language.strSaveConnectionsFileBeforeOpeningAnother, MsgBoxStyle.YesNoCancel Or MsgBoxStyle.Question)
Case MsgBoxResult.Yes
App.Runtime.SaveConnections()
SaveConnections()
Case MsgBoxResult.Cancel
Exit Sub
Return
End Select
End If
LoadConnections(True)
End Sub
Private Sub mMenFileSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenFileSave.Click
Private Shared Sub mMenFileSave_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenFileSave.Click
SaveConnections()
End Sub
Private Sub mMenFileSaveAs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenFileSaveAs.Click
Private Shared Sub mMenFileSaveAs_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenFileSaveAs.Click
SaveConnectionsAs()
End Sub
Private Sub mMenFileExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenFileExit.Click
App.Runtime.Shutdown.Quit()
End Sub
Private Sub mMenFileDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenFileDelete.Click
Private Shared Sub mMenFileDelete_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenFileDelete.Click
Tree.Node.DeleteSelectedNode()
SaveConnectionsBG()
End Sub
Private Sub mMenFileRename_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenFileRename.Click
Private Shared Sub mMenFileRename_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenFileRename.Click
Tree.Node.StartRenameSelectedNode()
SaveConnectionsBG()
End Sub
Private Sub mMenFileDuplicate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenFileDuplicate.Click
Private Shared Sub mMenFileDuplicate_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenFileDuplicate.Click
Tree.Node.CloneNode(Tree.Node.SelectedNode)
SaveConnectionsBG()
End Sub
Private Shared Sub mMenFileImportFromFile_Click(sender As System.Object, e As EventArgs) Handles mMenFileImportFromFile.Click
Import.ImportFromFile(Windows.treeForm.tvConnections.Nodes(0), Windows.treeForm.tvConnections.SelectedNode)
End Sub
Private Shared Sub mMenFileImportFromActiveDirectory_Click(sender As System.Object, e As EventArgs) Handles mMenFileImportFromActiveDirectory.Click
Windows.Show(UI.Window.Type.ActiveDirectoryImport)
End Sub
Private Shared Sub mMenFileImportFromPortScan_Click(sender As System.Object, e As EventArgs) Handles mMenFileImportFromPortScan.Click
Windows.Show(UI.Window.Type.PortScan, True)
End Sub
Private Shared Sub mMenFileExport_Click(sender As System.Object, e As EventArgs) Handles mMenFileExport.Click
Export.ExportToFile(Windows.treeForm.tvConnections.Nodes(0), Windows.treeForm.tvConnections.SelectedNode)
End Sub
Private Shared Sub mMenFileExit_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenFileExit.Click
Shutdown.Quit()
End Sub
#End Region
#Region "View"
@@ -668,8 +677,8 @@ Public Class frmMain
App.Runtime.Windows.Show(UI.Window.Type.ExternalApps)
End Sub
Private Sub mMenToolsPortScan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenToolsPortScan.Click
App.Runtime.Windows.Show(UI.Window.Type.PortScan, Tools.PortScan.PortScanMode.Normal)
Private Sub mMenToolsPortScan_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenToolsPortScan.Click
App.Runtime.Windows.Show(UI.Window.Type.PortScan, False)
End Sub
Private Sub mMenToolsComponentsCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mMenToolsComponentsCheck.Click

View File

@@ -1,7 +1,7 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.1008
' Runtime Version:4.0.30319.18408
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -82,6 +82,15 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Active Directory.
'''</summary>
Friend Shared ReadOnly Property strActiveDirectory() As String
Get
Return ResourceManager.GetString("strActiveDirectory", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Activity.
'''</summary>
@@ -1406,6 +1415,15 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Don&apos;t connect to console session.
'''</summary>
Friend Shared ReadOnly Property strDontConnectToConsoleSessionMenuItem() As String
Get
Return ResourceManager.GetString("strDontConnectToConsoleSessionMenuItem", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Don&apos;t connect if authentication fails.
'''</summary>
@@ -1680,6 +1698,33 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Export everything.
'''</summary>
Friend Shared ReadOnly Property strExportEverything() As String
Get
Return ResourceManager.GetString("strExportEverything", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Export File.
'''</summary>
Friend Shared ReadOnly Property strExportFile() As String
Get
Return ResourceManager.GetString("strExportFile", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Export Items.
'''</summary>
Friend Shared ReadOnly Property strExportItems() As String
Get
Return ResourceManager.GetString("strExportItems", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Export mRemote/mRemoteNG XML.
'''</summary>
@@ -1689,6 +1734,42 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Export Properties.
'''</summary>
Friend Shared ReadOnly Property strExportProperties() As String
Get
Return ResourceManager.GetString("strExportProperties", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Export the currently selected connection.
'''</summary>
Friend Shared ReadOnly Property strExportSelectedConnection() As String
Get
Return ResourceManager.GetString("strExportSelectedConnection", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Export the currently selected folder.
'''</summary>
Friend Shared ReadOnly Property strExportSelectedFolder() As String
Get
Return ResourceManager.GetString("strExportSelectedFolder", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &amp;Export to File....
'''</summary>
Friend Shared ReadOnly Property strExportToFileMenuItem() As String
Get
Return ResourceManager.GetString("strExportToFileMenuItem", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Ext. App.
'''</summary>
@@ -1725,6 +1806,15 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to File &amp;Format:.
'''</summary>
Friend Shared ReadOnly Property strFileFormatLabel() As String
Get
Return ResourceManager.GetString("strFileFormatLabel", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to All Files (*.*).
'''</summary>
@@ -1734,6 +1824,15 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to All importable files.
'''</summary>
Friend Shared ReadOnly Property strFilterAllImportable() As String
Get
Return ResourceManager.GetString("strFilterAllImportable", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Application Files (*.exe).
'''</summary>
@@ -1761,6 +1860,15 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to PuTTY Connection Manager files.
'''</summary>
Friend Shared ReadOnly Property strFilterPuttyConnectionManager() As String
Get
Return ResourceManager.GetString("strFilterPuttyConnectionManager", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Remote Desktop Connection Manager files (*.rdg).
'''</summary>
@@ -2058,6 +2166,69 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to An error occurred while importing the file, &quot;{0}&quot;..
'''</summary>
Friend Shared ReadOnly Property strImportFileFailedContent() As String
Get
Return ResourceManager.GetString("strImportFileFailedContent", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Import failed.
'''</summary>
Friend Shared ReadOnly Property strImportFileFailedMainInstruction() As String
Get
Return ResourceManager.GetString("strImportFileFailedMainInstruction", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Import from &amp;File....
'''</summary>
Friend Shared ReadOnly Property strImportFromFileMenuItem() As String
Get
Return ResourceManager.GetString("strImportFromFileMenuItem", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Under the root{0}{1}|Under the selected folder{0}{2}.
'''</summary>
Friend Shared ReadOnly Property strImportLocationCommandButtons() As String
Get
Return ResourceManager.GetString("strImportLocationCommandButtons", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Where would you like the imported items to be placed?.
'''</summary>
Friend Shared ReadOnly Property strImportLocationContent() As String
Get
Return ResourceManager.GetString("strImportLocationContent", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Import location.
'''</summary>
Friend Shared ReadOnly Property strImportLocationMainInstruction() As String
Get
Return ResourceManager.GetString("strImportLocationMainInstruction", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to &amp;Import.
'''</summary>
Friend Shared ReadOnly Property strImportMenuItem() As String
Get
Return ResourceManager.GetString("strImportMenuItem", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Import mRemote/mRemoteNG XML.
'''</summary>
@@ -3201,6 +3372,24 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to mRemoteNG CSV.
'''</summary>
Friend Shared ReadOnly Property strMremoteNgCsv() As String
Get
Return ResourceManager.GetString("strMremoteNgCsv", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to mRemoteNG XML.
'''</summary>
Friend Shared ReadOnly Property strMremoteNgXml() As String
Get
Return ResourceManager.GetString("strMremoteNgXml", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to My current credentials (Windows logon information).
'''</summary>
@@ -3535,6 +3724,15 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Port scan complete..
'''</summary>
Friend Shared ReadOnly Property strPortScanComplete() As String
Get
Return ResourceManager.GetString("strPortScanComplete", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Couldn&apos;t load PortScan panel!.
'''</summary>
@@ -6428,6 +6626,15 @@ Namespace My
End Get
End Property
'''<summary>
''' Looks up a localized string similar to visionapp Remote Desktop 2008 CSV.
'''</summary>
Friend Shared ReadOnly Property strVisionAppRemoteDesktopCsv() As String
Get
Return ResourceManager.GetString("strVisionAppRemoteDesktopCsv", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to VNC.
'''</summary>

View File

@@ -123,6 +123,9 @@
<data name="strActive" xml:space="preserve">
<value>Active</value>
</data>
<data name="strActiveDirectory" xml:space="preserve">
<value>Active Directory</value>
</data>
<data name="strActivity" xml:space="preserve">
<value>Activity</value>
</data>
@@ -578,6 +581,9 @@ Starting with new connections file.</value>
<data name="strDetect" xml:space="preserve">
<value>Detect</value>
</data>
<data name="strDontConnectToConsoleSessionMenuItem" xml:space="preserve">
<value>Don't connect to console session</value>
</data>
<data name="strDontConnectWhenAuthFails" xml:space="preserve">
<value>Don't connect if authentication fails</value>
</data>
@@ -672,9 +678,30 @@ See the Microsoft Support article at http://support.microsoft.com/kb/811833 for
<data name="strExport" xml:space="preserve">
<value>Export</value>
</data>
<data name="strExportEverything" xml:space="preserve">
<value>Export everything</value>
</data>
<data name="strExportFile" xml:space="preserve">
<value>Export File</value>
</data>
<data name="strExportItems" xml:space="preserve">
<value>Export Items</value>
</data>
<data name="strExportmRemoteXML" xml:space="preserve">
<value>Export mRemote/mRemoteNG XML</value>
</data>
<data name="strExportProperties" xml:space="preserve">
<value>Export Properties</value>
</data>
<data name="strExportSelectedConnection" xml:space="preserve">
<value>Export the currently selected connection</value>
</data>
<data name="strExportSelectedFolder" xml:space="preserve">
<value>Export the currently selected folder</value>
</data>
<data name="strExportToFileMenuItem" xml:space="preserve">
<value>&amp;Export to File...</value>
</data>
<data name="strExtApp" xml:space="preserve">
<value>Ext. App</value>
</data>
@@ -687,9 +714,15 @@ See the Microsoft Support article at http://support.microsoft.com/kb/811833 for
<data name="strFAMFAMFAMAttributionURL" xml:space="preserve">
<value>http://www.famfamfam.com/</value>
</data>
<data name="strFileFormatLabel" xml:space="preserve">
<value>File &amp;Format:</value>
</data>
<data name="strFilterAll" xml:space="preserve">
<value>All Files (*.*)</value>
</data>
<data name="strFilterAllImportable" xml:space="preserve">
<value>All importable files</value>
</data>
<data name="strFilterApplication" xml:space="preserve">
<value>Application Files (*.exe)</value>
</data>
@@ -699,6 +732,9 @@ See the Microsoft Support article at http://support.microsoft.com/kb/811833 for
<data name="strFiltermRemoteXML" xml:space="preserve">
<value>mRemote XML Files (*.xml)</value>
</data>
<data name="strFilterPuttyConnectionManager" xml:space="preserve">
<value>PuTTY Connection Manager files</value>
</data>
<data name="strFilterRdgFiles" xml:space="preserve">
<value>Remote Desktop Connection Manager files (*.rdg)</value>
</data>
@@ -798,6 +834,27 @@ See the Microsoft Support article at http://support.microsoft.com/kb/811833 for
<data name="strImportExport" xml:space="preserve">
<value>Import/Export</value>
</data>
<data name="strImportFileFailedContent" xml:space="preserve">
<value>An error occurred while importing the file, "{0}".</value>
</data>
<data name="strImportFileFailedMainInstruction" xml:space="preserve">
<value>Import failed</value>
</data>
<data name="strImportFromFileMenuItem" xml:space="preserve">
<value>Import from &amp;File...</value>
</data>
<data name="strImportLocationCommandButtons" xml:space="preserve">
<value>Under the root{0}{1}|Under the selected folder{0}{2}</value>
</data>
<data name="strImportLocationContent" xml:space="preserve">
<value>Where would you like the imported items to be placed?</value>
</data>
<data name="strImportLocationMainInstruction" xml:space="preserve">
<value>Import location</value>
</data>
<data name="strImportMenuItem" xml:space="preserve">
<value>&amp;Import</value>
</data>
<data name="strImportmRemoteXML" xml:space="preserve">
<value>Import mRemote/mRemoteNG XML</value>
</data>
@@ -1179,6 +1236,12 @@ See the Microsoft Support article at http://support.microsoft.com/kb/811833 for
<data name="strMoveUp" xml:space="preserve">
<value>Move up</value>
</data>
<data name="strMremoteNgCsv" xml:space="preserve">
<value>mRemoteNG CSV</value>
</data>
<data name="strMremoteNgXml" xml:space="preserve">
<value>mRemoteNG XML</value>
</data>
<data name="strMyCurrentWindowsCreds" xml:space="preserve">
<value>My current credentials (Windows logon information)</value>
</data>
@@ -1291,6 +1354,9 @@ If you run into such an error, please create a new connection file!</value>
<data name="strPleaseFillAllFields" xml:space="preserve">
<value>Please fill all fields</value>
</data>
<data name="strPortScanComplete" xml:space="preserve">
<value>Port scan complete.</value>
</data>
<data name="strPortScanCouldNotLoadPanel" xml:space="preserve">
<value>Couldn't load PortScan panel!</value>
</data>
@@ -2258,6 +2324,9 @@ mRemoteNG will now quit and begin with the installation.</value>
<data name="strVersion" xml:space="preserve">
<value>Version</value>
</data>
<data name="strVisionAppRemoteDesktopCsv" xml:space="preserve">
<value>visionapp Remote Desktop 2008 CSV</value>
</data>
<data name="strVnc" xml:space="preserve">
<value>VNC</value>
</data>

View File

@@ -634,6 +634,13 @@ Namespace My.Resources
End Get
End Property
Friend ReadOnly Property puttycm() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("puttycm", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
Friend ReadOnly Property PuttyConfig() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("PuttyConfig", resourceCulture)

View File

@@ -478,4 +478,8 @@
<data name="RDCMan_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\icons\rdcman_icon.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="puttycm" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\images\puttycm.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

View File

@@ -5,11 +5,6 @@ Imports System.Net
Namespace Tools
Namespace PortScan
Public Enum PortScanMode
Normal = 1
Import = 2
End Enum
Public Class ScanHost
#Region "Properties"
Private Shared _SSHPort As Integer = Connection.Protocol.SSH1.Defaults.Port
@@ -112,20 +107,20 @@ Namespace Tools
Private _openPorts As New ArrayList
Public Property OpenPorts() As ArrayList
Get
Return _OpenPorts
Return _openPorts
End Get
Set(ByVal value As ArrayList)
_OpenPorts = value
_openPorts = value
End Set
End Property
Private _closedPorts As ArrayList
Public Property ClosedPorts() As ArrayList
Get
Return _ClosedPorts
Return _closedPorts
End Get
Set(ByVal value As ArrayList)
_ClosedPorts = value
_closedPorts = value
End Set
End Property
@@ -203,8 +198,8 @@ Namespace Tools
#Region "Methods"
Public Sub New(ByVal host As String)
_hostIp = host
_OpenPorts = New ArrayList
_ClosedPorts = New ArrayList
_openPorts = New ArrayList
_closedPorts = New ArrayList
End Sub
Public Overrides Function ToString() As String
@@ -216,24 +211,24 @@ Namespace Tools
End Try
End Function
Public Function ToListViewItem(ByVal mode As PortScanMode) As ListViewItem
Public Function ToListViewItem(ByVal import As Boolean) As ListViewItem
Try
Dim lvI As New ListViewItem
lvI.Tag = Me
Dim listViewItem As New ListViewItem
listViewItem.Tag = Me
If _hostName <> "" Then
lvI.Text = _hostName
listViewItem.Text = _hostName
Else
lvI.Text = _hostIp
listViewItem.Text = _hostIp
End If
If Mode = PortScanMode.Import Then
lvI.SubItems.Add(BoolToYesNo(_SSH))
lvI.SubItems.Add(BoolToYesNo(_Telnet))
lvI.SubItems.Add(BoolToYesNo(_HTTP))
lvI.SubItems.Add(BoolToYesNo(_HTTPS))
lvI.SubItems.Add(BoolToYesNo(_Rlogin))
lvI.SubItems.Add(BoolToYesNo(_RDP))
lvI.SubItems.Add(BoolToYesNo(_VNC))
If import Then
listViewItem.SubItems.Add(BoolToYesNo(_SSH))
listViewItem.SubItems.Add(BoolToYesNo(_Telnet))
listViewItem.SubItems.Add(BoolToYesNo(_HTTP))
listViewItem.SubItems.Add(BoolToYesNo(_HTTPS))
listViewItem.SubItems.Add(BoolToYesNo(_Rlogin))
listViewItem.SubItems.Add(BoolToYesNo(_RDP))
listViewItem.SubItems.Add(BoolToYesNo(_VNC))
Else
Dim strOpen As String = ""
Dim strClosed As String = ""
@@ -246,13 +241,13 @@ Namespace Tools
strClosed &= p & ", "
Next
lvI.SubItems.Add(strOpen.Substring(0, IIf(strOpen.Length > 0, strOpen.Length - 2, strOpen.Length)))
lvI.SubItems.Add(strClosed.Substring(0, IIf(strClosed.Length > 0, strClosed.Length - 2, strClosed.Length)))
listViewItem.SubItems.Add(strOpen.Substring(0, IIf(strOpen.Length > 0, strOpen.Length - 2, strOpen.Length)))
listViewItem.SubItems.Add(strClosed.Substring(0, IIf(strClosed.Length > 0, strClosed.Length - 2, strClosed.Length)))
End If
Return lvI
Return listViewItem
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, "ToString failed (Tools.PortScan)", True)
MessageCollector.AddExceptionMessage("Tools.PortScan.ToListViewItem() failed.", ex, Messages.MessageClass.WarningMsg, True)
Return Nothing
End Try
End Function

View File

@@ -185,30 +185,34 @@ Namespace Tree
Public Shared Function AddNode(ByVal NodeType As Tree.Node.Type, Optional ByVal Text As String = "") As TreeNode
Public Shared Function AddNode(ByVal nodeType As Type, Optional ByVal name As String = Nothing) As TreeNode
Try
Dim nNode As New TreeNode
Dim treeNode As New TreeNode
Dim defaultName As String = ""
Select Case NodeType
Select Case nodeType
Case Type.Connection, Type.PuttySession
nNode.Text = My.Language.strNewConnection
nNode.ImageIndex = Images.Enums.TreeImage.ConnectionClosed
nNode.SelectedImageIndex = Images.Enums.TreeImage.ConnectionClosed
defaultName = My.Language.strNewConnection
treeNode.ImageIndex = Images.Enums.TreeImage.ConnectionClosed
treeNode.SelectedImageIndex = Images.Enums.TreeImage.ConnectionClosed
Case Type.Container
nNode.Text = My.Language.strNewFolder
nNode.ImageIndex = Images.Enums.TreeImage.Container
nNode.SelectedImageIndex = Images.Enums.TreeImage.Container
defaultName = My.Language.strNewFolder
treeNode.ImageIndex = Images.Enums.TreeImage.Container
treeNode.SelectedImageIndex = Images.Enums.TreeImage.Container
Case Type.Root
nNode.Text = My.Language.strNewRoot
nNode.ImageIndex = Images.Enums.TreeImage.Root
nNode.SelectedImageIndex = Images.Enums.TreeImage.Root
defaultName = My.Language.strNewRoot
treeNode.ImageIndex = Images.Enums.TreeImage.Root
treeNode.SelectedImageIndex = Images.Enums.TreeImage.Root
End Select
If Text <> "" Then
nNode.Text = Text
If Not String.IsNullOrEmpty(name) Then
treeNode.Name = name
Else
treeNode.Name = defaultName
End If
treeNode.Text = treeNode.Name
Return nNode
Return treeNode
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "AddNode failed" & vbNewLine & ex.Message, True)
End Try
@@ -216,92 +220,6 @@ Namespace Tree
Return Nothing
End Function
Public Shared Sub AddADNodes(ByVal ldapPath As String)
Try
Dim adCNode As TreeNode = Tree.Node.AddNode(Type.Container)
Dim nContI As New mRemoteNG.Container.Info()
nContI.TreeNode = adCNode
nContI.ConnectionInfo = New mRemoteNG.Connection.Info(nContI)
If Tree.Node.SelectedNode IsNot Nothing Then
If Tree.Node.GetNodeType(Tree.Node.SelectedNode) = Tree.Node.Type.Container Then
nContI.Parent = Tree.Node.SelectedNode.Tag
End If
End If
Dim strDisplayName As String
strDisplayName = ldapPath.Remove(0, ldapPath.IndexOf("OU=") + 3)
strDisplayName = strDisplayName.Substring(0, strDisplayName.IndexOf(","))
nContI.Name = strDisplayName
nContI.TreeNode.Text = strDisplayName
adCNode.Tag = nContI
containerList.Add(nContI)
CreateADSubNodes(adCNode, ldapPath)
SelectedNode.Nodes.Add(adCNode)
SelectedNode = SelectedNode.Nodes(SelectedNode.Nodes.Count - 1)
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "AddADNodes failed" & vbNewLine & ex.Message, True)
End Try
End Sub
Private Shared Sub CreateADSubNodes(ByVal rNode As TreeNode, ByVal ldapPath As String)
Try
Dim strDisplayName, strDescription, strHostName As String
Dim ldapFilter As String = "(objectClass=computer)" '"sAMAccountName=*"
Dim ldapSearcher As New DirectorySearcher
Dim ldapResults As SearchResultCollection
Dim ldapResult As SearchResult
Dim ResultFields() As String = {"securityEquals", "cn"}
With ldapSearcher
.SearchRoot = New DirectoryEntry(ldapPath)
.PropertiesToLoad.AddRange(ResultFields)
.Filter = ldapFilter
.SearchScope = SearchScope.OneLevel
ldapResults = .FindAll
End With
For Each ldapResult In ldapResults
With ldapResult.GetDirectoryEntry()
strDisplayName = .Properties("cn").Value
strDescription = .Properties("Description").Value
strHostName = .Properties("dNSHostName").Value
End With
Dim adNode As TreeNode = Tree.Node.AddNode(Type.Connection, strDisplayName)
Dim nConI As New mRemoteNG.Connection.Info()
Dim nInh As New mRemoteNG.Connection.Info.Inheritance(nConI, True)
nInh.Description = False
If TypeOf rNode.Tag Is mRemoteNG.Container.Info Then
nConI.Parent = rNode.Tag
End If
nConI.Inherit = nInh
nConI.Name = strDisplayName
nConI.Hostname = strHostName
nConI.Description = strDescription
nConI.TreeNode = adNode
adNode.Tag = nConI 'set the nodes tag to the conI
'add connection to connections
connectionList.Add(nConI)
rNode.Nodes.Add(adNode)
Next
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "CreateADSubNodes failed" & vbNewLine & ex.Message, True)
End Try
End Sub
Public Shared Sub CloneNode(ByVal oldTreeNode As TreeNode, Optional ByVal parentNode As TreeNode = Nothing)
Try
If GetNodeType(oldTreeNode) = Type.Connection Then

View File

@@ -1,165 +0,0 @@
Imports WeifenLuo.WinFormsUI.Docking
Namespace UI
Namespace Window
Public Class ADImport
Inherits UI.Window.Base
#Region "Form Init"
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents btnOK As System.Windows.Forms.Button
Friend WithEvents txtDomain As System.Windows.Forms.TextBox
Friend WithEvents lblDomain As System.Windows.Forms.Label
Friend WithEvents btnChangeDomain As System.Windows.Forms.Button
Friend WithEvents AD As ADTree.ADtree
Private Sub InitializeComponent()
Me.btnOK = New System.Windows.Forms.Button
Me.btnCancel = New System.Windows.Forms.Button
Me.txtDomain = New System.Windows.Forms.TextBox
Me.lblDomain = New System.Windows.Forms.Label
Me.btnChangeDomain = New System.Windows.Forms.Button
Me.AD = New ADTree.ADtree
Me.SuspendLayout()
'
'btnOK
'
Me.btnOK.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnOK.Location = New System.Drawing.Point(372, 347)
Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(75, 23)
Me.btnOK.TabIndex = 100
Me.btnOK.Text = "OK"
Me.btnOK.UseVisualStyleBackColor = True
'
'btnCancel
'
Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnCancel.Location = New System.Drawing.Point(453, 347)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 110
Me.btnCancel.Text = "Cancel"
Me.btnCancel.UseVisualStyleBackColor = True
'
'txtDomain
'
Me.txtDomain.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.txtDomain.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txtDomain.Location = New System.Drawing.Point(57, 348)
Me.txtDomain.Name = "txtDomain"
Me.txtDomain.Size = New System.Drawing.Size(100, 20)
Me.txtDomain.TabIndex = 30
'
'lblDomain
'
Me.lblDomain.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.lblDomain.AutoSize = True
Me.lblDomain.Location = New System.Drawing.Point(5, 351)
Me.lblDomain.Name = "lblDomain"
Me.lblDomain.Size = New System.Drawing.Size(46, 13)
Me.lblDomain.TabIndex = 20
Me.lblDomain.Text = "Domain:"
'
'btnChangeDomain
'
Me.btnChangeDomain.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnChangeDomain.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnChangeDomain.Location = New System.Drawing.Point(163, 347)
Me.btnChangeDomain.Name = "btnChangeDomain"
Me.btnChangeDomain.Size = New System.Drawing.Size(75, 23)
Me.btnChangeDomain.TabIndex = 40
Me.btnChangeDomain.Text = "Change"
Me.btnChangeDomain.UseVisualStyleBackColor = True
'
'AD
'
Me.AD.ADPath = Nothing
Me.AD.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.AD.Domain = ""
Me.AD.Location = New System.Drawing.Point(0, 0)
Me.AD.Name = "AD"
Me.AD.SelectedNode = Nothing
Me.AD.Size = New System.Drawing.Size(530, 341)
Me.AD.TabIndex = 10
'
'ADImport
'
Me.AcceptButton = Me.btnOK
Me.CancelButton = Me.btnCancel
Me.ClientSize = New System.Drawing.Size(530, 373)
Me.Controls.Add(Me.AD)
Me.Controls.Add(Me.lblDomain)
Me.Controls.Add(Me.txtDomain)
Me.Controls.Add(Me.btnChangeDomain)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnOK)
Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Icon = Global.mRemoteNG.My.Resources.Resources.ActiveDirectory_Icon
Me.Name = "ADImport"
Me.TabText = "Active Directory Import"
Me.Text = "Active Directory Import"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
#Region "Public Methods"
Public Sub New(ByVal Panel As DockContent)
Me.WindowType = Type.ADImport
Me.DockPnl = Panel
Me.InitializeComponent()
End Sub
#End Region
#Region "Form Stuff"
Private Sub ADImport_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ApplyLanguage()
End Sub
Private Sub ApplyLanguage()
btnOK.Text = My.Language.strButtonOK
btnCancel.Text = My.Language.strButtonCancel
lblDomain.Text = My.Language.strLabelDomain
btnChangeDomain.Text = My.Language.strButtonChange
End Sub
#End Region
#Region "Public Properties"
Private _ADPath As String
Public Property ADPath() As String
Get
Return _ADPath
End Get
Set(ByVal value As String)
_ADPath = value
End Set
End Property
#End Region
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
Me._ADPath = Me.AD.ADPath
mRemoteNG.Tree.Node.AddADNodes(Me._ADPath)
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Me._ADPath = ""
Me.DialogResult = Windows.Forms.DialogResult.Cancel
Me.Close()
End Sub
Private Sub btnChangeDomain_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChangeDomain.Click
Me.AD.Domain = txtDomain.Text
Me.AD.Refresh()
End Sub
End Class
End Namespace
End Namespace

View File

@@ -0,0 +1,93 @@
Namespace UI
Namespace Window
Partial Public Class ActiveDirectoryImport
Inherits UI.Window.Base
#Region " Windows Form Designer generated code "
Private Sub InitializeComponent()
Me.btnImport = New System.Windows.Forms.Button()
Me.txtDomain = New System.Windows.Forms.TextBox()
Me.lblDomain = New System.Windows.Forms.Label()
Me.btnChangeDomain = New System.Windows.Forms.Button()
Me.ActiveDirectoryTree = New ADTree.ADtree()
Me.SuspendLayout()
'
'btnImport
'
Me.btnImport.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnImport.Location = New System.Drawing.Point(443, 338)
Me.btnImport.Name = "btnImport"
Me.btnImport.Size = New System.Drawing.Size(75, 23)
Me.btnImport.TabIndex = 4
Me.btnImport.Text = "&Import"
Me.btnImport.UseVisualStyleBackColor = True
'
'txtDomain
'
Me.txtDomain.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtDomain.Location = New System.Drawing.Point(12, 25)
Me.txtDomain.Name = "txtDomain"
Me.txtDomain.Size = New System.Drawing.Size(425, 20)
Me.txtDomain.TabIndex = 1
'
'lblDomain
'
Me.lblDomain.AutoSize = True
Me.lblDomain.Location = New System.Drawing.Point(9, 9)
Me.lblDomain.Name = "lblDomain"
Me.lblDomain.Size = New System.Drawing.Size(46, 13)
Me.lblDomain.TabIndex = 0
Me.lblDomain.Text = "Domain:"
'
'btnChangeDomain
'
Me.btnChangeDomain.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnChangeDomain.Location = New System.Drawing.Point(443, 23)
Me.btnChangeDomain.Name = "btnChangeDomain"
Me.btnChangeDomain.Size = New System.Drawing.Size(75, 23)
Me.btnChangeDomain.TabIndex = 2
Me.btnChangeDomain.Text = "Change"
Me.btnChangeDomain.UseVisualStyleBackColor = True
'
'ActiveDirectoryTree
'
Me.ActiveDirectoryTree.ADPath = Nothing
Me.ActiveDirectoryTree.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ActiveDirectoryTree.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.ActiveDirectoryTree.Location = New System.Drawing.Point(12, 52)
Me.ActiveDirectoryTree.Name = "ActiveDirectoryTree"
Me.ActiveDirectoryTree.SelectedNode = Nothing
Me.ActiveDirectoryTree.Size = New System.Drawing.Size(506, 280)
Me.ActiveDirectoryTree.TabIndex = 3
'
'ADImport
'
Me.AcceptButton = Me.btnImport
Me.ClientSize = New System.Drawing.Size(530, 373)
Me.Controls.Add(Me.ActiveDirectoryTree)
Me.Controls.Add(Me.lblDomain)
Me.Controls.Add(Me.txtDomain)
Me.Controls.Add(Me.btnChangeDomain)
Me.Controls.Add(Me.btnImport)
Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Icon = Global.mRemoteNG.My.Resources.Resources.ActiveDirectory_Icon
Me.Name = "ActiveDirectoryImport"
Me.TabText = "Active Directory Import"
Me.Text = "Active Directory Import"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Private WithEvents btnImport As System.Windows.Forms.Button
Private WithEvents txtDomain As System.Windows.Forms.TextBox
Private WithEvents lblDomain As System.Windows.Forms.Label
Private WithEvents btnChangeDomain As System.Windows.Forms.Button
Private WithEvents ActiveDirectoryTree As ADTree.ADtree
#End Region
End Class
End Namespace
End Namespace

View File

@@ -0,0 +1,71 @@
Imports WeifenLuo.WinFormsUI.Docking
Imports mRemoteNG.App
Namespace UI
Namespace Window
Public Class ActiveDirectoryImport
Inherits Base
#Region "Constructors"
Public Sub New(ByVal panel As DockContent)
InitializeComponent()
Runtime.FontOverride(Me)
WindowType = Type.ActiveDirectoryImport
DockPnl = panel
End Sub
#End Region
#Region "Private Methods"
#Region "Event Handlers"
Private Sub ADImport_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
ApplyLanguage()
txtDomain.Text = ActiveDirectoryTree.Domain
EnableDisableImportButton()
End Sub
Private Sub btnImport_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnImport.Click
Import.ImportFromActiveDirectory(ActiveDirectoryTree.ADPath)
DialogResult = DialogResult.OK
Close()
End Sub
Private Shared Sub txtDomain_PreviewKeyDown(sender As System.Object, e As PreviewKeyDownEventArgs) Handles txtDomain.PreviewKeyDown
If e.KeyCode = Keys.Enter Then e.IsInputKey = True
End Sub
Private Sub txtDomain_KeyDown(sender As System.Object, e As KeyEventArgs) Handles txtDomain.KeyDown
If e.KeyCode = Keys.Enter Then
ChangeDomain()
e.SuppressKeyPress = True
End If
End Sub
Private Sub btnChangeDomain_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnChangeDomain.Click
ChangeDomain()
End Sub
Private Sub ActiveDirectoryTree_ADPathChanged(ByVal sender As Object) Handles ActiveDirectoryTree.ADPathChanged
EnableDisableImportButton()
End Sub
#End Region
Private Sub ApplyLanguage()
btnImport.Text = My.Language.strButtonImport
lblDomain.Text = My.Language.strLabelDomain
btnChangeDomain.Text = My.Language.strButtonChange
End Sub
Private Sub ChangeDomain()
ActiveDirectoryTree.Domain = txtDomain.Text
ActiveDirectoryTree.Refresh()
End Sub
Private Sub EnableDisableImportButton()
btnImport.Enabled = Not String.IsNullOrEmpty(ActiveDirectoryTree.ADPath)
End Sub
#End Region
End Class
End Namespace
End Namespace

View File

@@ -87,7 +87,7 @@ Namespace UI
'
'cmenTabFullscreen
'
Me.cmenTabFullscreen.Image = Global.mRemoteNG.My.Resources.Resources.Fullscreen
Me.cmenTabFullscreen.Image = Global.mRemoteNG.My.Resources.Resources.arrow_out
Me.cmenTabFullscreen.Name = "cmenTabFullscreen"
Me.cmenTabFullscreen.Size = New System.Drawing.Size(201, 22)
Me.cmenTabFullscreen.Text = "Fullscreen (RDP)"

View File

@@ -1,135 +0,0 @@
Namespace UI
Namespace Window
Public Partial Class Export
Inherits Base
#Region " Windows Form Designer generated code "
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents lvSecurity As System.Windows.Forms.ListView
Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader
Friend WithEvents btnOK As System.Windows.Forms.Button
Friend WithEvents lblMremoteXMLOnly As System.Windows.Forms.Label
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents lblUncheckProperties As System.Windows.Forms.Label
Private Sub InitializeComponent()
Dim ListViewItem1 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem("Username")
Dim ListViewItem2 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem("Password")
Dim ListViewItem3 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem("Domain")
Dim ListViewItem4 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem("Inheritance")
Me.btnCancel = New System.Windows.Forms.Button()
Me.btnOK = New System.Windows.Forms.Button()
Me.lvSecurity = New System.Windows.Forms.ListView()
Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.lblUncheckProperties = New System.Windows.Forms.Label()
Me.lblMremoteXMLOnly = New System.Windows.Forms.Label()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'btnCancel
'
Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnCancel.Location = New System.Drawing.Point(457, 370)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 4
Me.btnCancel.Text = "&Cancel"
Me.btnCancel.UseVisualStyleBackColor = True
'
'btnOK
'
Me.btnOK.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnOK.Location = New System.Drawing.Point(376, 370)
Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(75, 23)
Me.btnOK.TabIndex = 3
Me.btnOK.Text = "&OK"
Me.btnOK.UseVisualStyleBackColor = True
'
'lvSecurity
'
Me.lvSecurity.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lvSecurity.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.lvSecurity.CheckBoxes = True
Me.lvSecurity.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1})
Me.lvSecurity.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None
ListViewItem1.Checked = True
ListViewItem1.StateImageIndex = 1
ListViewItem2.Checked = True
ListViewItem2.StateImageIndex = 1
ListViewItem3.Checked = True
ListViewItem3.StateImageIndex = 1
ListViewItem4.Checked = True
ListViewItem4.StateImageIndex = 1
Me.lvSecurity.Items.AddRange(New System.Windows.Forms.ListViewItem() {ListViewItem1, ListViewItem2, ListViewItem3, ListViewItem4})
Me.lvSecurity.Location = New System.Drawing.Point(0, 55)
Me.lvSecurity.MultiSelect = False
Me.lvSecurity.Name = "lvSecurity"
Me.lvSecurity.Scrollable = False
Me.lvSecurity.Size = New System.Drawing.Size(532, 309)
Me.lvSecurity.TabIndex = 2
Me.lvSecurity.UseCompatibleStateImageBehavior = False
Me.lvSecurity.View = System.Windows.Forms.View.Details
'
'ColumnHeader1
'
Me.ColumnHeader1.Width = 110
'
'Label1
'
Me.lblUncheckProperties.AutoSize = True
Me.lblUncheckProperties.Location = New System.Drawing.Point(12, 11)
Me.lblUncheckProperties.Name = "lblUncheckProperties"
Me.lblUncheckProperties.Size = New System.Drawing.Size(244, 13)
Me.lblUncheckProperties.TabIndex = 0
Me.lblUncheckProperties.Text = "Uncheck the properties you want not to be saved!"
'
'lblMremoteXMLOnly
'
Me.lblMremoteXMLOnly.AutoSize = True
Me.lblMremoteXMLOnly.ForeColor = System.Drawing.Color.DarkRed
Me.lblMremoteXMLOnly.Location = New System.Drawing.Point(37, 33)
Me.lblMremoteXMLOnly.Name = "lblMremoteXMLOnly"
Me.lblMremoteXMLOnly.Size = New System.Drawing.Size(345, 13)
Me.lblMremoteXMLOnly.TabIndex = 1
Me.lblMremoteXMLOnly.Text = "(These properties will only be saved if you select a mRemote file format!)"
'
'PictureBox1
'
Me.PictureBox1.Image = Global.mRemoteNG.My.Resources.Resources.WarningSmall
Me.PictureBox1.Location = New System.Drawing.Point(15, 31)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(16, 16)
Me.PictureBox1.TabIndex = 112
Me.PictureBox1.TabStop = False
'
'Export
'
Me.AcceptButton = Me.btnOK
Me.CancelButton = Me.btnCancel
Me.ClientSize = New System.Drawing.Size(534, 396)
Me.Controls.Add(Me.PictureBox1)
Me.Controls.Add(Me.lblMremoteXMLOnly)
Me.Controls.Add(Me.lblUncheckProperties)
Me.Controls.Add(Me.lvSecurity)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnOK)
Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Icon = Global.mRemoteNG.My.Resources.Resources.Connections_SaveAs_Icon
Me.Name = "Export"
Me.TabText = "Export Connections"
Me.Text = "Export Connections"
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
End Class
End Namespace
End Namespace

View File

@@ -1,72 +0,0 @@
Imports WeifenLuo.WinFormsUI.Docking
Imports mRemoteNG.App.Runtime
Namespace UI
Namespace Window
Public Class Export
Inherits Base
#Region "Public Properties"
Public Property TreeNode() As TreeNode
#End Region
#Region "Constructors"
Public Sub New(ByVal panel As DockContent, Optional ByVal treeNode As TreeNode = Nothing)
InitializeComponent()
WindowType = Type.Export
DockPnl = panel
Me.TreeNode = treeNode
End Sub
#End Region
#Region "Private Methods"
#Region "Event Handlers"
Private Sub Export_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
ApplyLanguage()
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnCancel.Click
Close()
End Sub
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnOK.Click
Try
If TreeNode Is Nothing Then TreeNode = Windows.treeForm.tvConnections.Nodes(0)
Dim saveSecurity As New Security.Save()
saveSecurity.Username = lvSecurity.Items(0).Checked
saveSecurity.Password = lvSecurity.Items(1).Checked
saveSecurity.Domain = lvSecurity.Items(2).Checked
saveSecurity.Inheritance = lvSecurity.Items(3).Checked
SaveConnectionsAs(TreeNode, saveSecurity)
Close()
Catch ex As Exception
MessageCollector.AddExceptionMessage("UI.Window.Export.btnOK_Click() failed.", ex, , True)
End Try
End Sub
#End Region
Private Sub ApplyLanguage()
Text = My.Language.strExport
TabText = My.Language.strExport
lblUncheckProperties.Text = My.Language.strUncheckProperties
lblMremoteXMLOnly.Text = My.Language.strPropertiesWillOnlyBeSavedMRemoteXML
lvSecurity.Items(0).Text = My.Language.strCheckboxUsername
lvSecurity.Items(1).Text = My.Language.strCheckboxPassword
lvSecurity.Items(2).Text = My.Language.strCheckboxDomain
lvSecurity.Items(3).Text = My.Language.strCheckboxInheritance
btnOK.Text = My.Language.strButtonOK
btnCancel.Text = My.Language.strButtonCancel
End Sub
#End Region
End Class
End Namespace
End Namespace

View File

@@ -0,0 +1,309 @@
Namespace UI
Namespace Window
Partial Public Class PortScan
Inherits UI.Window.Base
#Region " Windows Form Designer generated code "
Friend WithEvents lblEndIP As System.Windows.Forms.Label
Friend WithEvents lblStartIP As System.Windows.Forms.Label
Friend WithEvents btnScan As System.Windows.Forms.Button
Friend WithEvents ipEnd As IPTextBox.IPTextBox
Friend WithEvents lvHosts As System.Windows.Forms.ListView
Friend WithEvents clmHost As System.Windows.Forms.ColumnHeader
Friend WithEvents clmSSH As System.Windows.Forms.ColumnHeader
Friend WithEvents clmTelnet As System.Windows.Forms.ColumnHeader
Friend WithEvents clmHTTP As System.Windows.Forms.ColumnHeader
Friend WithEvents clmHTTPS As System.Windows.Forms.ColumnHeader
Friend WithEvents clmRlogin As System.Windows.Forms.ColumnHeader
Friend WithEvents clmRDP As System.Windows.Forms.ColumnHeader
Friend WithEvents clmVNC As System.Windows.Forms.ColumnHeader
Friend WithEvents clmOpenPorts As System.Windows.Forms.ColumnHeader
Friend WithEvents clmClosedPorts As System.Windows.Forms.ColumnHeader
Friend WithEvents prgBar As System.Windows.Forms.ProgressBar
Friend WithEvents lblOnlyImport As System.Windows.Forms.Label
Friend WithEvents cbProtocol As System.Windows.Forms.ComboBox
Friend WithEvents pnlPorts As System.Windows.Forms.Panel
Friend WithEvents portEnd As System.Windows.Forms.NumericUpDown
Friend WithEvents portStart As System.Windows.Forms.NumericUpDown
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents btnImport As System.Windows.Forms.Button
Friend WithEvents ipStart As IPTextBox.IPTextBox
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(PortScan))
Me.ipStart = New IPTextBox.IPTextBox()
Me.ipEnd = New IPTextBox.IPTextBox()
Me.lblStartIP = New System.Windows.Forms.Label()
Me.lblEndIP = New System.Windows.Forms.Label()
Me.btnScan = New System.Windows.Forms.Button()
Me.lvHosts = New System.Windows.Forms.ListView()
Me.btnImport = New System.Windows.Forms.Button()
Me.cbProtocol = New System.Windows.Forms.ComboBox()
Me.lblOnlyImport = New System.Windows.Forms.Label()
Me.clmHost = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmSSH = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmTelnet = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmHTTP = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmHTTPS = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmRlogin = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmRDP = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmVNC = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmOpenPorts = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmClosedPorts = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.prgBar = New System.Windows.Forms.ProgressBar()
Me.pnlPorts = New System.Windows.Forms.Panel()
Me.portEnd = New System.Windows.Forms.NumericUpDown()
Me.portStart = New System.Windows.Forms.NumericUpDown()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.pnlImport = New System.Windows.Forms.Panel()
Me.pnlPorts.SuspendLayout()
CType(Me.portEnd, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.portStart, System.ComponentModel.ISupportInitialize).BeginInit()
Me.pnlImport.SuspendLayout()
Me.SuspendLayout()
'
'ipStart
'
Me.ipStart.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.ipStart.Location = New System.Drawing.Point(12, 25)
Me.ipStart.Name = "ipStart"
Me.ipStart.Size = New System.Drawing.Size(113, 20)
Me.ipStart.TabIndex = 10
'
'ipEnd
'
Me.ipEnd.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.ipEnd.Location = New System.Drawing.Point(131, 25)
Me.ipEnd.Name = "ipEnd"
Me.ipEnd.Size = New System.Drawing.Size(113, 20)
Me.ipEnd.TabIndex = 15
'
'lblStartIP
'
Me.lblStartIP.AutoSize = True
Me.lblStartIP.Location = New System.Drawing.Point(9, 9)
Me.lblStartIP.Name = "lblStartIP"
Me.lblStartIP.Size = New System.Drawing.Size(45, 13)
Me.lblStartIP.TabIndex = 0
Me.lblStartIP.Text = "Start IP:"
'
'lblEndIP
'
Me.lblEndIP.AutoSize = True
Me.lblEndIP.Location = New System.Drawing.Point(128, 9)
Me.lblEndIP.Name = "lblEndIP"
Me.lblEndIP.Size = New System.Drawing.Size(42, 13)
Me.lblEndIP.TabIndex = 5
Me.lblEndIP.Text = "End IP:"
'
'btnScan
'
Me.btnScan.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnScan.Image = Global.mRemoteNG.My.Resources.Resources.Search
Me.btnScan.Location = New System.Drawing.Point(420, 9)
Me.btnScan.Name = "btnScan"
Me.btnScan.Size = New System.Drawing.Size(86, 58)
Me.btnScan.TabIndex = 20
Me.btnScan.Text = "&Scan"
Me.btnScan.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
Me.btnScan.UseVisualStyleBackColor = True
'
'lvHosts
'
Me.lvHosts.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lvHosts.FullRowSelect = True
Me.lvHosts.GridLines = True
Me.lvHosts.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable
Me.lvHosts.HideSelection = False
Me.lvHosts.Location = New System.Drawing.Point(12, 73)
Me.lvHosts.Name = "lvHosts"
Me.lvHosts.Size = New System.Drawing.Size(494, 214)
Me.lvHosts.TabIndex = 26
Me.lvHosts.UseCompatibleStateImageBehavior = False
Me.lvHosts.View = System.Windows.Forms.View.Details
'
'btnImport
'
Me.btnImport.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnImport.Location = New System.Drawing.Point(419, 6)
Me.btnImport.Name = "btnImport"
Me.btnImport.Size = New System.Drawing.Size(75, 23)
Me.btnImport.TabIndex = 101
Me.btnImport.Text = "&Import"
Me.btnImport.UseVisualStyleBackColor = True
'
'cbProtocol
'
Me.cbProtocol.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.cbProtocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cbProtocol.FormattingEnabled = True
Me.cbProtocol.Items.AddRange(New Object() {"SSH2", "Telnet", "HTTP", "HTTPS", "Rlogin", "RDP", "VNC"})
Me.cbProtocol.Location = New System.Drawing.Point(98, 8)
Me.cbProtocol.Name = "cbProtocol"
Me.cbProtocol.Size = New System.Drawing.Size(122, 21)
Me.cbProtocol.TabIndex = 28
'
'lblOnlyImport
'
Me.lblOnlyImport.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.lblOnlyImport.AutoSize = True
Me.lblOnlyImport.Location = New System.Drawing.Point(0, 11)
Me.lblOnlyImport.Name = "lblOnlyImport"
Me.lblOnlyImport.Size = New System.Drawing.Size(92, 13)
Me.lblOnlyImport.TabIndex = 1
Me.lblOnlyImport.Text = "Protocol to import:"
'
'clmHost
'
Me.clmHost.Text = "Hostname/IP"
Me.clmHost.Width = 130
'
'clmSSH
'
Me.clmSSH.Text = "SSH"
Me.clmSSH.Width = 50
'
'clmTelnet
'
Me.clmTelnet.Text = "Telnet"
Me.clmTelnet.Width = 50
'
'clmHTTP
'
Me.clmHTTP.Text = "HTTP"
Me.clmHTTP.Width = 50
'
'clmHTTPS
'
Me.clmHTTPS.Text = "HTTPS"
Me.clmHTTPS.Width = 50
'
'clmRlogin
'
Me.clmRlogin.Text = "Rlogin"
Me.clmRlogin.Width = 50
'
'clmRDP
'
Me.clmRDP.Text = "RDP"
Me.clmRDP.Width = 50
'
'clmVNC
'
Me.clmVNC.Text = "VNC"
Me.clmVNC.Width = 50
'
'clmOpenPorts
'
Me.clmOpenPorts.Text = "Open Ports"
Me.clmOpenPorts.Width = 150
'
'clmClosedPorts
'
Me.clmClosedPorts.Text = "Closed Ports"
Me.clmClosedPorts.Width = 150
'
'prgBar
'
Me.prgBar.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.prgBar.Location = New System.Drawing.Point(12, 51)
Me.prgBar.Name = "prgBar"
Me.prgBar.Size = New System.Drawing.Size(402, 16)
Me.prgBar.Step = 1
Me.prgBar.TabIndex = 28
'
'pnlPorts
'
Me.pnlPorts.Controls.Add(Me.portEnd)
Me.pnlPorts.Controls.Add(Me.portStart)
Me.pnlPorts.Controls.Add(Me.Label2)
Me.pnlPorts.Controls.Add(Me.Label1)
Me.pnlPorts.Location = New System.Drawing.Point(268, 7)
Me.pnlPorts.Name = "pnlPorts"
Me.pnlPorts.Size = New System.Drawing.Size(152, 38)
Me.pnlPorts.TabIndex = 18
'
'portEnd
'
Me.portEnd.Location = New System.Drawing.Point(79, 18)
Me.portEnd.Maximum = New Decimal(New Integer() {65535, 0, 0, 0})
Me.portEnd.Name = "portEnd"
Me.portEnd.Size = New System.Drawing.Size(67, 20)
Me.portEnd.TabIndex = 15
'
'portStart
'
Me.portStart.Location = New System.Drawing.Point(6, 18)
Me.portStart.Maximum = New Decimal(New Integer() {65535, 0, 0, 0})
Me.portStart.Name = "portStart"
Me.portStart.Size = New System.Drawing.Size(67, 20)
Me.portStart.TabIndex = 5
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(76, 2)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(51, 13)
Me.Label2.TabIndex = 10
Me.Label2.Text = "End Port:"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(3, 2)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(54, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Start Port:"
'
'pnlImport
'
Me.pnlImport.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.pnlImport.Controls.Add(Me.btnImport)
Me.pnlImport.Controls.Add(Me.lblOnlyImport)
Me.pnlImport.Controls.Add(Me.cbProtocol)
Me.pnlImport.Location = New System.Drawing.Point(12, 287)
Me.pnlImport.Name = "pnlImport"
Me.pnlImport.Size = New System.Drawing.Size(494, 29)
Me.pnlImport.TabIndex = 102
'
'PortScan
'
Me.AcceptButton = Me.btnImport
Me.ClientSize = New System.Drawing.Size(518, 328)
Me.Controls.Add(Me.pnlImport)
Me.Controls.Add(Me.lvHosts)
Me.Controls.Add(Me.pnlPorts)
Me.Controls.Add(Me.prgBar)
Me.Controls.Add(Me.btnScan)
Me.Controls.Add(Me.lblEndIP)
Me.Controls.Add(Me.lblStartIP)
Me.Controls.Add(Me.ipEnd)
Me.Controls.Add(Me.ipStart)
Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "PortScan"
Me.TabText = "Port Scan"
Me.Text = "Port Scan"
Me.pnlPorts.ResumeLayout(False)
Me.pnlPorts.PerformLayout()
CType(Me.portEnd, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.portStart, System.ComponentModel.ISupportInitialize).EndInit()
Me.pnlImport.ResumeLayout(False)
Me.pnlImport.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents pnlImport As System.Windows.Forms.Panel
#End Region
End Class
End Namespace
End Namespace

View File

@@ -1,416 +1,78 @@
Imports WeifenLuo.WinFormsUI.Docking
Imports mRemoteNG.Tools.PortScan
Imports mRemoteNG.My
Imports WeifenLuo.WinFormsUI.Docking
Imports mRemoteNG.App.Runtime
Namespace UI
Namespace Window
Public Class PortScan
Inherits UI.Window.Base
#Region "Form Init"
Friend WithEvents lblEndIP As System.Windows.Forms.Label
Friend WithEvents lblStartIP As System.Windows.Forms.Label
Friend WithEvents btnScan As System.Windows.Forms.Button
Friend WithEvents pnlDivider As System.Windows.Forms.Panel
Friend WithEvents ipEnd As IPTextBox.IPTextBox
Friend WithEvents splContainer As System.Windows.Forms.SplitContainer
Friend WithEvents lvHosts As System.Windows.Forms.ListView
Friend WithEvents clmHost As System.Windows.Forms.ColumnHeader
Friend WithEvents clmSSH As System.Windows.Forms.ColumnHeader
Friend WithEvents clmTelnet As System.Windows.Forms.ColumnHeader
Friend WithEvents clmHTTP As System.Windows.Forms.ColumnHeader
Friend WithEvents clmHTTPS As System.Windows.Forms.ColumnHeader
Friend WithEvents clmRlogin As System.Windows.Forms.ColumnHeader
Friend WithEvents clmRDP As System.Windows.Forms.ColumnHeader
Friend WithEvents clmVNC As System.Windows.Forms.ColumnHeader
Friend WithEvents clmOpenPorts As System.Windows.Forms.ColumnHeader
Friend WithEvents clmClosedPorts As System.Windows.Forms.ColumnHeader
Friend WithEvents prgBar As System.Windows.Forms.ProgressBar
Friend WithEvents lblOnlyImport As System.Windows.Forms.Label
Friend WithEvents cbProtocol As System.Windows.Forms.ComboBox
Friend WithEvents pnlPorts As System.Windows.Forms.Panel
Friend WithEvents portEnd As System.Windows.Forms.NumericUpDown
Friend WithEvents portStart As System.Windows.Forms.NumericUpDown
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents btnImport As System.Windows.Forms.Button
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents ipStart As IPTextBox.IPTextBox
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(PortScan))
Me.ipStart = New IPTextBox.IPTextBox()
Me.ipEnd = New IPTextBox.IPTextBox()
Me.lblStartIP = New System.Windows.Forms.Label()
Me.lblEndIP = New System.Windows.Forms.Label()
Me.btnScan = New System.Windows.Forms.Button()
Me.pnlDivider = New System.Windows.Forms.Panel()
Me.splContainer = New System.Windows.Forms.SplitContainer()
Me.lvHosts = New System.Windows.Forms.ListView()
Me.btnCancel = New System.Windows.Forms.Button()
Me.btnImport = New System.Windows.Forms.Button()
Me.cbProtocol = New System.Windows.Forms.ComboBox()
Me.lblOnlyImport = New System.Windows.Forms.Label()
Me.clmHost = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmSSH = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmTelnet = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmHTTP = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmHTTPS = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmRlogin = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmRDP = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmVNC = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmOpenPorts = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.clmClosedPorts = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.prgBar = New System.Windows.Forms.ProgressBar()
Me.pnlPorts = New System.Windows.Forms.Panel()
Me.portEnd = New System.Windows.Forms.NumericUpDown()
Me.portStart = New System.Windows.Forms.NumericUpDown()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.splContainer.Panel1.SuspendLayout()
Me.splContainer.Panel2.SuspendLayout()
Me.splContainer.SuspendLayout()
Me.pnlPorts.SuspendLayout()
CType(Me.portEnd, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.portStart, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'ipStart
'
Me.ipStart.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.ipStart.Location = New System.Drawing.Point(7, 24)
Me.ipStart.Name = "ipStart"
Me.ipStart.Size = New System.Drawing.Size(113, 20)
Me.ipStart.TabIndex = 10
'
'ipEnd
'
Me.ipEnd.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.ipEnd.Location = New System.Drawing.Point(133, 24)
Me.ipEnd.Name = "ipEnd"
Me.ipEnd.Size = New System.Drawing.Size(113, 20)
Me.ipEnd.TabIndex = 15
'
'lblStartIP
'
Me.lblStartIP.AutoSize = True
Me.lblStartIP.Location = New System.Drawing.Point(4, 8)
Me.lblStartIP.Name = "lblStartIP"
Me.lblStartIP.Size = New System.Drawing.Size(45, 13)
Me.lblStartIP.TabIndex = 0
Me.lblStartIP.Text = "Start IP:"
'
'lblEndIP
'
Me.lblEndIP.AutoSize = True
Me.lblEndIP.Location = New System.Drawing.Point(130, 8)
Me.lblEndIP.Name = "lblEndIP"
Me.lblEndIP.Size = New System.Drawing.Size(42, 13)
Me.lblEndIP.TabIndex = 5
Me.lblEndIP.Text = "End IP:"
'
'btnScan
'
Me.btnScan.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnScan.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnScan.Image = Global.mRemoteNG.My.Resources.Resources.Search
Me.btnScan.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnScan.Location = New System.Drawing.Point(448, 8)
Me.btnScan.Name = "btnScan"
Me.btnScan.Size = New System.Drawing.Size(86, 58)
Me.btnScan.TabIndex = 20
Me.btnScan.Text = "&Scan"
Me.btnScan.TextAlign = System.Drawing.ContentAlignment.MiddleRight
Me.btnScan.UseVisualStyleBackColor = True
'
'pnlDivider
'
Me.pnlDivider.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.pnlDivider.BackColor = System.Drawing.Color.DimGray
Me.pnlDivider.Location = New System.Drawing.Point(0, 0)
Me.pnlDivider.Name = "pnlDivider"
Me.pnlDivider.Size = New System.Drawing.Size(542, 4)
Me.pnlDivider.TabIndex = 20
'
'splContainer
'
Me.splContainer.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.splContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2
Me.splContainer.IsSplitterFixed = True
Me.splContainer.Location = New System.Drawing.Point(0, 74)
Me.splContainer.Name = "splContainer"
Me.splContainer.Orientation = System.Windows.Forms.Orientation.Horizontal
'
'splContainer.Panel1
'
Me.splContainer.Panel1.Controls.Add(Me.lvHosts)
Me.splContainer.Panel1.Controls.Add(Me.pnlDivider)
'
'splContainer.Panel2
'
Me.splContainer.Panel2.Controls.Add(Me.btnCancel)
Me.splContainer.Panel2.Controls.Add(Me.btnImport)
Me.splContainer.Panel2.Controls.Add(Me.cbProtocol)
Me.splContainer.Panel2.Controls.Add(Me.lblOnlyImport)
Me.splContainer.Size = New System.Drawing.Size(542, 256)
Me.splContainer.SplitterDistance = 213
Me.splContainer.TabIndex = 27
'
'lvHosts
'
Me.lvHosts.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lvHosts.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.lvHosts.FullRowSelect = True
Me.lvHosts.GridLines = True
Me.lvHosts.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable
Me.lvHosts.HideSelection = False
Me.lvHosts.Location = New System.Drawing.Point(0, 7)
Me.lvHosts.Name = "lvHosts"
Me.lvHosts.Size = New System.Drawing.Size(542, 205)
Me.lvHosts.TabIndex = 26
Me.lvHosts.UseCompatibleStateImageBehavior = False
Me.lvHosts.View = System.Windows.Forms.View.Details
'
'btnCancel
'
Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnCancel.Location = New System.Drawing.Point(459, 8)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 111
Me.btnCancel.Text = "&Cancel"
Me.btnCancel.UseVisualStyleBackColor = True
'
'btnImport
'
Me.btnImport.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnImport.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnImport.Location = New System.Drawing.Point(378, 8)
Me.btnImport.Name = "btnImport"
Me.btnImport.Size = New System.Drawing.Size(75, 23)
Me.btnImport.TabIndex = 101
Me.btnImport.Text = "&Import"
Me.btnImport.UseVisualStyleBackColor = True
'
'cbProtocol
'
Me.cbProtocol.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cbProtocol.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.cbProtocol.FormattingEnabled = True
Me.cbProtocol.Items.AddRange(New Object() {"SSH2", "Telnet", "HTTP", "HTTPS", "Rlogin", "RDP", "VNC"})
Me.cbProtocol.Location = New System.Drawing.Point(111, 9)
Me.cbProtocol.Name = "cbProtocol"
Me.cbProtocol.Size = New System.Drawing.Size(122, 21)
Me.cbProtocol.TabIndex = 28
'
'lblOnlyImport
'
Me.lblOnlyImport.AutoSize = True
Me.lblOnlyImport.Location = New System.Drawing.Point(3, 12)
Me.lblOnlyImport.Name = "lblOnlyImport"
Me.lblOnlyImport.Size = New System.Drawing.Size(92, 13)
Me.lblOnlyImport.TabIndex = 1
Me.lblOnlyImport.Text = "Protocol to import:"
'
'clmHost
'
Me.clmHost.Text = "Hostname/IP"
Me.clmHost.Width = 130
'
'clmSSH
'
Me.clmSSH.Text = "SSH"
Me.clmSSH.Width = 50
'
'clmTelnet
'
Me.clmTelnet.Text = "Telnet"
Me.clmTelnet.Width = 50
'
'clmHTTP
'
Me.clmHTTP.Text = "HTTP"
Me.clmHTTP.Width = 50
'
'clmHTTPS
'
Me.clmHTTPS.Text = "HTTPS"
Me.clmHTTPS.Width = 50
'
'clmRlogin
'
Me.clmRlogin.Text = "Rlogin"
Me.clmRlogin.Width = 50
'
'clmRDP
'
Me.clmRDP.Text = "RDP"
Me.clmRDP.Width = 50
'
'clmVNC
'
Me.clmVNC.Text = "VNC"
Me.clmVNC.Width = 50
'
'clmOpenPorts
'
Me.clmOpenPorts.Text = "Open Ports"
Me.clmOpenPorts.Width = 150
'
'clmClosedPorts
'
Me.clmClosedPorts.Text = "Closed Ports"
Me.clmClosedPorts.Width = 150
'
'prgBar
'
Me.prgBar.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.prgBar.Location = New System.Drawing.Point(7, 50)
Me.prgBar.Name = "prgBar"
Me.prgBar.Size = New System.Drawing.Size(432, 16)
Me.prgBar.Step = 1
Me.prgBar.TabIndex = 28
'
'pnlPorts
'
Me.pnlPorts.Controls.Add(Me.portEnd)
Me.pnlPorts.Controls.Add(Me.portStart)
Me.pnlPorts.Controls.Add(Me.Label2)
Me.pnlPorts.Controls.Add(Me.Label1)
Me.pnlPorts.Location = New System.Drawing.Point(268, 7)
Me.pnlPorts.Name = "pnlPorts"
Me.pnlPorts.Size = New System.Drawing.Size(152, 38)
Me.pnlPorts.TabIndex = 18
'
'portEnd
'
Me.portEnd.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.portEnd.Location = New System.Drawing.Point(81, 17)
Me.portEnd.Maximum = New Decimal(New Integer() {65535, 0, 0, 0})
Me.portEnd.Name = "portEnd"
Me.portEnd.Size = New System.Drawing.Size(67, 20)
Me.portEnd.TabIndex = 15
'
'portStart
'
Me.portStart.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.portStart.Location = New System.Drawing.Point(3, 17)
Me.portStart.Maximum = New Decimal(New Integer() {65535, 0, 0, 0})
Me.portStart.Name = "portStart"
Me.portStart.Size = New System.Drawing.Size(67, 20)
Me.portStart.TabIndex = 5
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(78, 1)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(51, 13)
Me.Label2.TabIndex = 10
Me.Label2.Text = "End Port:"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(0, 2)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(54, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Start Port:"
'
'PortScan
'
Me.AcceptButton = Me.btnImport
Me.CancelButton = Me.btnCancel
Me.ClientSize = New System.Drawing.Size(542, 330)
Me.Controls.Add(Me.pnlPorts)
Me.Controls.Add(Me.prgBar)
Me.Controls.Add(Me.splContainer)
Me.Controls.Add(Me.btnScan)
Me.Controls.Add(Me.lblEndIP)
Me.Controls.Add(Me.lblStartIP)
Me.Controls.Add(Me.ipEnd)
Me.Controls.Add(Me.ipStart)
Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "PortScan"
Me.TabText = "Port Scan"
Me.Text = "Port Scan"
Me.splContainer.Panel1.ResumeLayout(False)
Me.splContainer.Panel2.ResumeLayout(False)
Me.splContainer.Panel2.PerformLayout()
Me.splContainer.ResumeLayout(False)
Me.pnlPorts.ResumeLayout(False)
Me.pnlPorts.PerformLayout()
CType(Me.portEnd, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.portStart, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
Inherits Base
#Region "Constructors"
Public Sub New(ByVal panel As DockContent, ByVal import As Boolean)
InitializeComponent()
WindowType = Type.PortScan
DockPnl = panel
_import = import
End Sub
#End Region
#Region "Public Methods"
Public Sub New(ByVal Panel As DockContent, ByVal Mode As Tools.PortScan.PortScanMode)
Me.WindowType = Type.PortScan
Me.DockPnl = Panel
Me.InitializeComponent()
psMode = Mode
End Sub
#Region "Private Properties"
Private ReadOnly Property IpsValid() As Boolean
Get
If String.IsNullOrEmpty(ipStart.Octet1) Then Return False
If String.IsNullOrEmpty(ipStart.Octet2) Then Return False
If String.IsNullOrEmpty(ipStart.Octet3) Then Return False
If String.IsNullOrEmpty(ipStart.Octet4) Then Return False
If String.IsNullOrEmpty(ipEnd.Octet1) Then Return False
If String.IsNullOrEmpty(ipEnd.Octet2) Then Return False
If String.IsNullOrEmpty(ipEnd.Octet3) Then Return False
If String.IsNullOrEmpty(ipEnd.Octet4) Then Return False
Return True
End Get
End Property
#End Region
Private psMode As Tools.PortScan.PortScanMode
Private pScanner As Tools.PortScan.Scanner
Private scanning As Boolean = False
#Region "Private Fields"
Private ReadOnly _import As Boolean
Private _portScanner As Scanner
Private _scanning As Boolean = False
#End Region
#Region "Form Stuff"
Private Sub PortScan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
#Region "Private Methods"
#Region "Event Handlers"
Private Sub PortScan_Load(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.Load
ApplyLanguage()
Try
If psMode = Tools.PortScan.PortScanMode.Normal Then
Me.lvHosts.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clmHost, Me.clmOpenPorts, Me.clmClosedPorts})
pnlPorts.Visible = True
splContainer.Panel2Collapsed = True
Else
Me.lvHosts.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.clmHost, Me.clmSSH, Me.clmTelnet, Me.clmHTTP, Me.clmHTTPS, Me.clmRlogin, Me.clmRDP, Me.clmVNC})
pnlPorts.Visible = False
splContainer.Panel2Collapsed = False
If _import Then
lvHosts.Columns.AddRange(New ColumnHeader() {clmHost, clmSSH, clmTelnet, clmHTTP, clmHTTPS, clmRlogin, clmRDP, clmVNC})
ShowImportControls(True)
cbProtocol.SelectedIndex = 0
Else
lvHosts.Columns.AddRange(New ColumnHeader() {clmHost, clmOpenPorts, clmClosedPorts})
ShowImportControls(False)
End If
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, My.Language.strPortScanCouldNotLoadPanel & vbNewLine & vbNewLine & ex.Message)
MessageCollector.AddExceptionMessage(My.Language.strPortScanCouldNotLoadPanel, ex)
End Try
End Sub
Private Sub ApplyLanguage()
lblStartIP.Text = My.Language.strStartIP & ":"
lblEndIP.Text = My.Language.strEndIP & ":"
btnScan.Text = My.Language.strButtonScan
btnCancel.Text = My.Language.strButtonCancel
btnImport.Text = My.Language.strButtonImport
lblOnlyImport.Text = My.Language.strProtocolToImport & ":"
clmHost.Text = My.Language.strColumnHostnameIP
clmOpenPorts.Text = My.Language.strOpenPorts
clmClosedPorts.Text = My.Language.strClosedPorts
Label2.Text = My.Language.strEndPort & ":"
Label1.Text = My.Language.strStartPort & ":"
TabText = My.Language.strMenuPortScan
Text = My.Language.strMenuPortScan
Private Sub portStart_Enter(sender As System.Object, e As EventArgs) Handles portStart.Enter
portStart.Select(0, portStart.Text.Length)
End Sub
Private Sub btnScan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScan.Click
If scanning = True Then
Private Sub portEnd_Enter(sender As System.Object, e As EventArgs) Handles portEnd.Enter
portEnd.Select(0, portEnd.Text.Length)
End Sub
Private Sub btnScan_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnScan.Click
If _scanning Then
StopScan()
Else
If ipOK() Then
If IpsValid Then
StartScan()
Else
MessageCollector.AddMessage(Messages.MessageClass.WarningMsg, My.Language.strCannotStartPortScan)
@@ -418,138 +80,123 @@ Namespace UI
End If
End Sub
Private Sub btnImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnImport.Click
Dim prot As mRemoteNG.Connection.Protocol.Protocols = Tools.Misc.StringToEnum(GetType(mRemoteNG.Connection.Protocol.Protocols), cbProtocol.SelectedItem)
Private Sub btnImport_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnImport.Click
Dim protocol As mRemoteNG.Connection.Protocol.Protocols = Tools.Misc.StringToEnum(GetType(mRemoteNG.Connection.Protocol.Protocols), cbProtocol.SelectedItem)
Dim arrHosts As New ArrayList
For Each lvItem As ListViewItem In lvHosts.SelectedItems
arrHosts.Add(lvItem.Tag)
Dim hosts As New List(Of ScanHost)
For Each item As ListViewItem In lvHosts.SelectedItems
Dim scanHost As ScanHost = TryCast(item.Tag, ScanHost)
If scanHost IsNot Nothing Then hosts.Add(item.Tag)
Next
App.Runtime.ImportConnectionsFromPortScan(arrHosts, prot)
App.Import.ImportFromPortScan(hosts, protocol)
'Me.DialogResult = System.Windows.Forms.DialogResult.OK
'Me.Close()
End Sub
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Close()
DialogResult = DialogResult.OK
Close()
End Sub
#End Region
#Region "Threading Delegates"
Private Delegate Sub AddListViewItemCB(ByVal Item As ListViewItem)
Private Sub AddListViewItem(ByVal Item As ListViewItem)
If lvHosts.InvokeRequired Then
Dim d As New AddListViewItemCB(AddressOf AddListViewItem)
Me.Invoke(d, New Object() {Item})
Private Sub ApplyLanguage()
lblStartIP.Text = String.Format("{0}:", My.Language.strStartIP)
lblEndIP.Text = String.Format("{0}:", My.Language.strEndIP)
btnScan.Text = My.Language.strButtonScan
btnImport.Text = My.Language.strButtonImport
lblOnlyImport.Text = String.Format("{0}:", My.Language.strProtocolToImport)
clmHost.Text = My.Language.strColumnHostnameIP
clmOpenPorts.Text = My.Language.strOpenPorts
clmClosedPorts.Text = My.Language.strClosedPorts
Label2.Text = String.Format("{0}:", My.Language.strEndPort)
Label1.Text = String.Format("{0}:", My.Language.strStartPort)
TabText = My.Language.strMenuPortScan
Text = My.Language.strMenuPortScan
End Sub
Private Sub ShowImportControls(ByVal controlsVisible As Boolean)
pnlPorts.Visible = controlsVisible
pnlImport.Visible = controlsVisible
If controlsVisible Then
lvHosts.Height = pnlImport.Top - lvHosts.Top
Else
lvHosts.Items.Add(Item)
Item.EnsureVisible()
lvHosts.Height = pnlImport.Bottom - lvHosts.Top
End If
End Sub
Private Delegate Sub SwitchButtonTextCB()
Private Sub SwitchButtonText()
If btnScan.InvokeRequired Then
Dim d As New SwitchButtonTextCB(AddressOf SwitchButtonText)
Me.Invoke(d)
Else
If scanning = True Then
btnScan.Text = My.Language.strButtonStop
Else
btnScan.Text = My.Language.strButtonScan
End If
SetPrgBar(0, 100)
End If
End Sub
Private Delegate Sub SetPrgBarCB(ByVal Value As Integer, ByVal Max As Integer)
Private Sub SetPrgBar(ByVal Value As Integer, ByVal Max As Integer)
If prgBar.InvokeRequired Then
Dim d As New SetPrgBarCB(AddressOf SetPrgBar)
Me.Invoke(d, New Object() {Value, Max})
Else
prgBar.Maximum = Max
prgBar.Value = Value
End If
End Sub
#End Region
#Region "Methods"
Private Sub StartScan()
Try
scanning = True
_scanning = True
SwitchButtonText()
lvHosts.Items.Clear()
Dim ipAddressStart As Net.IPAddress = Net.IPAddress.Parse(ipStart.Text)
Dim ipAddressEnd As Net.IPAddress = Net.IPAddress.Parse(ipEnd.Text)
If psMode = Tools.PortScan.PortScanMode.Import Then
pScanner = New Tools.PortScan.Scanner(ipAddressStart, ipAddressEnd)
If _import Then
_portScanner = New Scanner(ipAddressStart, ipAddressEnd)
Else
pScanner = New Tools.PortScan.Scanner(ipAddressStart, ipAddressEnd, portStart.Value, portEnd.Value)
_portScanner = New Scanner(ipAddressStart, ipAddressEnd, portStart.Value, portEnd.Value)
End If
AddHandler pScanner.BeginHostScan, AddressOf Event_BeginHostScan
AddHandler pScanner.HostScanned, AddressOf Event_HostScanned
AddHandler pScanner.ScanComplete, AddressOf Event_ScanComplete
AddHandler _portScanner.BeginHostScan, AddressOf PortScanner_BeginHostScan
AddHandler _portScanner.HostScanned, AddressOf PortScanner_HostScanned
AddHandler _portScanner.ScanComplete, AddressOf PortScanner_ScanComplete
pScanner.StartScan()
_portScanner.StartScan()
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "StartScan failed (UI.Window.PortScan)" & vbNewLine & ex.Message, True)
End Try
End Sub
Private Sub StopScan()
If pScanner IsNot Nothing Then pScanner.StopScan()
scanning = False
If _portScanner IsNot Nothing Then _portScanner.StopScan()
_scanning = False
SwitchButtonText()
End Sub
Private Function ipOK() As Boolean
If ipStart.Octet1 = "" Then Return False
If ipStart.Octet2 = "" Then Return False
If ipStart.Octet3 = "" Then Return False
If ipStart.Octet4 = "" Then Return False
Private Sub SwitchButtonText()
If _scanning Then
btnScan.Text = My.Language.strButtonStop
Else
btnScan.Text = My.Language.strButtonScan
End If
If ipEnd.Octet1 = "" Then Return False
If ipEnd.Octet2 = "" Then Return False
If ipEnd.Octet3 = "" Then Return False
If ipEnd.Octet4 = "" Then Return False
Return True
End Function
#End Region
#Region "Event Handlers"
Private Sub Event_BeginHostScan(ByVal Host As String)
MessageCollector.AddMessage(Messages.MessageClass.InformationMsg, "Scanning " & Host, True)
prgBar.Maximum = 100
prgBar.Value = 0
End Sub
Private Sub Event_HostScanned(ByVal Host As Tools.PortScan.ScanHost, ByVal AlreadyScanned As Integer, ByVal ToBeScanned As Integer)
MessageCollector.AddMessage(Messages.MessageClass.InformationMsg, "Host scanned " & Host.HostIP, True)
Dim lvI As ListViewItem = Host.ToListViewItem(psMode)
AddListViewItem(lvI)
SetPrgBar(AlreadyScanned, ToBeScanned)
Private Shared Sub PortScanner_BeginHostScan(ByVal host As String)
MessageCollector.AddMessage(Messages.MessageClass.InformationMsg, "Scanning " & host, True)
End Sub
Private Sub Event_ScanComplete(ByVal hosts As List(Of Tools.PortScan.ScanHost))
scanning = False
Private Delegate Sub PortScannerHostScannedDelegate(ByVal host As ScanHost, ByVal scannedCount As Integer, ByVal totalCount As Integer)
Private Sub PortScanner_HostScanned(ByVal host As ScanHost, ByVal scannedCount As Integer, ByVal totalCount As Integer)
If InvokeRequired Then
Invoke(New PortScannerHostScannedDelegate(AddressOf PortScanner_HostScanned), New Object() {host, scannedCount, totalCount})
Return
End If
MessageCollector.AddMessage(Messages.MessageClass.InformationMsg, "Host scanned " & host.HostIp, True)
Dim listViewItem As ListViewItem = host.ToListViewItem(_import)
If listViewItem IsNot Nothing Then
lvHosts.Items.Add(listViewItem)
listViewItem.EnsureVisible()
End If
prgBar.Maximum = totalCount
prgBar.Value = scannedCount
End Sub
Private Delegate Sub PortScannerScanComplete(ByVal hosts As List(Of ScanHost))
Private Sub PortScanner_ScanComplete(ByVal hosts As List(Of ScanHost))
If InvokeRequired Then
Invoke(New PortScannerScanComplete(AddressOf PortScanner_ScanComplete), New Object() {hosts})
Return
End If
MessageCollector.AddMessage(Messages.MessageClass.InformationMsg, Language.strPortScanComplete)
_scanning = False
SwitchButtonText()
MessageCollector.AddMessage(Messages.MessageClass.InformationMsg, "Scan complete!")
End Sub
Private Sub portStart_Enter(sender As System.Object, e As EventArgs) Handles portStart.Enter
portStart.Select(0, portStart.Text.Length)
End Sub
Private Sub portEnd_Enter(sender As System.Object, e As System.EventArgs) Handles portEnd.Enter
portEnd.Select(0, portEnd.Text.Length)
End Sub
#End Region
End Class

View File

@@ -23,11 +23,6 @@
Friend WithEvents cMenTreeDisconnect As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeSep2 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents cMenTreeToolsTransferFile As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeToolsImportExport As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeToolsImportExportExportmRemoteXML As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeToolsImportExportImportmRemoteXML As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeToolsImportExportSep1 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents cMenTreeToolsImportExportImportFromAD As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeToolsSort As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeToolsSortAscending As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeToolsSortDescending As System.Windows.Forms.ToolStripMenuItem
@@ -38,26 +33,19 @@
Friend WithEvents cMenTreeMoveUp As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeMoveDown As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents cMenTreeToolsImportExportImportFromRDPFiles As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeToolsExternalApps As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeDuplicate As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeToolsImportExportImportFromPortScan As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeConnectWithOptionsChoosePanelBeforeConnecting As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeConnectWithOptionsDontConnectToConsoleSession As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenSortAscending As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenAddConnection As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents mMenAddFolder As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeToolsImportExportImportFromRDGFiles As System.Windows.Forms.ToolStripMenuItem
Public WithEvents tvConnections As System.Windows.Forms.TreeView
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim TreeNode1 As System.Windows.Forms.TreeNode = New System.Windows.Forms.TreeNode("Connections")
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Tree))
Me.tvConnections = New System.Windows.Forms.TreeView()
Me.cMenTree = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.cMenTreeAddConnection = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeAddFolder = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeSep1 = New System.Windows.Forms.ToolStripSeparator()
Me.cMenTreeConnect = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeConnectWithOptions = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeConnectWithOptionsConnectToConsoleSession = New System.Windows.Forms.ToolStripMenuItem()
@@ -66,25 +54,26 @@
Me.cMenTreeConnectWithOptionsNoCredentials = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeConnectWithOptionsChoosePanelBeforeConnecting = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeDisconnect = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeSep2 = New System.Windows.Forms.ToolStripSeparator()
Me.cMenTreeToolsTransferFile = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsImportExport = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsImportExportExportmRemoteXML = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsImportExportImportmRemoteXML = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsImportExportSep1 = New System.Windows.Forms.ToolStripSeparator()
Me.cMenTreeToolsImportExportImportFromAD = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsImportExportImportFromPortScan = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsImportExportImportFromRDPFiles = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsImportExportImportFromRDGFiles = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsSort = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsSortAscending = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsSortDescending = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeSep1 = New System.Windows.Forms.ToolStripSeparator()
Me.cMenTreeToolsExternalApps = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeSep3 = New System.Windows.Forms.ToolStripSeparator()
Me.cMenTreeToolsTransferFile = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeSep2 = New System.Windows.Forms.ToolStripSeparator()
Me.cMenTreeDuplicate = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeRename = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeDelete = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeSep3 = New System.Windows.Forms.ToolStripSeparator()
Me.cMenTreeImport = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeImportFile = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeImportActiveDirectory = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeImportPortScan = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeExportFile = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeSep4 = New System.Windows.Forms.ToolStripSeparator()
Me.cMenTreeAddConnection = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeAddFolder = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
Me.cMenTreeToolsSort = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsSortAscending = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeToolsSortDescending = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeMoveUp = New System.Windows.Forms.ToolStripMenuItem()
Me.cMenTreeMoveDown = New System.Windows.Forms.ToolStripMenuItem()
Me.imgListTree = New System.Windows.Forms.ImageList(Me.components)
@@ -128,29 +117,10 @@
'cMenTree
'
Me.cMenTree.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cMenTree.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cMenTreeAddConnection, Me.cMenTreeAddFolder, Me.cMenTreeSep1, Me.cMenTreeConnect, Me.cMenTreeConnectWithOptions, Me.cMenTreeDisconnect, Me.cMenTreeSep2, Me.cMenTreeToolsTransferFile, Me.cMenTreeToolsImportExport, Me.cMenTreeToolsSort, Me.cMenTreeToolsExternalApps, Me.cMenTreeSep3, Me.cMenTreeDuplicate, Me.cMenTreeRename, Me.cMenTreeDelete, Me.cMenTreeSep4, Me.cMenTreeMoveUp, Me.cMenTreeMoveDown})
Me.cMenTree.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cMenTreeConnect, Me.cMenTreeConnectWithOptions, Me.cMenTreeDisconnect, Me.cMenTreeSep1, Me.cMenTreeToolsExternalApps, Me.cMenTreeToolsTransferFile, Me.cMenTreeSep2, Me.cMenTreeDuplicate, Me.cMenTreeRename, Me.cMenTreeDelete, Me.cMenTreeSep3, Me.cMenTreeImport, Me.cMenTreeExportFile, Me.cMenTreeSep4, Me.cMenTreeAddConnection, Me.cMenTreeAddFolder, Me.ToolStripSeparator1, Me.cMenTreeToolsSort, Me.cMenTreeMoveUp, Me.cMenTreeMoveDown})
Me.cMenTree.Name = "cMenTree"
Me.cMenTree.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional
Me.cMenTree.Size = New System.Drawing.Size(187, 358)
'
'cMenTreeAddConnection
'
Me.cMenTreeAddConnection.Image = Global.mRemoteNG.My.Resources.Resources.Connection_Add
Me.cMenTreeAddConnection.Name = "cMenTreeAddConnection"
Me.cMenTreeAddConnection.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeAddConnection.Text = "New Connection"
'
'cMenTreeAddFolder
'
Me.cMenTreeAddFolder.Image = Global.mRemoteNG.My.Resources.Resources.Folder_Add
Me.cMenTreeAddFolder.Name = "cMenTreeAddFolder"
Me.cMenTreeAddFolder.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeAddFolder.Text = "New Folder"
'
'cMenTreeSep1
'
Me.cMenTreeSep1.Name = "cMenTreeSep1"
Me.cMenTreeSep1.Size = New System.Drawing.Size(183, 6)
Me.cMenTree.Size = New System.Drawing.Size(187, 386)
'
'cMenTreeConnect
'
@@ -211,92 +181,10 @@
Me.cMenTreeDisconnect.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeDisconnect.Text = "Disconnect"
'
'cMenTreeSep2
'cMenTreeSep1
'
Me.cMenTreeSep2.Name = "cMenTreeSep2"
Me.cMenTreeSep2.Size = New System.Drawing.Size(183, 6)
'
'cMenTreeToolsTransferFile
'
Me.cMenTreeToolsTransferFile.Image = Global.mRemoteNG.My.Resources.Resources.SSHTransfer
Me.cMenTreeToolsTransferFile.Name = "cMenTreeToolsTransferFile"
Me.cMenTreeToolsTransferFile.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeToolsTransferFile.Text = "Transfer File (SSH)"
'
'cMenTreeToolsImportExport
'
Me.cMenTreeToolsImportExport.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cMenTreeToolsImportExportExportmRemoteXML, Me.cMenTreeToolsImportExportImportmRemoteXML, Me.cMenTreeToolsImportExportSep1, Me.cMenTreeToolsImportExportImportFromAD, Me.cMenTreeToolsImportExportImportFromPortScan, Me.cMenTreeToolsImportExportImportFromRDPFiles, Me.cMenTreeToolsImportExportImportFromRDGFiles})
Me.cMenTreeToolsImportExport.Name = "cMenTreeToolsImportExport"
Me.cMenTreeToolsImportExport.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeToolsImportExport.Text = "Import/Export"
'
'cMenTreeToolsImportExportExportmRemoteXML
'
Me.cMenTreeToolsImportExportExportmRemoteXML.Image = Global.mRemoteNG.My.Resources.Resources.Connections_SaveAs
Me.cMenTreeToolsImportExportExportmRemoteXML.Name = "cMenTreeToolsImportExportExportmRemoteXML"
Me.cMenTreeToolsImportExportExportmRemoteXML.Size = New System.Drawing.Size(204, 22)
Me.cMenTreeToolsImportExportExportmRemoteXML.Text = "Export mRemote XML"
'
'cMenTreeToolsImportExportImportmRemoteXML
'
Me.cMenTreeToolsImportExportImportmRemoteXML.Image = Global.mRemoteNG.My.Resources.Resources.Connections_Load
Me.cMenTreeToolsImportExportImportmRemoteXML.Name = "cMenTreeToolsImportExportImportmRemoteXML"
Me.cMenTreeToolsImportExportImportmRemoteXML.Size = New System.Drawing.Size(204, 22)
Me.cMenTreeToolsImportExportImportmRemoteXML.Text = "Import mRemote XML"
'
'cMenTreeToolsImportExportSep1
'
Me.cMenTreeToolsImportExportSep1.Name = "cMenTreeToolsImportExportSep1"
Me.cMenTreeToolsImportExportSep1.Size = New System.Drawing.Size(201, 6)
'
'cMenTreeToolsImportExportImportFromAD
'
Me.cMenTreeToolsImportExportImportFromAD.Image = Global.mRemoteNG.My.Resources.Resources.ActiveDirectory
Me.cMenTreeToolsImportExportImportFromAD.Name = "cMenTreeToolsImportExportImportFromAD"
Me.cMenTreeToolsImportExportImportFromAD.Size = New System.Drawing.Size(204, 22)
Me.cMenTreeToolsImportExportImportFromAD.Text = "Import from Active Directory"
'
'cMenTreeToolsImportExportImportFromPortScan
'
Me.cMenTreeToolsImportExportImportFromPortScan.Image = Global.mRemoteNG.My.Resources.Resources.PortScan
Me.cMenTreeToolsImportExportImportFromPortScan.Name = "cMenTreeToolsImportExportImportFromPortScan"
Me.cMenTreeToolsImportExportImportFromPortScan.Size = New System.Drawing.Size(204, 22)
Me.cMenTreeToolsImportExportImportFromPortScan.Text = "Import from Port Scan"
'
'cMenTreeToolsImportExportImportFromRDPFiles
'
Me.cMenTreeToolsImportExportImportFromRDPFiles.Image = Global.mRemoteNG.My.Resources.Resources.RDP
Me.cMenTreeToolsImportExportImportFromRDPFiles.Name = "cMenTreeToolsImportExportImportFromRDPFiles"
Me.cMenTreeToolsImportExportImportFromRDPFiles.Size = New System.Drawing.Size(204, 22)
Me.cMenTreeToolsImportExportImportFromRDPFiles.Text = "Import from .RDP file(s)"
'
'cMenTreeToolsImportExportImportFromRDGFiles
'
Me.cMenTreeToolsImportExportImportFromRDGFiles.Image = CType(resources.GetObject("cMenTreeToolsImportExportImportFromRDGFiles.Image"), System.Drawing.Image)
Me.cMenTreeToolsImportExportImportFromRDGFiles.Name = "cMenTreeToolsImportExportImportFromRDGFiles"
Me.cMenTreeToolsImportExportImportFromRDGFiles.Size = New System.Drawing.Size(204, 22)
Me.cMenTreeToolsImportExportImportFromRDGFiles.Text = "Import from .RDG file(s)"
'
'cMenTreeToolsSort
'
Me.cMenTreeToolsSort.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cMenTreeToolsSortAscending, Me.cMenTreeToolsSortDescending})
Me.cMenTreeToolsSort.Name = "cMenTreeToolsSort"
Me.cMenTreeToolsSort.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeToolsSort.Text = "Sort"
'
'cMenTreeToolsSortAscending
'
Me.cMenTreeToolsSortAscending.Image = Global.mRemoteNG.My.Resources.Resources.Sort_AZ
Me.cMenTreeToolsSortAscending.Name = "cMenTreeToolsSortAscending"
Me.cMenTreeToolsSortAscending.Size = New System.Drawing.Size(157, 22)
Me.cMenTreeToolsSortAscending.Text = "Ascending (A-Z)"
'
'cMenTreeToolsSortDescending
'
Me.cMenTreeToolsSortDescending.Image = Global.mRemoteNG.My.Resources.Resources.Sort_ZA
Me.cMenTreeToolsSortDescending.Name = "cMenTreeToolsSortDescending"
Me.cMenTreeToolsSortDescending.Size = New System.Drawing.Size(157, 22)
Me.cMenTreeToolsSortDescending.Text = "Descending (Z-A)"
Me.cMenTreeSep1.Name = "cMenTreeSep1"
Me.cMenTreeSep1.Size = New System.Drawing.Size(183, 6)
'
'cMenTreeToolsExternalApps
'
@@ -305,10 +193,17 @@
Me.cMenTreeToolsExternalApps.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeToolsExternalApps.Text = "External Applications"
'
'cMenTreeSep3
'cMenTreeToolsTransferFile
'
Me.cMenTreeSep3.Name = "cMenTreeSep3"
Me.cMenTreeSep3.Size = New System.Drawing.Size(183, 6)
Me.cMenTreeToolsTransferFile.Image = Global.mRemoteNG.My.Resources.Resources.SSHTransfer
Me.cMenTreeToolsTransferFile.Name = "cMenTreeToolsTransferFile"
Me.cMenTreeToolsTransferFile.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeToolsTransferFile.Text = "Transfer File (SSH)"
'
'cMenTreeSep2
'
Me.cMenTreeSep2.Name = "cMenTreeSep2"
Me.cMenTreeSep2.Size = New System.Drawing.Size(183, 6)
'
'cMenTreeDuplicate
'
@@ -334,11 +229,87 @@
Me.cMenTreeDelete.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeDelete.Text = "Delete"
'
'cMenTreeSep3
'
Me.cMenTreeSep3.Name = "cMenTreeSep3"
Me.cMenTreeSep3.Size = New System.Drawing.Size(183, 6)
'
'cMenTreeImport
'
Me.cMenTreeImport.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cMenTreeImportFile, Me.cMenTreeImportActiveDirectory, Me.cMenTreeImportPortScan})
Me.cMenTreeImport.Name = "cMenTreeImport"
Me.cMenTreeImport.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeImport.Text = "&Import"
'
'cMenTreeImportFile
'
Me.cMenTreeImportFile.Name = "cMenTreeImportFile"
Me.cMenTreeImportFile.Size = New System.Drawing.Size(213, 22)
Me.cMenTreeImportFile.Text = "Import from &File..."
'
'cMenTreeImportActiveDirectory
'
Me.cMenTreeImportActiveDirectory.Name = "cMenTreeImportActiveDirectory"
Me.cMenTreeImportActiveDirectory.Size = New System.Drawing.Size(213, 22)
Me.cMenTreeImportActiveDirectory.Text = "Import from &Active Directory..."
'
'cMenTreeImportPortScan
'
Me.cMenTreeImportPortScan.Name = "cMenTreeImportPortScan"
Me.cMenTreeImportPortScan.Size = New System.Drawing.Size(213, 22)
Me.cMenTreeImportPortScan.Text = "Import from &Port Scan..."
'
'cMenTreeExportFile
'
Me.cMenTreeExportFile.Name = "cMenTreeExportFile"
Me.cMenTreeExportFile.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeExportFile.Text = "&Export to File..."
'
'cMenTreeSep4
'
Me.cMenTreeSep4.Name = "cMenTreeSep4"
Me.cMenTreeSep4.Size = New System.Drawing.Size(183, 6)
'
'cMenTreeAddConnection
'
Me.cMenTreeAddConnection.Image = Global.mRemoteNG.My.Resources.Resources.Connection_Add
Me.cMenTreeAddConnection.Name = "cMenTreeAddConnection"
Me.cMenTreeAddConnection.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeAddConnection.Text = "New Connection"
'
'cMenTreeAddFolder
'
Me.cMenTreeAddFolder.Image = Global.mRemoteNG.My.Resources.Resources.Folder_Add
Me.cMenTreeAddFolder.Name = "cMenTreeAddFolder"
Me.cMenTreeAddFolder.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeAddFolder.Text = "New Folder"
'
'ToolStripSeparator1
'
Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
Me.ToolStripSeparator1.Size = New System.Drawing.Size(183, 6)
'
'cMenTreeToolsSort
'
Me.cMenTreeToolsSort.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cMenTreeToolsSortAscending, Me.cMenTreeToolsSortDescending})
Me.cMenTreeToolsSort.Name = "cMenTreeToolsSort"
Me.cMenTreeToolsSort.Size = New System.Drawing.Size(186, 22)
Me.cMenTreeToolsSort.Text = "Sort"
'
'cMenTreeToolsSortAscending
'
Me.cMenTreeToolsSortAscending.Image = Global.mRemoteNG.My.Resources.Resources.Sort_AZ
Me.cMenTreeToolsSortAscending.Name = "cMenTreeToolsSortAscending"
Me.cMenTreeToolsSortAscending.Size = New System.Drawing.Size(157, 22)
Me.cMenTreeToolsSortAscending.Text = "Ascending (A-Z)"
'
'cMenTreeToolsSortDescending
'
Me.cMenTreeToolsSortDescending.Image = Global.mRemoteNG.My.Resources.Resources.Sort_ZA
Me.cMenTreeToolsSortDescending.Name = "cMenTreeToolsSortDescending"
Me.cMenTreeToolsSortDescending.Size = New System.Drawing.Size(157, 22)
Me.cMenTreeToolsSortDescending.Text = "Descending (Z-A)"
'
'cMenTreeMoveUp
'
Me.cMenTreeMoveUp.Image = Global.mRemoteNG.My.Resources.Resources.Arrow_Up
@@ -475,6 +446,12 @@
Me.PerformLayout()
End Sub
Friend WithEvents cMenTreeImport As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeExportFile As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents cMenTreeImportFile As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeImportActiveDirectory As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents cMenTreeImportPortScan As System.Windows.Forms.ToolStripMenuItem
#End Region
End Class
End Namespace

View File

@@ -120,22 +120,6 @@
<metadata name="cMenTree.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>208, 19</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cMenTreeToolsImportExportImportFromRDGFiles.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsEAAA7BAbiRa+0AAAIeSURBVDhPjZLfa5JRGMf31/RndFMU0VUXXQTlYjJvGlFQ
UYHsB3OwhtuLC0NSN2maNslyv4K5IhNzujJ/VHs3HZs1lcak6ZUX+em82jvFSfjA930fzuH7eZ5zztPT
HiaTCUV6vZ5/S92F2+1GUTAYJJFIkMvluHPvfncQ1azVaonFYnVzuVyu51c1fYwaHiFJT7BYPFity7hc
UXQ6XROuVjYYDNhstrr54OCAZDJJOPwJ72IQ91oMX0zGs/kLS54mQDlva9uZTIZarYbfv8Byep8JucpT
YfD9hsUKvDiExz/aAKpZqayYq9VqHRBIF3n4DaQ9MP+kXtmUgyEZbs18b0CUz9yc89icz+fxer3ivAss
LSXoi8LdVMM0sgUPvsLNL6Cd3W92oSSKpqetwugT/wDj4+9xOuP0rla4Eobe9YauReByCC55jpoANVSQ
JL1kYuKDuFTxMq8OOf0Gzq/BhbdwZhU0/iNuS/JJgBIOh4NIJILd7mR4+DU3nuc55YWzy3/QB8oYbTL9
/S7OXbx+EjA1JZHNZo8Bo6NLTM6msX4sMz8vMzi4IWZlHY3G0bm6sqiYGwAXqdSOmIUislwUeUYMW5qx
sQ0mJ6Ni1P8DUVUoFKhUKpRKJQHJiqHKCshnzOZ3QuHOADWUTaPxGbu7e2xv7xCPbxEKbbKyEhPdBTvf
QXuonQwNTYlXmRF3YmdgYKQ7c2uooFY1dnp6/gKJVyONqNryJQAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="imgListTree.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>

View File

@@ -21,40 +21,48 @@ Namespace UI
End Sub
Private Sub ApplyLanguage()
cMenTreeAddConnection.Text = Language.strAddConnection
cMenTreeAddFolder.Text = Language.strAddFolder
cMenTreeConnect.Text = Language.strConnect
cMenTreeConnectWithOptions.Text = Language.strConnectWithOptions
cMenTreeConnectWithOptionsConnectToConsoleSession.Text = Language.strConnectToConsoleSession
cMenTreeConnectWithOptionsNoCredentials.Text = Language.strConnectNoCredentials
cMenTreeConnectWithOptionsConnectInFullscreen.Text = Language.strConnectInFullscreen
cMenTreeConnectWithOptionsChoosePanelBeforeConnecting.Text = Language.strChoosePanelBeforeConnecting
cMenTreeDisconnect.Text = Language.strMenuDisconnect
cMenTreeToolsTransferFile.Text = Language.strMenuTransferFile
cMenTreeToolsImportExport.Text = Language.strImportExport
cMenTreeToolsImportExportExportmRemoteXML.Text = Language.strExportmRemoteXML
cMenTreeToolsImportExportImportmRemoteXML.Text = Language.strImportmRemoteXML
cMenTreeToolsImportExportImportFromAD.Text = Language.strImportAD
cMenTreeToolsImportExportImportFromRDPFiles.Text = Language.strImportRDPFiles
cMenTreeToolsImportExportImportFromPortScan.Text = Language.strImportPortScan
cMenTreeToolsSort.Text = Language.strSort
cMenTreeToolsSortAscending.Text = Language.strSortAsc
cMenTreeToolsSortDescending.Text = Language.strSortDesc
cMenTreeToolsExternalApps.Text = Language.strMenuExternalTools
cMenTreeDuplicate.Text = Language.strDuplicate
cMenTreeRename.Text = Language.strRename
cMenTreeDelete.Text = Language.strMenuDelete
cMenTreeMoveUp.Text = Language.strMoveUp
cMenTreeMoveDown.Text = Language.strMoveDown
Text = Language.strConnections
TabText = Language.strConnections
mMenAddConnection.ToolTipText = Language.strAddConnection
mMenAddFolder.ToolTipText = Language.strAddFolder
mMenView.ToolTipText = Language.strMenuView.Replace("&", "")
mMenViewExpandAllFolders.Text = Language.strExpandAllFolders
mMenViewCollapseAllFolders.Text = Language.strCollapseAllFolders
mMenSortAscending.ToolTipText = Language.strSortAsc
cMenTreeConnect.Text = Language.strConnect
cMenTreeConnectWithOptions.Text = Language.strConnectWithOptions
cMenTreeConnectWithOptionsConnectToConsoleSession.Text = Language.strConnectToConsoleSession
cMenTreeConnectWithOptionsDontConnectToConsoleSession.Text = Language.strDontConnectToConsoleSessionMenuItem
cMenTreeConnectWithOptionsConnectInFullscreen.Text = Language.strConnectInFullscreen
cMenTreeConnectWithOptionsNoCredentials.Text = Language.strConnectNoCredentials
cMenTreeConnectWithOptionsChoosePanelBeforeConnecting.Text = Language.strChoosePanelBeforeConnecting
cMenTreeDisconnect.Text = Language.strMenuDisconnect
cMenTreeToolsExternalApps.Text = Language.strMenuExternalTools
cMenTreeToolsTransferFile.Text = Language.strMenuTransferFile
cMenTreeDuplicate.Text = Language.strDuplicate
cMenTreeRename.Text = Language.strRename
cMenTreeDelete.Text = Language.strMenuDelete
cMenTreeImport.Text = Language.strImportMenuItem
cMenTreeImportFile.Text = Language.strImportFromFileMenuItem
cMenTreeImportActiveDirectory.Text = Language.strImportAD
cMenTreeImportPortScan.Text = Language.strImportPortScan
cMenTreeExportFile.Text = Language.strExportToFileMenuItem
cMenTreeAddConnection.Text = Language.strAddConnection
cMenTreeAddFolder.Text = Language.strAddFolder
cMenTreeToolsSort.Text = Language.strSort
cMenTreeToolsSortAscending.Text = Language.strSortAsc
cMenTreeToolsSortDescending.Text = Language.strSortDesc
cMenTreeMoveUp.Text = Language.strMoveUp
cMenTreeMoveDown.Text = Language.strMoveDown
txtSearch.Text = Language.strSearchPrompt
TabText = Language.strConnections
Text = Language.strConnections
End Sub
Public Sub ApplyTheme()
@@ -222,8 +230,6 @@ Namespace UI
If (connectionInfo.Protocol = mRemoteNG.Connection.Protocol.Protocols.IntApp) Then
cMenTreeConnectWithOptionsNoCredentials.Enabled = False
End If
cMenTreeToolsImportExport.Enabled = False
Case mRemoteNG.Tree.Node.Type.PuttySession
Dim puttySessionInfo As mRemoteNG.Connection.PuttySession.Info = selectedNode.Tag
@@ -241,7 +247,6 @@ Namespace UI
cMenTreeConnectWithOptionsConnectInFullscreen.Enabled = False
cMenTreeConnectWithOptionsConnectToConsoleSession.Enabled = False
cMenTreeToolsImportExport.Enabled = False
cMenTreeToolsSort.Enabled = False
cMenTreeDuplicate.Enabled = False
cMenTreeRename.Enabled = False
@@ -288,7 +293,6 @@ Namespace UI
cMenTreeDisconnect.Enabled = False
cMenTreeToolsTransferFile.Enabled = False
cMenTreeConnectWithOptions.Enabled = False
cMenTreeToolsImportExport.Enabled = False
cMenTreeToolsSort.Enabled = False
cMenTreeToolsExternalApps.Enabled = False
cMenTreeDuplicate.Enabled = False
@@ -487,50 +491,6 @@ Namespace UI
SshTransferFile()
End Sub
Private Sub cMenTreeToolsImportExportExportmRemoteXML_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cMenTreeToolsImportExportExportmRemoteXML.Click
ExportXml()
End Sub
Private Sub cMenTreeToolsImportExportImportmRemoteXML_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cMenTreeToolsImportExportImportmRemoteXML.Click
ImportXml()
End Sub
Private Sub cMenTreeToolsImportExportImportFromAD_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cMenTreeToolsImportExportImportFromAD.Click
ImportFromActiveDirectory()
End Sub
Private Shared Sub cMenTreeToolsImportExportImportFromRDPFiles_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cMenTreeToolsImportExportImportFromRDPFiles.Click
ImportFromRdpFiles()
End Sub
Private Sub cMenTreeToolsImportExportImportFromRDGFiles_Click(sender As System.Object, e As EventArgs) Handles cMenTreeToolsImportExportImportFromRDGFiles.Click
Try
Using openFileDialog As New OpenFileDialog()
With openFileDialog
.CheckFileExists = True
.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
.Filter = String.Join("|", {Language.strFilterRdgFiles, "*.rdg", Language.strFilterAll, "*.*"})
.Multiselect = True
End With
If Not openFileDialog.ShowDialog = DialogResult.OK Then Return
Dim rootNode As TreeNode = tvConnections.Nodes(0)
Dim rootInfo As Root.Info = CType(rootNode.Tag, Root.Info)
For Each fileName As String In openFileDialog.FileNames
mRemoteNG.Config.Import.RemoteDesktopConnectionManager.Import(fileName, rootInfo)
Next
End Using
Catch ex As Exception
MessageCollector.AddExceptionMessage("UI.Window.Tree.cMenTreeToolsImportExportImportFromRDGFiles_Click failed.", ex, , True)
End Try
End Sub
Private Sub cMenTreeToolsImportExportImportFromPortScan_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cMenTreeToolsImportExportImportFromPortScan.Click
ImportFromPortScan()
End Sub
Private Sub mMenSortAscending_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles mMenSortAscending.Click
tvConnections.BeginUpdate()
mRemoteNG.Tree.Node.Sort(tvConnections.Nodes.Item(0), SortOrder.Ascending)
@@ -575,6 +535,21 @@ Namespace UI
SaveConnectionsBG()
End Sub
Private Shared Sub cMenTreeImportFile_Click(sender As System.Object, e As EventArgs) Handles cMenTreeImportFile.Click
Import.ImportFromFile(Windows.treeForm.tvConnections.Nodes(0), Windows.treeForm.tvConnections.SelectedNode, True)
End Sub
Private Shared Sub cMenTreeImportActiveDirectory_Click(sender As System.Object, e As EventArgs) Handles cMenTreeImportActiveDirectory.Click
Windows.Show(Type.ActiveDirectoryImport)
End Sub
Private Shared Sub cMenTreeImportPortScan_Click(sender As System.Object, e As EventArgs) Handles cMenTreeImportPortScan.Click
Windows.Show(UI.Window.Type.PortScan, True)
End Sub
Private Shared Sub cMenTreeExportFile_Click(sender As System.Object, e As EventArgs) Handles cMenTreeExportFile.Click
Export.ExportToFile(Windows.treeForm.tvConnections.Nodes(0), Windows.treeForm.tvConnections.SelectedNode)
End Sub
Private Shared Sub cMenTreeMoveUp_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles cMenTreeMoveUp.Click
mRemoteNG.Tree.Node.MoveNodeUp()
SaveConnectionsBG()
@@ -702,57 +677,6 @@ Namespace UI
End Try
End Sub
Private Sub ExportXml()
Try
If tvConnections.SelectedNode IsNot Nothing Then
Windows.exportForm = New Export(Windows.exportPanel, tvConnections.SelectedNode)
Windows.exportPanel = Windows.exportForm
Windows.exportForm.Show(frmMain.pnlDock)
End If
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ExportXml (UI.Window.Tree) failed" & vbNewLine & ex.Message, True)
End Try
End Sub
Private Sub ImportXml()
Try
If tvConnections.SelectedNode IsNot Nothing Then
ImportConnections()
End If
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ImportXML (UI.Window.Tree) failed" & vbNewLine & ex.Message, True)
End Try
End Sub
Private Sub ImportFromActiveDirectory()
Try
If tvConnections.SelectedNode IsNot Nothing Then
Windows.Show(Type.ADImport)
End If
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ImportFromAD (UI.Window.Tree) failed" & vbNewLine & ex.Message, True)
End Try
End Sub
Private Shared Sub ImportFromRdpFiles()
Try
ImportConnectionsRdpFile()
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ImportFromRDPFiles (UI.Window.Tree) failed" & vbNewLine & ex.Message, True)
End Try
End Sub
Private Sub ImportFromPortScan()
Try
If tvConnections.SelectedNode IsNot Nothing Then
Windows.Show(Type.PortScan, Tools.PortScan.PortScanMode.Import)
End If
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ImportFromPortScan (UI.Window.Tree) failed" & vbNewLine & ex.Message, True)
End Try
End Sub
Private Sub AddExternalApps()
Try
'clean up

View File

@@ -8,11 +8,10 @@ Namespace UI
ErrorsAndInfos = 4
ScreenshotManager = 5
Options = 6
Export = 7
About = 8
Update = 9
SSHTransfer = 10
ADImport = 11
ActiveDirectoryImport = 11
Help = 12
ExternalApps = 13
PortScan = 14

View File

@@ -181,12 +181,19 @@
<Compile Include="App\App.Runtime.vb" />
<Compile Include="App\App.SupportedCultures.vb" />
<Compile Include="App\App.Update.vb" />
<Compile Include="App\Export.vb" />
<Compile Include="App\Import.vb" />
<Compile Include="Config\Config.Connections.Load.vb" />
<Compile Include="Config\Config.Connections.Save.vb" />
<Compile Include="Config\Config.Settings.Load.vb" />
<Compile Include="Config\Config.Settings.Providers.vb" />
<Compile Include="Config\Config.Settings.Save.vb" />
<Compile Include="Config\ConfirmClose.vb" />
<Compile Include="Config\Import\ActiveDirectory.vb" />
<Compile Include="Config\Import\mRemoteNG.vb" />
<Compile Include="Config\Import\PortScan.vb" />
<Compile Include="Config\Import\PuttyConnectionManager.vb" />
<Compile Include="Config\Import\RemoteDesktopConnection.vb" />
<Compile Include="Config\Import\RemoteDesktopConnectionManager.vb" />
<Compile Include="Config\Putty\RegistryProvider.vb" />
<Compile Include="Config\Putty\XmingProvider.vb" />
@@ -376,7 +383,10 @@
<Compile Include="UI\UI.Window.About.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\UI.Window.ADImport.vb">
<Compile Include="UI\UI.Window.ActiveDirectoryImport.Designer.vb">
<DependentUpon>UI.Window.ActiveDirectoryImport.vb</DependentUpon>
</Compile>
<Compile Include="UI\UI.Window.ActiveDirectoryImport.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\UI.Window.Announcement.Designer.vb">
@@ -400,8 +410,8 @@
<Compile Include="UI\UI.Window.ErrorsAndInfos.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\UI.Window.Export.Designer.vb">
<DependentUpon>UI.Window.Export.vb</DependentUpon>
<Compile Include="Forms\ExportForm.Designer.vb">
<DependentUpon>ExportForm.vb</DependentUpon>
</Compile>
<Compile Include="UI\UI.Window.ExternalTools.Designer.vb">
<DependentUpon>UI.Window.ExternalTools.vb</DependentUpon>
@@ -413,10 +423,13 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\UI.Window.List.vb" />
<Compile Include="UI\UI.Window.PortScan.Designer.vb">
<DependentUpon>UI.Window.PortScan.vb</DependentUpon>
</Compile>
<Compile Include="UI\UI.Window.PortScan.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\UI.Window.Export.vb">
<Compile Include="Forms\ExportForm.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\UI.Window.ScreenshotManager.vb">
@@ -554,8 +567,8 @@
<DependentUpon>UI.Window.About.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\UI.Window.ADImport.resx">
<DependentUpon>UI.Window.ADImport.vb</DependentUpon>
<EmbeddedResource Include="UI\UI.Window.ActiveDirectoryImport.resx">
<DependentUpon>UI.Window.ActiveDirectoryImport.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\UI.Window.Announcement.resx">
@@ -590,8 +603,8 @@
<DependentUpon>UI.Window.PortScan.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\UI.Window.Export.resx">
<DependentUpon>UI.Window.Export.vb</DependentUpon>
<EmbeddedResource Include="Forms\ExportForm.resx">
<DependentUpon>ExportForm.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\UI.Window.ScreenshotManager.resx">
@@ -796,6 +809,7 @@
<Content Include="Resources\Images_FamFamFam\database.png" />
<Content Include="Resources\Images_FamFamFam\Link.png" />
<Content Include="Resources\Images_FamFamFam\page_copy.png" />
<None Include="Resources\Images\puttycm.png" />
<None Include="Resources\Images_FamFamFam\monitor_go.png" />
<None Include="Resources\Images_FamFamFam\monitor_delete.png" />
<None Include="Resources\Images_FamFamFam\user_comment.png" />
@@ -1162,7 +1176,7 @@
<Folder Include="My Project\DataSources\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\SharedLibraryNG\SharedLibraryNG\SharedLibraryNG.csproj">
<ProjectReference Include="..\SharedLibraryNG\SharedLibraryNG.csproj">
<Project>{0F615504-5F30-4CF2-8341-1DE7FEC95A23}</Project>
<Name>SharedLibraryNG</Name>
</ProjectReference>