├── 1.png
├── 2.png
├── 3.png
├── 4.png
├── 远程桌面管理器
├── logo.ico
├── Resources
│ ├── 右.ico
│ ├── 左.ico
│ ├── logo.ico
│ └── config.wdb
├── bin
│ └── Debug
│ │ ├── Dapper.dll
│ │ ├── 远程桌面管理器.exe
│ │ ├── 远程桌面管理器.pdb
│ │ ├── MSTSCLib.dll
│ │ ├── W3Common.dll
│ │ ├── W3Common.pdb
│ │ ├── MsTscAxWrapper.dll
│ │ ├── 远程桌面管理器.vshost.exe
│ │ ├── Interop.MSTSCLib.dll
│ │ ├── AxInterop.MSTSCLib.dll
│ │ ├── System.Data.SQLite.dll
│ │ ├── 远程桌面管理器.vshost.exe.manifest
│ │ └── Dapper.xml
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── RemoteHost.cs
├── Common.cs
├── IpAddress.cs
├── SqliteHelp.cs
├── Program.cs
├── WHostGroupBox.cs
├── Drag.cs
├── FullScreenForm.Designer.cs
├── User32.cs
├── GDI32.cs
├── db.Designer.cs
├── WHostGroupBox.Designer.cs
├── CursorUtil.cs
├── RemoteForm.cs
├── FullScreenForm.cs
├── DraggableMetroTabControl.cs
├── RemoteForm.resx
├── WHostGroupBox.resx
├── IpAddressForm.resx
├── db.resx
├── IpAddressForm.cs
├── 远程桌面管理器.csproj
├── RemoteForm.Designer.cs
├── MainForm.Designer.cs
├── MainForm.cs
└── IpAddressForm.Designer.cs
├── README.md
├── LICENSE
└── 远程桌面管理器.sln
/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/1.png
--------------------------------------------------------------------------------
/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/2.png
--------------------------------------------------------------------------------
/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/3.png
--------------------------------------------------------------------------------
/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/4.png
--------------------------------------------------------------------------------
/远程桌面管理器/logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/logo.ico
--------------------------------------------------------------------------------
/远程桌面管理器/Resources/右.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/Resources/右.ico
--------------------------------------------------------------------------------
/远程桌面管理器/Resources/左.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/Resources/左.ico
--------------------------------------------------------------------------------
/远程桌面管理器/Resources/logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/Resources/logo.ico
--------------------------------------------------------------------------------
/远程桌面管理器/Resources/config.wdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/Resources/config.wdb
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/Dapper.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/Dapper.dll
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/远程桌面管理器.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/远程桌面管理器.exe
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/远程桌面管理器.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/远程桌面管理器.pdb
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/MSTSCLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/MSTSCLib.dll
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/W3Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/W3Common.dll
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/W3Common.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/W3Common.pdb
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/MsTscAxWrapper.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/MsTscAxWrapper.dll
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/远程桌面管理器.vshost.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/远程桌面管理器.vshost.exe
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/Interop.MSTSCLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/Interop.MSTSCLib.dll
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/AxInterop.MSTSCLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/AxInterop.MSTSCLib.dll
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/System.Data.SQLite.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClockGet/RemoteDesktopManage/HEAD/远程桌面管理器/bin/Debug/System.Data.SQLite.dll
--------------------------------------------------------------------------------
/远程桌面管理器/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/远程桌面管理器/RemoteHost.cs:
--------------------------------------------------------------------------------
1 | namespace 远程桌面管理器
2 | {
3 | public class RemoteHost
4 | {
5 | public int FId { get; set; }
6 | public string FName { get; set; }
7 | public int FParentId { get; set; }
8 | public int FSort { get; set; }
9 |
10 | public IpAddress IpAddress { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/远程桌面管理器/Common.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using System;
4 | using System.Windows.Forms;
5 |
6 | namespace 远程桌面管理器
7 | {
8 | public class Common
9 | {
10 | public static readonly string ConnectionString = string.Format("Data Source={0}{1};Pooling=true;FailIfMissing=false",
11 | Environment.CurrentDirectory, @"\config.wdb");
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | 感谢原作者的无私奉献,只在原作者大量工作的基础上进行了一些小的改动。
3 |
4 | 1.RdpClient默认大小为屏幕的大小,并设置RdpClient为自动调整大小
5 | 
6 |
7 | 2.TabControl设置为可拖动,并仿照QQ聊天框(当然没仿到精髓)拖动时增加界面的截图动画
8 | 
9 |
10 | 3.拖动后如果鼠标坐标在TabControl的标签区域范围内,则交换两个标签位置,否则生成一个新的独立窗口
11 |
12 | 4.独立窗口左上角图标点击后能重新附加到主窗口的TabControl中
13 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
2 | Version 2, December 2004
3 |
4 | Copyright (C) 2014 王俊杰
5 |
6 | Everyone is permitted to copy and distribute verbatim or modified
7 | copies of this license document, and changing it is allowed as long
8 | as the name is changed.
9 |
10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12 |
13 | 0. You just DO WHAT THE FUCK YOU WANT TO.
14 |
--------------------------------------------------------------------------------
/远程桌面管理器/IpAddress.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace 远程桌面管理器
4 | {
5 | public class IpAddress
6 | {
7 | public int FId { get; set; }
8 | public string FIpAddress { get; set; }
9 | public string FIpPort { get; set; }
10 | public string FLoginUser { get; set; }
11 | public string FPassword { get; set; }
12 | public string FFullUrl { get; set; }
13 |
14 | public int Port
15 | {
16 | get { return Convert.ToInt32(FIpPort); }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/远程桌面管理器.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/远程桌面管理器/SqliteHelp.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 | using System.Data.SQLite;
3 |
4 | namespace 远程桌面管理器
5 | {
6 | static partial class SqlMapper
7 | {
8 | public static DataTable GetDataTable(this SQLiteConnection conn, string sql)
9 | {
10 | using (var cmd = conn.CreateCommand())
11 | {
12 | cmd.CommandText = sql;
13 | var adapter = new SQLiteDataAdapter(cmd);
14 | var ds = new DataSet();
15 | adapter.Fill(ds);
16 | return ds.Tables[0];
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/远程桌面管理器/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace 远程桌面管理器
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// 应用程序的主入口点。
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.ThreadException += Application_ThreadException;
20 | Application.Run(new MainForm());
21 | }
22 |
23 | static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
24 | {
25 | MessageBox.Show(e.Exception.Message, "出错啦");
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/远程桌面管理器/WHostGroupBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using Wisder.W3Common.WMetroControl.Drawing.Html;
10 |
11 | namespace 远程桌面管理器
12 | {
13 | public partial class WHostGroupBox : UserControl
14 | {
15 | public WHostGroupBox()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private string _text = "";
21 | [Description("标题信息")]
22 | public new string Text
23 | {
24 | get { return _text; }
25 | set
26 | {
27 | _text = value;
28 | lbText.Text = string.Format("{0}", _text);
29 | }
30 | }
31 |
32 | public void AddControl(Control control)
33 | {
34 | Body.Controls.Add(control);
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/远程桌面管理器.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.21005.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "远程桌面管理器", "远程桌面管理器\远程桌面管理器.csproj", "{5799303C-BC75-453D-8EB4-43673D5DE7EF}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {5799303C-BC75-453D-8EB4-43673D5DE7EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {5799303C-BC75-453D-8EB4-43673D5DE7EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {5799303C-BC75-453D-8EB4-43673D5DE7EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {5799303C-BC75-453D-8EB4-43673D5DE7EF}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/远程桌面管理器/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.18449
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace 远程桌面管理器.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/远程桌面管理器/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("远程桌面管理器")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("远程桌面管理器")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("4bcfa3a5-9fdf-4bbb-b0d7-b7ccbecfc19d")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/远程桌面管理器/Drag.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using System.Windows.Forms;
3 |
4 | namespace 远程桌面管理器
5 | {
6 | public class Drag
7 | {
8 | public static Control Dragged;
9 | static Cursor _move;
10 | public static Cursor DragCursorMove
11 | {
12 | get
13 | {
14 | if(_move==null)
15 | {
16 | using (Bitmap bm = CursorUtil.AsBitmap(Dragged))
17 | {
18 | _move = CursorUtil.CreateCursor((Bitmap)bm.Clone(), 0, 0);
19 | }
20 | }
21 | return _move;
22 | }
23 | }
24 | public static void StartDragging(Control c)
25 | {
26 | Dragged = c;
27 | DisposeOldCursors();
28 | }
29 | public static void StopDragging()
30 | {
31 | Dragged = null;
32 | }
33 | public static void UpdataCursor(object sender, GiveFeedbackEventArgs fea)
34 | {
35 | fea.UseDefaultCursors = false;
36 | if(fea.Effect==DragDropEffects.Move)
37 | {
38 | Cursor.Current = DragCursorMove;
39 | }
40 | }
41 | private static void DisposeOldCursors()
42 | {
43 | if(_move!=null)
44 | {
45 | _move.Dispose();
46 | _move = null;
47 | }
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/远程桌面管理器/FullScreenForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace 远程桌面管理器
2 | {
3 | partial class FullScreenForm
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region 组件设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要修改
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FullScreenForm));
32 | this.SuspendLayout();
33 | //
34 | // FullScreenForm
35 | //
36 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
37 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
38 | this.ClientSize = new System.Drawing.Size(284, 261);
39 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
40 | this.Name = "FullScreenForm";
41 | this.ResumeLayout(false);
42 |
43 | }
44 |
45 | #endregion
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/远程桌面管理器/User32.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 | using System.Text;
7 |
8 | namespace 远程桌面管理器
9 | {
10 | public struct RECT
11 | {
12 | public int Left;
13 | public int Top;
14 | public int Right;
15 | public int Bottom;
16 | }
17 | public class User32
18 | {
19 | [DllImport("user32.dll")]
20 | public static extern IntPtr CreateIconIndirect(ref IconInfo icon);
21 |
22 | [DllImport("user32.dll")]
23 | [return: MarshalAs(UnmanagedType.Bool)]
24 | public static extern bool GetIconInfo(IntPtr hIcon, ref IconInfo pIconInfo);
25 |
26 |
27 |
28 | [DllImport("user32.dll", CharSet = CharSet.Auto)]
29 | public extern static bool DestroyIcon(IntPtr handle);
30 | [DllImport("user32.dll")]
31 | public static extern IntPtr GetWindowDC(IntPtr hWnd);
32 | [DllImport("user32.dll", SetLastError = true)]
33 | public static extern bool GetWindowRect(IntPtr hwnd, ref RECT lpRect);
34 | [DllImport("user32.dll")]
35 | public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDc);
36 | [DllImport("user32.dll")]
37 | [return: MarshalAs(UnmanagedType.Bool)]
38 | public static extern bool IsWindowVisible(IntPtr hWnd);
39 | [DllImport("user32.dll", EntryPoint = "ShowWindow")]
40 | public static extern Int32 ShowWindow(Int32 hwnd, Int32 nCmdShow);
41 | public const Int32 SW_SHOW = 5; public const Int32 SW_HIDE = 0;
42 |
43 | [DllImport("user32.dll", EntryPoint = "SystemParametersInfo")]
44 | public static extern Int32 SystemParametersInfo(Int32 uAction, Int32 uParam, ref Rectangle lpvParam, Int32 fuWinIni);
45 | public const Int32 SPIF_UPDATEINIFILE = 0x1;
46 | public const Int32 SPI_SETWORKAREA = 47;
47 | public const Int32 SPI_GETWORKAREA = 48;
48 |
49 | [DllImport("user32.dll", EntryPoint = "FindWindow")]
50 | public static extern Int32 FindWindow(string lpClassName, string lpWindowName);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/远程桌面管理器/GDI32.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace 远程桌面管理器
5 | {
6 | public enum TernaryRasterOperations : uint
7 | {
8 | /// dest = source
9 | SRCCOPY = 0x00CC0020,
10 | /// dest = source OR dest
11 | SRCPAINT = 0x00EE0086,
12 | /// dest = source AND dest
13 | SRCAND = 0x008800C6,
14 | /// dest = source XOR dest
15 | SRCINVERT = 0x00660046,
16 | /// dest = source AND (NOT dest)
17 | SRCERASE = 0x00440328,
18 | /// dest = (NOT source)
19 | NOTSRCCOPY = 0x00330008,
20 | /// dest = (NOT src) AND (NOT dest)
21 | NOTSRCERASE = 0x001100A6,
22 | /// dest = (source AND pattern)
23 | MERGECOPY = 0x00C000CA,
24 | /// dest = (NOT source) OR dest
25 | MERGEPAINT = 0x00BB0226,
26 | /// dest = pattern
27 | PATCOPY = 0x00F00021,
28 | /// dest = DPSnoo
29 | PATPAINT = 0x00FB0A09,
30 | /// dest = pattern XOR dest
31 | PATINVERT = 0x005A0049,
32 | /// dest = (NOT dest)
33 | DSTINVERT = 0x00550009,
34 | /// dest = BLACK
35 | BLACKNESS = 0x00000042,
36 | /// dest = WHITE
37 | WHITENESS = 0x00FF0062,
38 | ///
39 | /// Capture window as seen on screen. This includes layered windows
40 | /// such as WPF windows with AllowsTransparency="true"
41 | ///
42 | CAPTUREBLT = 0x40000000
43 | }
44 | public class GDI32
45 | {
46 | [DllImport("gdi32.dll")]
47 | public static extern bool DeleteObject(IntPtr handle);
48 | [DllImport("gdi32.dll", EntryPoint = "CreateCompatibleDC", SetLastError = true)]
49 | public static extern IntPtr CreateCompatibleDC([In] IntPtr hdc);
50 | [DllImport("gdi32.dll", EntryPoint = "CreateCompatibleBitmap")]
51 | public static extern IntPtr CreateCompatibleBitmap([In] IntPtr hdc, int nWidth, int nHeight);
52 | [DllImport("gdi32.dll", EntryPoint = "SelectObject")]
53 | public static extern IntPtr SelectObject([In] IntPtr hdc, [In] IntPtr hgdiobj);
54 | [DllImport("gdi32.dll", EntryPoint = "BitBlt", SetLastError = true)]
55 | [return: MarshalAs(UnmanagedType.Bool)]
56 | public static extern bool BitBlt([In] IntPtr hdc, int nXDest, int nYDest, int nWidth, int nHeight, [In] IntPtr hdcSrc, int nXSrc, int nYSrc, TernaryRasterOperations dwRop);
57 | [DllImport("gdi32.dll", EntryPoint = "DeleteDC")]
58 | public static extern bool DeleteDC([In] IntPtr hdc);
59 |
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/远程桌面管理器/db.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.18449
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace 远程桌面管理器 {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class db {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal db() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("远程桌面管理器.db", typeof(db).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 使用此强类型资源类,为所有资源查找
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// 查找 System.Byte[] 类型的本地化资源。
65 | ///
66 | internal static byte[] config {
67 | get {
68 | object obj = ResourceManager.GetObject("config", resourceCulture);
69 | return ((byte[])(obj));
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/远程桌面管理器/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.18449
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace 远程桌面管理器.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// 一个强类型的资源类,用于查找本地化的字符串等。
17 | ///
18 | // 此类是由 StronglyTypedResourceBuilder
19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
21 | // (以 /str 作为命令选项),或重新生成 VS 项目。
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// 返回此类使用的缓存的 ResourceManager 实例。
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("远程桌面管理器.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// 使用此强类型资源类,为所有资源查找
51 | /// 重写当前线程的 CurrentUICulture 属性。
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
65 | ///
66 | internal static System.Drawing.Bitmap 右 {
67 | get {
68 | object obj = ResourceManager.GetObject("右", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// 查找 System.Drawing.Bitmap 类型的本地化资源。
75 | ///
76 | internal static System.Drawing.Bitmap 左 {
77 | get {
78 | object obj = ResourceManager.GetObject("左", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/远程桌面管理器/WHostGroupBox.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace 远程桌面管理器
2 | {
3 | partial class WHostGroupBox
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region 组件设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.panelText = new System.Windows.Forms.Panel();
32 | this.htmlLabel2 = new Wisder.W3Common.WMetroControl.Drawing.Html.HtmlLabel();
33 | this.Body = new System.Windows.Forms.FlowLayoutPanel();
34 | this.lbText = new Wisder.W3Common.WMetroControl.Drawing.Html.HtmlLabel();
35 | this.panelText.SuspendLayout();
36 | this.SuspendLayout();
37 | //
38 | // panelText
39 | //
40 | this.panelText.Controls.Add(this.lbText);
41 | this.panelText.Dock = System.Windows.Forms.DockStyle.Top;
42 | this.panelText.Font = new System.Drawing.Font("微软雅黑", 11F);
43 | this.panelText.Location = new System.Drawing.Point(0, 0);
44 | this.panelText.Name = "panelText";
45 | this.panelText.Size = new System.Drawing.Size(306, 30);
46 | this.panelText.TabIndex = 0;
47 | //
48 | // htmlLabel2
49 | //
50 | this.htmlLabel2.AutoScroll = true;
51 | this.htmlLabel2.AutoScrollMinSize = new System.Drawing.Size(10, 0);
52 | this.htmlLabel2.AutoSize = false;
53 | this.htmlLabel2.BackColor = System.Drawing.SystemColors.Window;
54 | this.htmlLabel2.Dock = System.Windows.Forms.DockStyle.Left;
55 | this.htmlLabel2.Font = new System.Drawing.Font("微软雅黑", 11F);
56 | this.htmlLabel2.Location = new System.Drawing.Point(0, 30);
57 | this.htmlLabel2.Name = "htmlLabel2";
58 | this.htmlLabel2.Size = new System.Drawing.Size(31, 94);
59 | this.htmlLabel2.TabIndex = 1;
60 | //
61 | // Body
62 | //
63 | this.Body.Dock = System.Windows.Forms.DockStyle.Fill;
64 | this.Body.Location = new System.Drawing.Point(31, 30);
65 | this.Body.Name = "Body";
66 | this.Body.Size = new System.Drawing.Size(275, 94);
67 | this.Body.TabIndex = 2;
68 | //
69 | // lbText
70 | //
71 | this.lbText.AutoScrollMinSize = new System.Drawing.Size(101, 30);
72 | this.lbText.AutoSize = false;
73 | this.lbText.BackColor = System.Drawing.SystemColors.Window;
74 | this.lbText.Dock = System.Windows.Forms.DockStyle.Fill;
75 | this.lbText.Font = new System.Drawing.Font("微软雅黑", 11F);
76 | this.lbText.Location = new System.Drawing.Point(0, 0);
77 | this.lbText.Name = "lbText";
78 | this.lbText.Size = new System.Drawing.Size(306, 30);
79 | this.lbText.TabIndex = 1;
80 | this.lbText.Text = "测试分组名称";
81 | //
82 | // WHostGroupBox
83 | //
84 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
85 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
86 | this.Controls.Add(this.Body);
87 | this.Controls.Add(this.htmlLabel2);
88 | this.Controls.Add(this.panelText);
89 | this.Name = "WHostGroupBox";
90 | this.Size = new System.Drawing.Size(306, 124);
91 | this.panelText.ResumeLayout(false);
92 | this.ResumeLayout(false);
93 |
94 | }
95 |
96 | #endregion
97 |
98 | private System.Windows.Forms.Panel panelText;
99 | private Wisder.W3Common.WMetroControl.Drawing.Html.HtmlLabel htmlLabel2;
100 | private System.Windows.Forms.FlowLayoutPanel Body;
101 | private Wisder.W3Common.WMetroControl.Drawing.Html.HtmlLabel lbText;
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/远程桌面管理器/CursorUtil.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Drawing.Imaging;
4 | using System.Windows.Forms;
5 |
6 | namespace 远程桌面管理器
7 | {
8 | extern alias wrapper;
9 | public struct IconInfo
10 | {
11 | public bool fIcon;
12 | public int xHotspot;
13 | public int yHotspot;
14 | public IntPtr hbmMask;
15 | public IntPtr hbmColor;
16 | }
17 |
18 | public class CursorUtil
19 | {
20 | // Based on the article and comments here:
21 | // http://www.switchonthecode.com/tutorials/csharp-tutorial-how-to-use-custom-cursors
22 | // Note that the returned Cursor must be disposed of after use, or you'll leak memory!
23 | public static Cursor CreateCursor(Bitmap bm, int xHotspot, int yHotspot)
24 | {
25 | IntPtr cursorPtr;
26 | IntPtr ptr = bm.GetHicon();
27 | IconInfo tmp = new IconInfo();
28 | User32.GetIconInfo(ptr, ref tmp);
29 | tmp.xHotspot = xHotspot;
30 | tmp.yHotspot = yHotspot;
31 | tmp.fIcon = false;
32 | cursorPtr = User32.CreateIconIndirect(ref tmp);
33 |
34 | if (tmp.hbmColor != IntPtr.Zero) GDI32.DeleteObject(tmp.hbmColor);
35 | if (tmp.hbmMask != IntPtr.Zero) GDI32.DeleteObject(tmp.hbmMask);
36 | if (ptr != IntPtr.Zero) User32.DestroyIcon(ptr);
37 |
38 | return new Cursor(cursorPtr);
39 | }
40 | static readonly int destHeight = 500;
41 | static readonly int destWidth = 500;
42 | public static Bitmap AsBitmap(Control c)
43 | {
44 | int sw = 0, sh = 0;
45 | int sWidth = c.Width;
46 | int sHeight = c.Height;
47 |
48 | if (sHeight > destHeight || sWidth > destWidth)
49 | {
50 | if ((sWidth * destHeight) > (sHeight * destWidth))
51 | {
52 | sw = destWidth;
53 | sh = (destWidth * sHeight) / sWidth;
54 | }
55 | else
56 | {
57 | sh = destHeight;
58 | sw = (sWidth * destHeight) / sHeight;
59 | }
60 | }
61 | else
62 | {
63 | sw = sWidth;
64 | sh = sHeight;
65 | }
66 |
67 | using (Bitmap bm = new Bitmap(c.Width, c.Height))
68 | {
69 | using (Graphics g = Graphics.FromImage(bm))
70 | {
71 | g.CopyFromScreen(c.PointToScreen(Point.Empty), Point.Empty, c.Size-new Size(18,18));//减去滚动条占得大小
72 | }
73 | //c.DrawToBitmap(bm, new Rectangle(0, 0, c.Width, c.Height));
74 | Bitmap bmp = new Bitmap(sw, sh);
75 | //bm.MakeTransparent();
76 | using (Graphics gfx = Graphics.FromImage(bmp))
77 | {
78 | ColorMatrix matrix = new ColorMatrix();
79 | matrix.Matrix33 = 0.6f;
80 | using (ImageAttributes attributes = new ImageAttributes())
81 | {
82 | attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
83 | //gfx.Clear(Color.Transparent);
84 | gfx.DrawImage(bm, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, bm.Width, bm.Height, GraphicsUnit.Pixel, attributes);
85 | }
86 | Rectangle rect = new Rectangle(Point.Empty, Cursors.Default.Size);
87 | Cursors.Default.Draw(gfx, rect);
88 | }
89 | return bmp;
90 | }
91 | }
92 | public static Bitmap CaptureWindow(IntPtr handle)
93 | {
94 | IntPtr hdcSrc = User32.GetWindowDC(handle);
95 | RECT windowRect = new RECT();
96 | User32.GetWindowRect(handle, ref windowRect);
97 | int width = windowRect.Right - windowRect.Left;
98 | int height = windowRect.Bottom - windowRect.Top;
99 | IntPtr hdcDest = GDI32.CreateCompatibleDC(hdcSrc);
100 | IntPtr hBitmap = GDI32.CreateCompatibleBitmap(hdcSrc, width, height);
101 | IntPtr hOld = GDI32.SelectObject(hdcDest, hBitmap);
102 | GDI32.BitBlt(hdcDest, 0, 0, width, height, hdcSrc, 0, 0, TernaryRasterOperations.SRCCOPY);
103 | GDI32.SelectObject(hdcDest, hOld);
104 | GDI32.DeleteDC(hdcDest);
105 | User32.ReleaseDC(handle, hdcSrc);
106 | Bitmap bitmap = Bitmap.FromHbitmap(hBitmap);
107 | GDI32.DeleteObject(hBitmap);
108 | return bitmap;
109 | }
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/远程桌面管理器/RemoteForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 | using System.Data.SQLite;
4 | using System.Drawing;
5 | using System.Linq;
6 | using System.Windows.Forms;
7 | using Dapper;
8 | using Wisder.W3Common.WMetroControl.Controls;
9 | using Wisder.W3Common.WMetroControl.Forms;
10 | using Wisder.W3Common.WMetroControl.MessageBox;
11 |
12 | namespace 远程桌面管理器
13 | {
14 | public partial class RemoteForm : MetroForm
15 | {
16 | public RemoteForm()
17 | {
18 | InitializeComponent();
19 | }
20 |
21 | public RemoteHost RemoteHost { get; set; }
22 |
23 | private bool IsModify { get { return RemoteHost != null; } }
24 |
25 | private void RemoteForm_Load(object sender, System.EventArgs e)
26 | {
27 | //设置主题
28 | cbParent.StyleManager = this.StyleManager;
29 | cbIpAddress.StyleManager = this.StyleManager;
30 | chIsParent.StyleManager = this.StyleManager;
31 | //取消显示上下按钮
32 | numSort.Controls.RemoveAt(0);
33 | //加载下拉框信息
34 | LoadComboBoxInfo();
35 | //是否需要加载信息
36 | if (IsModify)
37 | {
38 | LoadRemoteHost();
39 | }
40 |
41 | txtName.Focus();
42 | }
43 |
44 | private void LoadRemoteHost()
45 | {
46 | lbStatus.Text = "[修改]";
47 | //chIsParent.Checked = RemoteHost.FParentId == 0;//父级暂不支持修改
48 | cbParent.SelectedValue = RemoteHost.FParentId;
49 | cbIpAddress.SelectedValue = RemoteHost.IpAddress.FId;
50 | txtName.Text = RemoteHost.FName;
51 | numSort.Value = RemoteHost.FSort;
52 | }
53 |
54 | private void LoadComboBoxInfo()
55 | {
56 | DataTable dtParent, dtIpAddress;
57 | using (var conn = new SQLiteConnection(Common.ConnectionString))
58 | {
59 | dtParent = conn.GetDataTable("SELECT FId,FName FROM RemoteHost WHERE FParentId=0");
60 | dtIpAddress = conn.GetDataTable("SELECT FId,FFullUrl FROM ConnectLib");
61 | }
62 | //父级下拉框显示
63 | cbParent.DisplayMember = "FName";
64 | cbParent.ValueMember = "FId";
65 | cbParent.DataSource = dtParent;
66 | //IP地址下拉框显示
67 | cbIpAddress.DisplayMember = "FFullUrl";
68 | cbIpAddress.ValueMember = "FId";
69 | cbIpAddress.DataSource = dtIpAddress;
70 | }
71 |
72 | private void cbIsParent_CheckedChanged(object sender, System.EventArgs e)
73 | {
74 | cbParent.Visible = cbIpAddress.Visible = !chIsParent.Checked;
75 | }
76 |
77 | private void btnCancel_Click(object sender, System.EventArgs e)
78 | {
79 | DialogResult = DialogResult.Cancel;
80 | }
81 |
82 | private void btnSave_Click(object sender, System.EventArgs e)
83 | {
84 | if (InfoIsError()) return;
85 |
86 | using (var conn = new SQLiteConnection(Common.ConnectionString))
87 | {
88 | if (IsModify)
89 | {
90 | conn.Execute("UPDATE RemoteHost SET FName=@name,FConectId=@connectId,FParentId=@parentId,FSort=@sort WHERE FId=@id",
91 | new { name = txtName.Text, connectId = cbIpAddress.SelectedValue, parentId = chIsParent.Checked ? 0 : cbParent.SelectedValue, sort = numSort.Text, id = RemoteHost.FId });
92 | }
93 | else
94 | {
95 | conn.Execute("INSERT INTO RemoteHost('FName','FConectId','FParentId','FSort') VALUES(@name,@connectId,@parentId,@sort)",
96 | new { name = txtName.Text, connectId = cbIpAddress.SelectedValue, parentId = chIsParent.Checked ? 0 : cbParent.SelectedValue, sort = numSort.Text });
97 | }
98 | }
99 | DialogResult = DialogResult.OK;
100 | }
101 |
102 | private bool InfoIsError()
103 | {
104 | if (txtName.Text.Trim().Length <= 0)
105 | {
106 | MetroMessageBox.Show(this, "请填写远程主机名称!");
107 | txtName.Focus();
108 | txtName.SelectAll();
109 | return true;
110 | }
111 | if (!chIsParent.Checked)
112 | {
113 | if (cbParent.SelectedIndex < 0)
114 | {
115 | MetroMessageBox.Show(this, "请选择父级信息!");
116 | return true;
117 | }
118 | if (cbIpAddress.SelectedIndex < 0)
119 | {
120 | MetroMessageBox.Show(this, "请选择IP地址信息!");
121 | return true;
122 | }
123 | }
124 | return false;
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/远程桌面管理器/FullScreenForm.cs:
--------------------------------------------------------------------------------
1 | using AxMSTSCLib;
2 | using System;
3 | using System.Diagnostics;
4 | using System.Drawing;
5 | using System.Runtime.InteropServices;
6 | using System.Windows.Forms;
7 | using System.ComponentModel;
8 |
9 | namespace 远程桌面管理器
10 | {
11 | extern alias wrapper;
12 | public partial class FullScreenForm : Form
13 | {
14 | bool m_IsFullScreen = false;
15 | const int WM_NCLBUTTONDBLCLK = 0xA3;
16 | const int WM_NCLBUTTONCLK = 0xA1;
17 | public FullScreenForm()
18 | {
19 | InitializeComponent();
20 | }
21 |
22 | ///
23 | /// 设置全屏或这取消全屏
24 | ///
25 | /// true:全屏 false:恢复
26 | /// 设置的时候,此参数返回原始尺寸,恢复时用此参数设置恢复
27 | /// 设置结果
28 | public Boolean SetFormFullScreen(Boolean fullscreen)//, ref Rectangle rectOld
29 | {
30 | m_IsFullScreen = fullscreen;
31 | Rectangle rectOld = Rectangle.Empty;
32 | //Int32 hwnd = 0;
33 | //hwnd = FindWindow("Shell_TrayWnd", null);//获取任务栏的句柄
34 |
35 | //if (hwnd == 0) return false;
36 |
37 | if (fullscreen)//全屏
38 | {
39 | //ShowWindow(hwnd, SW_HIDE);//隐藏任务栏
40 |
41 | User32.SystemParametersInfo(User32.SPI_GETWORKAREA, 0, ref rectOld, User32.SPIF_UPDATEINIFILE);//get 屏幕范围
42 | Rectangle rectFull = Screen.PrimaryScreen.Bounds;//全屏范围
43 | User32.SystemParametersInfo(User32.SPI_SETWORKAREA, 0, ref rectFull, User32.SPIF_UPDATEINIFILE);//窗体全屏幕显示
44 |
45 | this.FormBorderStyle = FormBorderStyle.None;
46 | this.WindowState = FormWindowState.Maximized;
47 | }
48 | else//还原
49 | {
50 | this.WindowState = FormWindowState.Normal;
51 | this.FormBorderStyle = FormBorderStyle.Sizable;
52 |
53 | //ShowWindow(hwnd, SW_SHOW);//显示任务栏
54 |
55 | User32.SystemParametersInfo(User32.SPI_SETWORKAREA, 0, ref rectOld, User32.SPIF_UPDATEINIFILE);//窗体还原
56 | }
57 | return true;
58 | }
59 | protected override void WndProc(ref Message m)
60 | {
61 | if (m.Msg == WM_NCLBUTTONDBLCLK)
62 | {
63 | m_IsFullScreen = !m_IsFullScreen;
64 | SetFormFullScreen(m_IsFullScreen);
65 | foreach(var control in this.Controls)
66 | {
67 | if (control is AxMsRdpClient7)
68 | {
69 | ((AxMsRdpClient7)control).FullScreen = m_IsFullScreen;
70 | break;
71 | }
72 | }
73 | return;
74 | }
75 | else if (m.Msg == WM_NCLBUTTONCLK)
76 | {
77 | Point mousePoint = new Point((int)m.LParam);
78 | mousePoint.Offset(-this.Left, -this.Top);
79 | if (new Rectangle(0, 0, 32, 32).Contains(mousePoint))
80 | {
81 | var mainForm = this.Owner as MainForm;
82 | if (mainForm != null)
83 | {
84 | mainForm.AttachFromChild(this.Text, this.Controls);
85 | }
86 | this.Hide();
87 | return;
88 | }
89 | }
90 | base.WndProc(ref m);
91 | }
92 | #region 控件事件
93 | //bool mouseDown = true;
94 | //private void FullScreenForm_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
95 | //{
96 | // if (e.KeyCode == Keys.F11)
97 | // {
98 | // m_IsFullScreen = !m_IsFullScreen;
99 | // SetFormFullScreen(m_IsFullScreen);
100 | // e.Handled = true;
101 | // }
102 | // else if (e.KeyCode == Keys.Escape)//esc键盘退出全屏
103 | // {
104 | // if (m_IsFullScreen)
105 | // {
106 | // e.Handled = true;
107 | // this.WindowState = FormWindowState.Normal;//还原
108 | // this.FormBorderStyle = FormBorderStyle.Sizable;
109 | // SetFormFullScreen(false);
110 | // }
111 | // }
112 | //}
113 | //private void FullScreenForm_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
114 | //{
115 | // if (mouseDown)
116 | // {
117 | // Cursor = Cursors.Hand;
118 | // // 获取当前屏幕的光标坐标
119 | // Point pTemp = new Point(Cursor.Position.X, Cursor.Position.Y);
120 | // // 转换成工作区坐标
121 | // pTemp = this.PointToScreen(pTemp);
122 | // this.Location = new Point(pTemp.X - this.Width / 2, pTemp.Y - SystemInformation.CaptionHeight / 2);
123 | // }
124 | //}
125 | //private void FullScreenForm_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
126 | //{
127 | // mouseDown = false;
128 | //}
129 | #endregion
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/远程桌面管理器/DraggableMetroTabControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Windows.Forms;
7 | using Wisder.W3Common.WMetroControl.Controls;
8 |
9 | namespace 远程桌面管理器
10 | {
11 | public class DragDoneEventArgs:EventArgs
12 | {
13 | private int x;
14 | private int y;
15 | private bool leave;
16 | public DragDoneEventArgs(int x,int y,bool leave)
17 | {
18 | this.x = x;
19 | this.y = y;
20 | this.leave = leave;
21 | }
22 | public int X
23 | {
24 | get
25 | {
26 | return x;
27 | }
28 | }
29 | public int Y
30 | {
31 | get
32 | {
33 | return y;
34 | }
35 | }
36 | public bool Leave
37 | {
38 | get
39 | {
40 | return leave;
41 | }
42 | }
43 | }
44 | public delegate void DragDoneHandler(object sender, DragDoneEventArgs args);
45 | public class DraggableMetroTabControl:MetroTabControl
46 | {
47 | private bool mouseDown = false;
48 | private bool isDragged = false;
49 | private Point originPoint;
50 | public event DragDoneHandler DragDone;
51 | public DraggableMetroTabControl()
52 | {
53 | SetStyle(
54 | ControlStyles.AllPaintingInWmPaint //全部在窗口绘制消息中绘图
55 | | ControlStyles.OptimizedDoubleBuffer //使用双缓冲
56 | | ControlStyles.UserPaint
57 | , true);
58 | }
59 | protected override void OnMouseDown(MouseEventArgs e)
60 | {
61 | base.OnMouseDown(e);
62 | if (e.Button == MouseButtons.Left)
63 | {
64 | mouseDown = true;
65 | originPoint = new Point(e.X, e.Y);
66 | }
67 | }
68 | protected override void OnMouseUp(MouseEventArgs e)
69 | {
70 | base.OnMouseUp(e);
71 | mouseDown = false;
72 | if(isDragged)
73 | {
74 | isDragged = false;
75 | bool leave=GetTabPageByTab(new Point(e.X, e.Y)) == null;
76 | DragDone?.Invoke(Drag.Dragged, new DragDoneEventArgs(e.X, e.Y, leave));
77 | }
78 | }
79 | protected override void OnMouseMove(MouseEventArgs e)
80 | {
81 | base.OnMouseMove(e);
82 | var distance = Math.Sqrt(Math.Pow((e.X - originPoint.X), 2) + Math.Pow((e.Y - originPoint.Y), 2));
83 | if(mouseDown && distance>10.0)
84 | {
85 | mouseDown = false;
86 | TabPage tabPage = GetTabPageByTab(new Point(e.X, e.Y));
87 | if (tabPage != null)
88 | {
89 | Drag.StartDragging(tabPage);
90 | isDragged = true;
91 | this.DoDragDrop(tabPage, DragDropEffects.All);
92 | Drag.StopDragging();
93 | }
94 | }
95 |
96 | }
97 | private TabPage GetTabPageByTab(Point point)
98 | {
99 | //排除首页
100 | for (int i = 1; i < this.TabPages.Count; i++)
101 | {
102 | if (GetTabRect(i).Contains(point))
103 | {
104 | return this.TabPages[i];
105 | }
106 | }
107 | return null;
108 | }
109 | protected override void OnDragOver(DragEventArgs drgevent)
110 | {
111 | base.OnDragOver(drgevent);
112 | TabPage source = (TabPage)drgevent.Data.GetData(typeof(TabPage));
113 | if(source!=null)
114 | {
115 | TabPage target = GetTabPageByTab(PointToClient(new Point(drgevent.X, drgevent.Y)));
116 | if(target!=null)
117 | {
118 | drgevent.Effect = DragDropEffects.Move;
119 | MoveTabPage(source, target);
120 | }
121 | else
122 | {
123 | drgevent.Effect = DragDropEffects.Move;
124 | }
125 | }
126 | else
127 | {
128 | drgevent.Effect = DragDropEffects.Move;
129 | }
130 | }
131 | private void MoveTabPage(TabPage source, TabPage target)
132 | {
133 | if (source == target)
134 | return;
135 | int targetIndex = -1;
136 | List lstPages = new List();
137 | for (int i = 0; i < this.TabPages.Count; i++)
138 | {
139 | if (this.TabPages[i] == target)
140 | {
141 | targetIndex = i;
142 | }
143 | if (this.TabPages[i] != source)
144 | {
145 | lstPages.Add(this.TabPages[i]);
146 | }
147 | }
148 | this.TabPages.Clear();
149 | this.TabPages.AddRange(lstPages.ToArray());
150 | this.TabPages.Insert(targetIndex, source);
151 | this.SelectedTab = source;
152 | }
153 | protected override void OnQueryContinueDrag(QueryContinueDragEventArgs qcdevent)
154 | {
155 | base.OnQueryContinueDrag(qcdevent);
156 | Rectangle rect = new Rectangle(this.Location, new Size(this.Width, this.ItemSize.Height));
157 | if (Control.MouseButtons != MouseButtons.Left && !rect.Contains(PointToClient(Control.MousePosition)))
158 | {
159 | qcdevent.Action = DragAction.Cancel;
160 | Point point = PointToClient(Control.MousePosition);
161 | OnMouseUp(new MouseEventArgs(Control.MouseButtons, 0, point.X, point.Y, 0));
162 | }
163 | }
164 | }
165 | }
166 |
--------------------------------------------------------------------------------
/远程桌面管理器/RemoteForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/远程桌面管理器/WHostGroupBox.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/远程桌面管理器/IpAddressForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/远程桌面管理器/db.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | Resources\config.wdb;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
123 |
124 |
--------------------------------------------------------------------------------
/远程桌面管理器/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\右.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Resources\左.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
--------------------------------------------------------------------------------
/远程桌面管理器/IpAddressForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data.SQLite;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Runtime.InteropServices;
6 | using System.Threading;
7 | using System.Windows.Forms;
8 | using Dapper;
9 | using Wisder.W3Common.WMetroControl.Forms;
10 | using Wisder.W3Common.WMetroControl.MessageBox;
11 |
12 | namespace 远程桌面管理器
13 | {
14 | public partial class IpAddressForm : MetroForm
15 | {
16 | public IpAddressForm()
17 | {
18 | InitializeComponent();
19 | }
20 |
21 | private long _modifyId = 0;
22 |
23 | private void IpAddressForm_Load(object sender, System.EventArgs e)
24 | {
25 | panelAdd.Left = Left1;
26 | panelAdd.BringToFront();
27 | //取消显示上下按钮
28 | numPort.Controls.RemoveAt(0);
29 |
30 | grid.StyleManager = this.StyleManager;
31 |
32 | LoadIpInfo();
33 | }
34 | ///
35 | /// 加载地址库信息
36 | ///
37 | private void LoadIpInfo()
38 | {
39 | using (var conn = new SQLiteConnection(Common.ConnectionString))
40 | {
41 | grid.DataSource = conn.GetDataTable("SELECT FId,FFullUrl IP信息 FROM ConnectLib");
42 | }
43 | grid.Columns["FId"].Visible = false;
44 | grid.Columns["IP信息"].Width = grid.Width;
45 | }
46 |
47 | private void btnCancel_Click(object sender, System.EventArgs e)
48 | {
49 | DialogResult = DialogResult.Cancel;
50 | }
51 |
52 | private void btnSave_Click(object sender, System.EventArgs e)
53 | {
54 | if (InfoIsError) return;
55 |
56 | using (var conn = new SQLiteConnection(Common.ConnectionString))
57 | {
58 | if (_modifyId > 0)
59 | {
60 | conn.Execute("UPDATE ConnectLib SET FIpAddress=@ipAddress,FIpPort=@port,FLoginUser=@user,FPassword=@pwd,FFullUrl=@fullUrl WHERE FId=@id",
61 | new { ipAddress = txtIp.Text, port = numPort.Text, user = txtUser.Text, pwd = txtPwd.Text, id = _modifyId,
62 | fullUrl = txtIp.Text + (numPort.Value > 0 ? (":" + numPort.Text) : "") });
63 | }
64 | else
65 | {
66 | conn.Execute(
67 | @"INSERT INTO ConnectLib('FIpAddress','FIpPort','FLoginUser','FPassword','FFullUrl') VALUES (@ipAddress,@port,@user,@pwd,@fullUrl)",
68 | new { ipAddress = txtIp.Text, port = numPort.Text, user = txtUser.Text, pwd = txtPwd.Text,
69 | fullUrl = txtIp.Text + (numPort.Value > 0 ? (":" + numPort.Text) : "")
70 | });
71 | }
72 | }
73 | DialogResult = DialogResult.OK;
74 | }
75 |
76 | private bool InfoIsError
77 | {
78 | get
79 | {
80 | if (txtIp.Text.Trim().Length <= 0)
81 | {
82 | MetroMessageBox.Show(this, "请填写IP地址!");
83 | txtIp.Focus();
84 | txtIp.SelectAll();
85 | return true;
86 | }
87 | if (txtUser.Text.Trim().Length <= 0)
88 | {
89 | MetroMessageBox.Show(this, "请填写登录用户!");
90 | txtUser.Focus();
91 | txtUser.SelectAll();
92 | return true;
93 | }
94 | if (txtPwd.Text.Trim().Length <= 0)
95 | {
96 | MetroMessageBox.Show(this, "请填写登录密码!");
97 | txtPwd.Focus();
98 | txtPwd.SelectAll();
99 | return true;
100 | }
101 | return false;
102 | }
103 | }
104 |
105 | #region 界面切换特效
106 | private void btnShowAdd_Click(object sender, EventArgs e)
107 | {
108 | ShowAdd();
109 | }
110 |
111 | private void btnShowManage_Click(object sender, EventArgs e)
112 | {
113 | ShowManage();
114 | }
115 |
116 | private const int Left1 = -308;
117 | private const int Left2 = 23;
118 | private void ShowAdd()
119 | {
120 | this.BeginInvoke(new Action(() =>
121 | {
122 | while (true)
123 | {
124 | if (panelAdd.Left < Left2)
125 | panelAdd.Left += 4;
126 | else
127 | {
128 | panelAdd.Left = Left2;
129 | break;
130 | }
131 | }
132 | }));
133 | txtIp.Select();
134 | }
135 | private void ShowManage()
136 | {
137 | this.BeginInvoke(new Action(() =>
138 | {
139 | while (true)
140 | {
141 | if (panelAdd.Left > Left1)
142 | panelAdd.Left -= 4;
143 | else
144 | {
145 | panelAdd.Left = Left1;
146 | break;
147 | }
148 | }
149 | }));
150 | }
151 | #endregion
152 |
153 | #region 右键地址库
154 | private void 确认无误删除ToolStripMenuItem_Click(object sender, EventArgs e)
155 | {
156 | using (var conn = new SQLiteConnection(Common.ConnectionString))
157 | {
158 | foreach (DataGridViewRow row in grid.SelectedRows)
159 | {
160 | conn.Execute("DELETE FROM ConnectLib WHERE FId=@id", new { id = row.Cells["FId"].Value });
161 | grid.Rows.Remove(row);
162 | }
163 | }
164 | }
165 |
166 | private void 编辑ToolStripMenuItem_Click(object sender, EventArgs e)
167 | {
168 | if (grid.SelectedRows.Count > 0)
169 | {
170 | var id = grid.SelectedRows[0].Cells["FId"].Value;
171 | LoadIpInfoById(id);
172 | }
173 | }
174 |
175 | private void LoadIpInfoById(object id)
176 | {
177 | _modifyId = Convert.ToInt64(id);
178 | using (var conn = new SQLiteConnection(Common.ConnectionString))
179 | {
180 | var ipInfo = conn.Query("SELECT * FROM ConnectLib WHERE FId=@id", new { id = _modifyId }).FirstOrDefault();
181 | if (ipInfo == null)
182 | {
183 | LoadIpInfo();
184 | return;
185 | }
186 | txtIp.Text = ipInfo.FIpAddress;
187 | numPort.Text = ipInfo.FIpPort;
188 | txtUser.Text = ipInfo.FLoginUser;
189 | txtPwd.Text = ipInfo.FPassword;
190 | }
191 | ShowAdd();
192 | }
193 | #endregion
194 |
195 | private void btnClose_Click(object sender, EventArgs e)
196 | {
197 | this.Close();
198 | }
199 |
200 | private void btnRefresh_Click(object sender, EventArgs e)
201 | {
202 | LoadIpInfo();
203 | }
204 |
205 | #region 回车切换
206 | private void txtIp_KeyDown(object sender, KeyEventArgs e)
207 | {
208 | if (e.KeyCode == Keys.Enter)
209 | {
210 | numPort.Focus();
211 | numPort.Select(0, numPort.Text.Length);
212 | }
213 | }
214 |
215 | private void numPort_KeyDown(object sender, KeyEventArgs e)
216 | {
217 | if (e.KeyCode == Keys.Enter)
218 | {
219 | txtUser.Focus();
220 | txtUser.SelectAll();
221 | }
222 | }
223 |
224 | private void txtUser_KeyDown(object sender, KeyEventArgs e)
225 | {
226 | if (e.KeyCode == Keys.Enter)
227 | {
228 | txtPwd.Focus();
229 | txtPwd.SelectAll();
230 | }
231 | }
232 |
233 | private void txtPwd_KeyDown(object sender, KeyEventArgs e)
234 | {
235 | if (e.KeyCode == Keys.Enter)
236 | {
237 | btnSave.Select();
238 | }
239 | }
240 |
241 | #endregion
242 | }
243 | }
244 |
--------------------------------------------------------------------------------
/远程桌面管理器/远程桌面管理器.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {5799303C-BC75-453D-8EB4-43673D5DE7EF}
8 | WinExe
9 | Properties
10 | 远程桌面管理器
11 | 远程桌面管理器
12 | v4.0
13 | 512
14 | true
15 |
16 |
17 |
18 | x86
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 | false
27 |
28 |
29 | x86
30 | pdbonly
31 | true
32 | bin\Release\
33 | TRACE
34 | prompt
35 | 4
36 | false
37 |
38 |
39 | logo.ico
40 |
41 |
42 |
43 | False
44 | ..\..\..\..\常用的东西\Dapper\Dapper.dll
45 |
46 |
47 | D:\个人习惯\工具\经验\自己的测试\测试远程桌面\WindowsFormsApplication1\bin\Debug\MsTscAxWrapper.dll
48 | wrapper
49 |
50 |
51 | D:\个人习惯\工具\经验\自己的测试\测试远程桌面\WindowsFormsApplication1\bin\Debug\MSTSCLib.dll
52 | True
53 |
54 |
55 |
56 |
57 | False
58 | ..\..\..\..\..\GIT\WLF\WLF\bin\Debug\System.Data.SQLite.dll
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | False
70 | D:\工作\工作计划\W3\W3Common\TestForm\bin\Debug\W3Common.dll
71 |
72 |
73 |
74 |
75 |
76 |
77 | True
78 | True
79 | db.resx
80 |
81 |
82 |
83 |
84 | Form
85 |
86 |
87 | FullScreenForm.cs
88 |
89 |
90 |
91 |
92 | Form
93 |
94 |
95 | IpAddressForm.cs
96 |
97 |
98 | Form
99 |
100 |
101 | MainForm.cs
102 |
103 |
104 |
105 |
106 | Form
107 |
108 |
109 | RemoteForm.cs
110 |
111 |
112 |
113 |
114 |
115 | UserControl
116 |
117 |
118 | WHostGroupBox.cs
119 |
120 |
121 | ResXFileCodeGenerator
122 | db.Designer.cs
123 |
124 |
125 | FullScreenForm.cs
126 |
127 |
128 | IpAddressForm.cs
129 |
130 |
131 | MainForm.cs
132 |
133 |
134 | ResXFileCodeGenerator
135 | Resources.Designer.cs
136 | Designer
137 |
138 |
139 | True
140 | Resources.resx
141 | True
142 |
143 |
144 | RemoteForm.cs
145 |
146 |
147 | WHostGroupBox.cs
148 |
149 |
150 |
151 | SettingsSingleFileGenerator
152 | Settings.Designer.cs
153 |
154 |
155 | True
156 | Settings.settings
157 | True
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 | {8C11EFA1-92C3-11D1-BC1E-00C04FA31489}
174 | 1
175 | 0
176 | 0
177 | aximp
178 | False
179 |
180 |
181 |
182 |
189 |
--------------------------------------------------------------------------------
/远程桌面管理器/RemoteForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace 远程桌面管理器
2 | {
3 | partial class RemoteForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.chIsParent = new Wisder.W3Common.WMetroControl.Controls.MetroToggle();
32 | this.metroLabel1 = new Wisder.W3Common.WMetroControl.Controls.MetroLabel();
33 | this.txtName = new System.Windows.Forms.TextBox();
34 | this.metroLabel3 = new Wisder.W3Common.WMetroControl.Controls.MetroLabel();
35 | this.numSort = new System.Windows.Forms.NumericUpDown();
36 | this.metroLabel2 = new Wisder.W3Common.WMetroControl.Controls.MetroLabel();
37 | this.btnCancel = new Wisder.W3Common.WControl.WButton();
38 | this.btnSave = new Wisder.W3Common.WControl.WButton();
39 | this.cbParent = new Wisder.W3Common.WMetroControl.Controls.MetroComboBox();
40 | this.cbIpAddress = new Wisder.W3Common.WMetroControl.Controls.MetroComboBox();
41 | this.lbStatus = new Wisder.W3Common.WMetroControl.Controls.MetroLabel();
42 | ((System.ComponentModel.ISupportInitialize)(this.numSort)).BeginInit();
43 | this.SuspendLayout();
44 | //
45 | // chIsParent
46 | //
47 | this.chIsParent.DisplayStatus = false;
48 | this.chIsParent.Location = new System.Drawing.Point(112, 80);
49 | this.chIsParent.Name = "chIsParent";
50 | this.chIsParent.Size = new System.Drawing.Size(76, 24);
51 | this.chIsParent.TabIndex = 0;
52 | this.chIsParent.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
53 | this.chIsParent.UseSelectable = true;
54 | this.chIsParent.UseVisualStyleBackColor = true;
55 | this.chIsParent.CheckedChanged += new System.EventHandler(this.cbIsParent_CheckedChanged);
56 | //
57 | // metroLabel1
58 | //
59 | this.metroLabel1.AutoSize = true;
60 | this.metroLabel1.Location = new System.Drawing.Point(28, 81);
61 | this.metroLabel1.Name = "metroLabel1";
62 | this.metroLabel1.Size = new System.Drawing.Size(79, 19);
63 | this.metroLabel1.TabIndex = 1;
64 | this.metroLabel1.Text = "是否为父级";
65 | //
66 | // txtName
67 | //
68 | this.txtName.Location = new System.Drawing.Point(66, 126);
69 | this.txtName.Name = "txtName";
70 | this.txtName.Size = new System.Drawing.Size(122, 21);
71 | this.txtName.TabIndex = 11;
72 | //
73 | // metroLabel3
74 | //
75 | this.metroLabel3.AutoSize = true;
76 | this.metroLabel3.Location = new System.Drawing.Point(28, 126);
77 | this.metroLabel3.Name = "metroLabel3";
78 | this.metroLabel3.Size = new System.Drawing.Size(37, 19);
79 | this.metroLabel3.TabIndex = 10;
80 | this.metroLabel3.Text = "名称";
81 | //
82 | // numSort
83 | //
84 | this.numSort.InterceptArrowKeys = false;
85 | this.numSort.Location = new System.Drawing.Point(66, 167);
86 | this.numSort.Maximum = new decimal(new int[] {
87 | 1000,
88 | 0,
89 | 0,
90 | 0});
91 | this.numSort.Name = "numSort";
92 | this.numSort.Size = new System.Drawing.Size(122, 21);
93 | this.numSort.TabIndex = 13;
94 | this.numSort.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
95 | //
96 | // metroLabel2
97 | //
98 | this.metroLabel2.AutoSize = true;
99 | this.metroLabel2.Location = new System.Drawing.Point(28, 167);
100 | this.metroLabel2.Name = "metroLabel2";
101 | this.metroLabel2.Size = new System.Drawing.Size(37, 19);
102 | this.metroLabel2.TabIndex = 12;
103 | this.metroLabel2.Text = "排序";
104 | //
105 | // btnCancel
106 | //
107 | this.btnCancel.BackColor = System.Drawing.Color.Transparent;
108 | this.btnCancel.Image = null;
109 | this.btnCancel.Location = new System.Drawing.Point(302, 167);
110 | this.btnCancel.Name = "btnCancel";
111 | this.btnCancel.Size = new System.Drawing.Size(75, 28);
112 | this.btnCancel.TabIndex = 15;
113 | this.btnCancel.Text = "取消";
114 | this.btnCancel.UseVisualStyleBackColor = false;
115 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
116 | //
117 | // btnSave
118 | //
119 | this.btnSave.BackColor = System.Drawing.Color.Transparent;
120 | this.btnSave.Image = null;
121 | this.btnSave.Location = new System.Drawing.Point(221, 167);
122 | this.btnSave.Name = "btnSave";
123 | this.btnSave.Size = new System.Drawing.Size(75, 28);
124 | this.btnSave.TabIndex = 14;
125 | this.btnSave.Text = "保存";
126 | this.btnSave.UseVisualStyleBackColor = false;
127 | this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
128 | //
129 | // cbParent
130 | //
131 | this.cbParent.FormattingEnabled = true;
132 | this.cbParent.ItemHeight = 23;
133 | this.cbParent.Location = new System.Drawing.Point(221, 81);
134 | this.cbParent.Name = "cbParent";
135 | this.cbParent.Size = new System.Drawing.Size(156, 29);
136 | this.cbParent.TabIndex = 16;
137 | this.cbParent.UseSelectable = true;
138 | //
139 | // cbIpAddress
140 | //
141 | this.cbIpAddress.FormattingEnabled = true;
142 | this.cbIpAddress.ItemHeight = 23;
143 | this.cbIpAddress.Location = new System.Drawing.Point(221, 123);
144 | this.cbIpAddress.Name = "cbIpAddress";
145 | this.cbIpAddress.Size = new System.Drawing.Size(156, 29);
146 | this.cbIpAddress.TabIndex = 17;
147 | this.cbIpAddress.UseSelectable = true;
148 | //
149 | // lbStatus
150 | //
151 | this.lbStatus.AutoSize = true;
152 | this.lbStatus.Location = new System.Drawing.Point(219, 28);
153 | this.lbStatus.Name = "lbStatus";
154 | this.lbStatus.Size = new System.Drawing.Size(45, 19);
155 | this.lbStatus.TabIndex = 18;
156 | this.lbStatus.Text = "[新增]";
157 | //
158 | // RemoteForm
159 | //
160 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
161 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
162 | this.ClientSize = new System.Drawing.Size(400, 206);
163 | this.Controls.Add(this.lbStatus);
164 | this.Controls.Add(this.cbIpAddress);
165 | this.Controls.Add(this.cbParent);
166 | this.Controls.Add(this.btnCancel);
167 | this.Controls.Add(this.btnSave);
168 | this.Controls.Add(this.numSort);
169 | this.Controls.Add(this.metroLabel2);
170 | this.Controls.Add(this.txtName);
171 | this.Controls.Add(this.metroLabel3);
172 | this.Controls.Add(this.metroLabel1);
173 | this.Controls.Add(this.chIsParent);
174 | this.Name = "RemoteForm";
175 | this.Text = "远程主机配置";
176 | this.Load += new System.EventHandler(this.RemoteForm_Load);
177 | ((System.ComponentModel.ISupportInitialize)(this.numSort)).EndInit();
178 | this.ResumeLayout(false);
179 | this.PerformLayout();
180 |
181 | }
182 |
183 | #endregion
184 |
185 | private Wisder.W3Common.WMetroControl.Controls.MetroToggle chIsParent;
186 | private Wisder.W3Common.WMetroControl.Controls.MetroLabel metroLabel1;
187 | private System.Windows.Forms.TextBox txtName;
188 | private Wisder.W3Common.WMetroControl.Controls.MetroLabel metroLabel3;
189 | private System.Windows.Forms.NumericUpDown numSort;
190 | private Wisder.W3Common.WMetroControl.Controls.MetroLabel metroLabel2;
191 | private Wisder.W3Common.WControl.WButton btnCancel;
192 | private Wisder.W3Common.WControl.WButton btnSave;
193 | private Wisder.W3Common.WMetroControl.Controls.MetroComboBox cbParent;
194 | private Wisder.W3Common.WMetroControl.Controls.MetroComboBox cbIpAddress;
195 | private Wisder.W3Common.WMetroControl.Controls.MetroLabel lbStatus;
196 | }
197 | }
--------------------------------------------------------------------------------
/远程桌面管理器/MainForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace 远程桌面管理器
2 | {
3 | partial class MainForm
4 | {
5 | ///
6 | /// 必需的设计器变量。
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// 清理所有正在使用的资源。
12 | ///
13 | /// 如果应释放托管资源,为 true;否则为 false。
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows 窗体设计器生成的代码
24 |
25 | ///
26 | /// 设计器支持所需的方法 - 不要
27 | /// 使用代码编辑器修改此方法的内容。
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
33 | this.tabControl = new 远程桌面管理器.DraggableMetroTabControl();
34 | this.pageManage = new System.Windows.Forms.TabPage();
35 | this.panelBody = new System.Windows.Forms.Panel();
36 | this.panelSetting = new Wisder.W3Common.WMetroControl.Controls.MetroPanel();
37 | this.btnClear = new Wisder.W3Common.WMetroControl.Controls.MetroLink();
38 | this.btnAddRemoteHost = new Wisder.W3Common.WMetroControl.Controls.MetroLink();
39 | this.btnAddIpAddress = new Wisder.W3Common.WMetroControl.Controls.MetroLink();
40 | this.btnRefresh = new Wisder.W3Common.WMetroControl.Controls.MetroLink();
41 | this.btnSetStyle = new Wisder.W3Common.WMetroControl.Controls.MetroTile();
42 | this.menuTabPage = new System.Windows.Forms.ContextMenuStrip(this.components);
43 | this.关闭ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
44 | this.全屏ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
45 | this.独立窗口ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
46 | this.metroStyleManager = new Wisder.W3Common.WMetroControl.Components.MetroStyleManager(this.components);
47 | this.menuTitle = new System.Windows.Forms.ContextMenuStrip(this.components);
48 | this.编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
49 | this.删除ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
50 | this.确认无误删除ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
51 | this.连同父级一起删除ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
52 | this.tabControl.SuspendLayout();
53 | this.pageManage.SuspendLayout();
54 | this.panelSetting.SuspendLayout();
55 | this.menuTabPage.SuspendLayout();
56 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager)).BeginInit();
57 | this.menuTitle.SuspendLayout();
58 | this.SuspendLayout();
59 | //
60 | // tabControl
61 | //
62 | this.tabControl.AllowDrop = true;
63 | this.tabControl.Controls.Add(this.pageManage);
64 | this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
65 | this.tabControl.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
66 | this.tabControl.Location = new System.Drawing.Point(20, 60);
67 | this.tabControl.Name = "tabControl";
68 | this.tabControl.Padding = new System.Drawing.Point(6, 8);
69 | this.tabControl.SelectedIndex = 0;
70 | this.tabControl.Size = new System.Drawing.Size(756, 402);
71 | this.tabControl.TabIndex = 0;
72 | this.tabControl.UseSelectable = true;
73 | this.tabControl.DragDone += TabControl_DragDone;
74 | this.tabControl.DoubleClick += new System.EventHandler(this.tabControl_DoubleClick);
75 | this.tabControl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tabControl_MouseDown);
76 | this.tabControl.GiveFeedback += Drag.UpdataCursor;
77 | //
78 | // pageManage
79 | //
80 | this.pageManage.Controls.Add(this.panelBody);
81 | this.pageManage.Controls.Add(this.panelSetting);
82 | this.pageManage.Location = new System.Drawing.Point(4, 38);
83 | this.pageManage.Name = "pageManage";
84 | this.pageManage.Padding = new System.Windows.Forms.Padding(3);
85 | this.pageManage.Size = new System.Drawing.Size(748, 360);
86 | this.pageManage.TabIndex = 0;
87 | this.pageManage.Text = "可用";
88 | this.pageManage.UseVisualStyleBackColor = true;
89 | //
90 | // panelBody
91 | //
92 | this.panelBody.AutoScroll = true;
93 | this.panelBody.Dock = System.Windows.Forms.DockStyle.Fill;
94 | this.panelBody.Location = new System.Drawing.Point(3, 3);
95 | this.panelBody.Name = "panelBody";
96 | this.panelBody.Size = new System.Drawing.Size(742, 320);
97 | this.panelBody.TabIndex = 3;
98 | //
99 | // panelSetting
100 | //
101 | this.panelSetting.Controls.Add(this.btnClear);
102 | this.panelSetting.Controls.Add(this.btnAddRemoteHost);
103 | this.panelSetting.Controls.Add(this.btnAddIpAddress);
104 | this.panelSetting.Controls.Add(this.btnRefresh);
105 | this.panelSetting.Controls.Add(this.btnSetStyle);
106 | this.panelSetting.Dock = System.Windows.Forms.DockStyle.Bottom;
107 | this.panelSetting.HorizontalScrollbarBarColor = true;
108 | this.panelSetting.HorizontalScrollbarHighlightOnWheel = false;
109 | this.panelSetting.HorizontalScrollbarSize = 10;
110 | this.panelSetting.Location = new System.Drawing.Point(3, 323);
111 | this.panelSetting.Name = "panelSetting";
112 | this.panelSetting.Size = new System.Drawing.Size(742, 34);
113 | this.panelSetting.TabIndex = 2;
114 | this.panelSetting.VerticalScrollbarBarColor = true;
115 | this.panelSetting.VerticalScrollbarHighlightOnWheel = false;
116 | this.panelSetting.VerticalScrollbarSize = 10;
117 | //
118 | // btnClear
119 | //
120 | this.btnClear.Dock = System.Windows.Forms.DockStyle.Left;
121 | this.btnClear.Location = new System.Drawing.Point(400, 0);
122 | this.btnClear.Name = "btnClear";
123 | this.btnClear.Size = new System.Drawing.Size(94, 34);
124 | this.btnClear.TabIndex = 6;
125 | this.btnClear.Text = "清理无效项";
126 | this.btnClear.UseSelectable = true;
127 | this.btnClear.UseVisualStyleBackColor = true;
128 | this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
129 | //
130 | // btnAddRemoteHost
131 | //
132 | this.btnAddRemoteHost.Dock = System.Windows.Forms.DockStyle.Left;
133 | this.btnAddRemoteHost.Location = new System.Drawing.Point(306, 0);
134 | this.btnAddRemoteHost.Name = "btnAddRemoteHost";
135 | this.btnAddRemoteHost.Size = new System.Drawing.Size(94, 34);
136 | this.btnAddRemoteHost.TabIndex = 3;
137 | this.btnAddRemoteHost.Text = "添加远程主机";
138 | this.btnAddRemoteHost.UseSelectable = true;
139 | this.btnAddRemoteHost.UseVisualStyleBackColor = true;
140 | this.btnAddRemoteHost.Click += new System.EventHandler(this.btnAddRemoteHost_Click);
141 | //
142 | // btnAddIpAddress
143 | //
144 | this.btnAddIpAddress.Dock = System.Windows.Forms.DockStyle.Left;
145 | this.btnAddIpAddress.Location = new System.Drawing.Point(212, 0);
146 | this.btnAddIpAddress.Name = "btnAddIpAddress";
147 | this.btnAddIpAddress.Size = new System.Drawing.Size(94, 34);
148 | this.btnAddIpAddress.TabIndex = 2;
149 | this.btnAddIpAddress.Text = "管理地址库";
150 | this.btnAddIpAddress.UseSelectable = true;
151 | this.btnAddIpAddress.UseVisualStyleBackColor = true;
152 | this.btnAddIpAddress.Click += new System.EventHandler(this.btnAddIpAddress_Click);
153 | //
154 | // btnRefresh
155 | //
156 | this.btnRefresh.Dock = System.Windows.Forms.DockStyle.Left;
157 | this.btnRefresh.Location = new System.Drawing.Point(118, 0);
158 | this.btnRefresh.Name = "btnRefresh";
159 | this.btnRefresh.Size = new System.Drawing.Size(94, 34);
160 | this.btnRefresh.TabIndex = 5;
161 | this.btnRefresh.Text = "刷新";
162 | this.btnRefresh.UseSelectable = true;
163 | this.btnRefresh.UseVisualStyleBackColor = true;
164 | this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
165 | //
166 | // btnSetStyle
167 | //
168 | this.btnSetStyle.ActiveControl = null;
169 | this.btnSetStyle.Dock = System.Windows.Forms.DockStyle.Left;
170 | this.btnSetStyle.Location = new System.Drawing.Point(0, 0);
171 | this.btnSetStyle.Name = "btnSetStyle";
172 | this.btnSetStyle.Size = new System.Drawing.Size(118, 34);
173 | this.btnSetStyle.TabIndex = 4;
174 | this.btnSetStyle.Text = "切换主题[15/15]";
175 | this.btnSetStyle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
176 | this.btnSetStyle.UseSelectable = true;
177 | this.btnSetStyle.UseVisualStyleBackColor = true;
178 | this.btnSetStyle.Click += new System.EventHandler(this.btnSetStyle_Click);
179 | //
180 | // menuTabPage
181 | //
182 | this.menuTabPage.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
183 | this.关闭ToolStripMenuItem,
184 | this.全屏ToolStripMenuItem,
185 | this.独立窗口ToolStripMenuItem});
186 | this.menuTabPage.Name = "menu";
187 | this.menuTabPage.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
188 | this.menuTabPage.Size = new System.Drawing.Size(125, 70);
189 | //
190 | // 关闭ToolStripMenuItem
191 | //
192 | this.关闭ToolStripMenuItem.Name = "关闭ToolStripMenuItem";
193 | this.关闭ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
194 | this.关闭ToolStripMenuItem.Text = "关闭";
195 | this.关闭ToolStripMenuItem.Click += new System.EventHandler(this.关闭ToolStripMenuItem_Click);
196 | //
197 | // 全屏ToolStripMenuItem
198 | //
199 | this.全屏ToolStripMenuItem.Name = "全屏ToolStripMenuItem";
200 | this.全屏ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
201 | this.全屏ToolStripMenuItem.Text = "全屏";
202 | this.全屏ToolStripMenuItem.Click += new System.EventHandler(this.全屏ToolStripMenuItem_Click);
203 | //
204 | // 独立窗口ToolStripMenuItem
205 | //
206 | this.独立窗口ToolStripMenuItem.Name = "独立窗口ToolStripMenuItem";
207 | this.独立窗口ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
208 | this.独立窗口ToolStripMenuItem.Text = "独立窗口";
209 | this.独立窗口ToolStripMenuItem.Click += new System.EventHandler(this.独立窗口ToolStripMenuItem_Click);
210 | //
211 | // metroStyleManager
212 | //
213 | this.metroStyleManager.Owner = this;
214 | //
215 | // menuTitle
216 | //
217 | this.menuTitle.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
218 | this.编辑ToolStripMenuItem,
219 | this.删除ToolStripMenuItem});
220 | this.menuTitle.Name = "menu";
221 | this.menuTitle.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
222 | this.menuTitle.Size = new System.Drawing.Size(101, 48);
223 | //
224 | // 编辑ToolStripMenuItem
225 | //
226 | this.编辑ToolStripMenuItem.Name = "编辑ToolStripMenuItem";
227 | this.编辑ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
228 | this.编辑ToolStripMenuItem.Text = "编辑";
229 | this.编辑ToolStripMenuItem.Click += new System.EventHandler(this.编辑ToolStripMenuItem_Click);
230 | //
231 | // 删除ToolStripMenuItem
232 | //
233 | this.删除ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
234 | this.确认无误删除ToolStripMenuItem,
235 | this.连同父级一起删除ToolStripMenuItem});
236 | this.删除ToolStripMenuItem.Name = "删除ToolStripMenuItem";
237 | this.删除ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
238 | this.删除ToolStripMenuItem.Text = "删除";
239 | //
240 | // 确认无误删除ToolStripMenuItem
241 | //
242 | this.确认无误删除ToolStripMenuItem.Name = "确认无误删除ToolStripMenuItem";
243 | this.确认无误删除ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
244 | this.确认无误删除ToolStripMenuItem.Text = "确认无误,删除!";
245 | this.确认无误删除ToolStripMenuItem.Click += new System.EventHandler(this.确认无误删除ToolStripMenuItem_Click);
246 | //
247 | // 连同父级一起删除ToolStripMenuItem
248 | //
249 | this.连同父级一起删除ToolStripMenuItem.Name = "连同父级一起删除ToolStripMenuItem";
250 | this.连同父级一起删除ToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
251 | this.连同父级一起删除ToolStripMenuItem.Text = "连同父级一起删除";
252 | this.连同父级一起删除ToolStripMenuItem.Click += new System.EventHandler(this.连同父级一起删除ToolStripMenuItem_Click);
253 | //
254 | // MainForm
255 | //
256 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
257 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
258 | this.BackLocation = Wisder.W3Common.WMetroControl.Forms.BackLocation.TopLeft;
259 | this.BorderStyle = Wisder.W3Common.WMetroControl.Forms.MetroFormBorderStyle.None;
260 | this.ClientSize = new System.Drawing.Size(796, 482);
261 | this.Controls.Add(this.tabControl);
262 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
263 | this.Name = "MainForm";
264 | this.ShadowType = Wisder.W3Common.WMetroControl.Forms.MetroFormShadowType.Flat;
265 | this.Style = Wisder.W3Common.WMetroControl.MetroColorStyle.Default;
266 | this.Text = "远程桌面管理";
267 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
268 | this.Load += new System.EventHandler(this.MainForm_Load);
269 | this.MouseLeave += new System.EventHandler(this.MainForm_MouseLeave);
270 | this.tabControl.ResumeLayout(false);
271 | this.pageManage.ResumeLayout(false);
272 | this.panelSetting.ResumeLayout(false);
273 | this.menuTabPage.ResumeLayout(false);
274 | ((System.ComponentModel.ISupportInitialize)(this.metroStyleManager)).EndInit();
275 | this.menuTitle.ResumeLayout(false);
276 | this.ResumeLayout(false);
277 |
278 | }
279 |
280 | #endregion
281 | private System.Windows.Forms.TabPage pageManage;
282 | private System.Windows.Forms.ContextMenuStrip menuTabPage;
283 | private System.Windows.Forms.ToolStripMenuItem 关闭ToolStripMenuItem;
284 | private System.Windows.Forms.ToolStripMenuItem 全屏ToolStripMenuItem;
285 | private System.Windows.Forms.ToolStripMenuItem 独立窗口ToolStripMenuItem;
286 | private Wisder.W3Common.WMetroControl.Controls.MetroPanel panelSetting;
287 | private System.Windows.Forms.Panel panelBody;
288 | private Wisder.W3Common.WMetroControl.Controls.MetroLink btnAddIpAddress;
289 | private Wisder.W3Common.WMetroControl.Controls.MetroLink btnAddRemoteHost;
290 | private Wisder.W3Common.WMetroControl.Controls.MetroTile btnSetStyle;
291 | private Wisder.W3Common.WMetroControl.Components.MetroStyleManager metroStyleManager;
292 | private Wisder.W3Common.WMetroControl.Controls.MetroLink btnRefresh;
293 | private System.Windows.Forms.ContextMenuStrip menuTitle;
294 | private System.Windows.Forms.ToolStripMenuItem 编辑ToolStripMenuItem;
295 | private System.Windows.Forms.ToolStripMenuItem 删除ToolStripMenuItem;
296 | private System.Windows.Forms.ToolStripMenuItem 确认无误删除ToolStripMenuItem;
297 | private System.Windows.Forms.ToolStripMenuItem 连同父级一起删除ToolStripMenuItem;
298 | private Wisder.W3Common.WMetroControl.Controls.MetroLink btnClear;
299 | private DraggableMetroTabControl tabControl;
300 | }
301 | }
302 |
303 |
--------------------------------------------------------------------------------
/远程桌面管理器/MainForm.cs:
--------------------------------------------------------------------------------
1 | using AxMSTSCLib;
2 | using Dapper;
3 | using MSTSCLib;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Data.SQLite;
7 | using System.Diagnostics;
8 | using System.Drawing;
9 | using System.IO;
10 | using System.Linq;
11 | using System.Threading;
12 | using System.Windows.Forms;
13 | using Wisder.W3Common.WMetroControl;
14 | using Wisder.W3Common.WMetroControl.Controls;
15 | using Wisder.W3Common.WMetroControl.Forms;
16 |
17 | namespace 远程桌面管理器
18 | {
19 | extern alias wrapper;
20 | public partial class MainForm : MetroForm
21 | {
22 | public MainForm()
23 | {
24 | InitializeComponent();
25 | }
26 |
27 | private void MainForm_Load(object sender, System.EventArgs e)
28 | {
29 | //创建存储文件
30 | CreateDb();
31 | //设置界面主题
32 | this.StyleManager = metroStyleManager;
33 | short styleId;
34 | using (var conn = new SQLiteConnection(Common.ConnectionString))
35 | {
36 | var value = conn.Query("SELECT FValue FROM MyConfig WHERE FKey='Style'").FirstOrDefault();
37 | styleId = Convert.ToInt16(value);
38 | }
39 | this.StyleManager.Style = (MetroColorStyle)styleId;
40 | btnSetStyle.Text = string.Format("切换主题[{0}/15]", styleId < 2 ? styleId : styleId - 1);
41 | //异步加载远程桌面配置
42 | this.BeginInvoke(new Action(LoadHostConfig));
43 | }
44 |
45 | private void CreateDb()
46 | {
47 | var path = Environment.CurrentDirectory + @"\config.wdb";
48 | if (!File.Exists(path))
49 | {
50 | using (var fs = File.Create(path))
51 | {
52 | fs.Write(db.config, 0, db.config.Count());
53 | }
54 | }
55 | }
56 | ///
57 | /// 加载远程桌面配置
58 | ///
59 | private void LoadHostConfig()
60 | {
61 | SetWait(true);
62 | panelBody.Controls.Clear(); //清空原有
63 |
64 | #region 1.0 获取数据
65 | RemoteHost[] hosts;
66 | using (var conn = new SQLiteConnection(Common.ConnectionString))
67 | {
68 | const string sqlCmd = @"SELECT a.FId,a.FName,a.FConectId,a.FParentId,a.FSort,b.FId,b.FIpAddress,b.FIpPort,b.FLoginUser,b.FPassword,b.FFullUrl
69 | FROM RemoteHost a
70 | LEFT JOIN ConnectLib b ON a.FConectId=b.FId
71 | ORDER BY a.FSort ASC,a.FId DESC";
72 | hosts = conn.Query(sqlCmd, (host, ip) =>
73 | {
74 | host.IpAddress = ip;
75 | return host;
76 | }, null, null, false, "FId", null, null).ToArray();
77 | }
78 | #endregion
79 |
80 | #region 2.0 加载配置信息
81 | var group = hosts.Where(x => x.FParentId == 0).OrderByDescending(x => x.FSort).ToArray();
82 | foreach (var hostGroup in group)
83 | {
84 | //建立分组
85 | var hostBox = new WHostGroupBox { Dock = DockStyle.Top, Height = 100, Text = hostGroup.FName };
86 | panelBody.Controls.Add(hostBox); //分组Box
87 | //填充分组内容
88 | foreach (var host in hosts.Where(x => x.FParentId == hostGroup.FId).OrderBy(x => x.FSort))
89 | {
90 | var ipInfo = host.IpAddress; //IP地址信息
91 | if (ipInfo == null) continue;
92 |
93 | var title = new MetroTile
94 | {
95 | Name = "title",
96 | ActiveControl = null,
97 | Height = 60,
98 | Text = string.Format("{0}\r\n {1}", host.FName, ipInfo.FFullUrl),
99 | UseSelectable = true,
100 | UseVisualStyleBackColor = true,
101 | Tag = host,
102 | AutoSize = true,
103 | ContextMenuStrip = menuTitle,
104 | StyleManager = metroStyleManager
105 | };
106 | title.Click += ConnectRemoteHost;
107 | title.MouseDown += menuTitle_Show;
108 | hostBox.AddControl(title);
109 | }
110 | }
111 | #endregion
112 |
113 | SetWait(false);
114 | }
115 |
116 | ///
117 | /// 连接远程服务器
118 | ///
119 | ///
120 | ///
121 | void ConnectRemoteHost(object sender, EventArgs e)
122 | {
123 | var host = (RemoteHost)((MetroTile)sender).Tag;
124 | var ipInfo = host.IpAddress;
125 | var port = ipInfo.Port;//实时计算属性,缓存
126 |
127 | #region 1.0 创建页签
128 | var page = new TabPage(string.Format("{0}[{1}]", host.FName, ipInfo.FFullUrl));
129 | tabControl.TabPages.Add(page);
130 | page.ContextMenuStrip = menuTabPage;
131 | tabControl.SelectedTab = page;
132 | #endregion
133 |
134 | #region 2.0 创建远程桌面客户端
135 | //https://msdn.microsoft.com/en-us/library/ee620996(v=vs.85).aspx
136 | var rdpClient = new AxMsRdpClient7
137 | {
138 | Dock = DockStyle.Fill,
139 | Width = Screen.PrimaryScreen.Bounds.Width,
140 | Height=Screen.PrimaryScreen.Bounds.Height
141 | };
142 | page.Controls.Add(rdpClient);
143 | rdpClient.DesktopWidth = Screen.PrimaryScreen.Bounds.Width;
144 | rdpClient.DesktopHeight = Screen.PrimaryScreen.Bounds.Height;
145 | //page.AutoScroll = true;
146 | rdpClient.Server = ipInfo.FIpAddress;
147 | rdpClient.UserName = ipInfo.FLoginUser;
148 |
149 | if (port > 0) rdpClient.AdvancedSettings2.RDPPort = port;
150 | rdpClient.AdvancedSettings2.ClearTextPassword = ipInfo.FPassword;
151 | //偏好设置
152 | rdpClient.ColorDepth = 32;
153 | rdpClient.ConnectingText = string.Format("正在连接[{0}],请稍等... {1}",
154 | host.FName, ipInfo.FFullUrl);
155 | #endregion
156 | rdpClient.OnConfirmClose += RdpClient_OnConfirmClose;
157 | rdpClient.OnDisconnected += RdpClient_OnDisconnected;
158 | //rdpClient.OnLeaveFullScreenMode += RdpClient_OnLeaveFullScreenMode;
159 | rdpClient.OnAuthenticationWarningDisplayed += RdpClient_OnAuthenticationWarningDisplayed;
160 | rdpClient.OnRequestLeaveFullScreen += RdpClient_OnLeaveFullScreenMode;
161 | rdpClient.OnRequestGoFullScreen += RdpClient_OnRequestGoFullScreen;
162 | rdpClient.OnRequestContainerMinimize += RdpClient_OnRequestContainerMinimize;
163 | rdpClient.AdvancedSettings8.RedirectDrives = true;//映射驱动器
164 | rdpClient.AdvancedSettings8.RedirectPrinters = true;//映射打印机
165 | rdpClient.AdvancedSettings8.RedirectClipboard = true;//映射剪贴板
166 | rdpClient.AdvancedSettings8.ContainerHandledFullScreen = 1;
167 | rdpClient.AdvancedSettings8.ConnectionBarShowRestoreButton = true;
168 | rdpClient.AdvancedSettings8.SmartSizing = true;
169 | //rdpClient.AdvancedSettings8.ConnectionBarShowMinimizeButton = false;//不显示最小化按钮
170 | var settings = (IMsRdpClientNonScriptable5)rdpClient.GetOcx();
171 | settings.RedirectDynamicDrives = true;//动态映射驱动器
172 | settings.RedirectionWarningType = RedirectionWarningType.RedirectionWarningTypeTrusted;
173 | settings.AllowCredentialSaving = true;
174 | settings.ShowRedirectionWarningDialog = false;
175 | settings.AllowPromptingForCredentials = false;
176 | settings.PromptForCredentials = false;
177 | settings.PromptForCredsOnClient = false;
178 | settings.MarkRdpSettingsSecure = true;
179 | settings.NegotiateSecurityLayer = true;
180 | settings.WarnAboutClipboardRedirection = false;
181 | settings.WarnAboutDirectXRedirection = false;
182 | settings.WarnAboutPrinterRedirection = false;
183 | settings.WarnAboutSendingCredentials = false;
184 | //连接远程桌面
185 | rdpClient.Connect();
186 | }
187 | #region RdpClient事件
188 | private void RdpClient_OnRequestContainerMinimize(object sender, EventArgs e)
189 | {
190 | var rdpClient = (AxMsRdpClient7)sender;
191 | var form = rdpClient.Parent as Form;
192 | if (form != null)
193 | form.WindowState = FormWindowState.Minimized;
194 | }
195 | private void RdpClient_OnRequestGoFullScreen(object sender, EventArgs e)
196 | {
197 | var rdpClient = (AxMsRdpClient7)sender;
198 | new Thread(new ThreadStart(() =>
199 | {
200 | Thread.Sleep(1000);
201 | int connectionBarPtr = 0;
202 | connectionBarPtr = connectionBarPtr = User32.FindWindow("BBarWindowClass", "BBar");
203 | if (connectionBarPtr != 0)
204 | {
205 | RECT rect = new RECT();
206 | User32.GetWindowRect(new IntPtr(connectionBarPtr), ref rect);
207 | Debug.WriteLine($"the connection bar rectage is {rect.Left} {rect.Top} {rect.Right} {rect.Bottom}, IsVisible:{User32.IsWindowVisible(new IntPtr(connectionBarPtr))}");
208 | }
209 | else
210 | {
211 | Debug.WriteLine("cannot find the connection bar handle");
212 | }
213 | })).Start();
214 | }
215 | ///
216 | /// 根据 https://github.com/meehi/ExtremeRemoteDesktopManager/blob/master/Extreme%20Remote%20Desktop%20Manager/Extreme%20Remote%20Desktop%20Manager/Helper/ConnectHelper.cs
217 | /// 防止每次都弹出确认连接的对话框
218 | ///
219 | ///
220 | ///
221 | private void RdpClient_OnAuthenticationWarningDisplayed(object sender, EventArgs e)
222 | {
223 | SendKeys.Send("{LEFT}");
224 | Thread.Sleep(100);
225 | SendKeys.Send("{ENTER}");
226 | }
227 |
228 | private void RdpClient_OnLeaveFullScreenMode(object sender, EventArgs e)
229 | {
230 | //rdpClient退出全屏时父控件如果是FullScreenForm则也退出全屏
231 | var rdpClient = sender as AxMsRdpClient7;
232 | var form = rdpClient.Parent as FullScreenForm;
233 | if (form != null)
234 | {
235 | //form.FormBorderStyle = FormBorderStyle.Sizable;
236 | form.SetFormFullScreen(false);
237 | }
238 | }
239 |
240 | private void RdpClient_OnDisconnected(object sender, IMsTscAxEvents_OnDisconnectedEvent e)
241 | {
242 | var rdpClient = sender as AxMsRdpClient7;
243 | if(e.discReason!=0 && e.discReason!=1 && e.discReason!=2 && e.discReason!=3)
244 | {
245 | if(e.discReason!=2825)
246 | MessageBox.Show(rdpClient.GetErrorDescription((uint)e.discReason, (uint)rdpClient.ExtendedDisconnectReason));
247 | }
248 | rdpClient?.Parent.Dispose();
249 | rdpClient.Dispose();
250 | CheckAllTabPageState();
251 | }
252 | private void CheckAllTabPageState()
253 | {
254 | List list = new List();
255 | for(int i=1;i 0)
376 | {
377 | var point = (MouseEventArgs)e;
378 | for (int i = 1, count = tabControl.TabPages.Count; i < count; i++) //排除首页
379 | {
380 | var page = tabControl.TabPages[i];
381 | if (tabControl.GetTabRect(i).Contains(new Point(point.X, point.Y)))
382 | {
383 | foreach (var control in page.Controls)
384 | {
385 | var rdpClient = control as AxMsRdpClient7;
386 | if (rdpClient != null)
387 | {
388 | var form=CreateNewFullScreenForm(page);
389 | form.Show(this);
390 | form.SetFormFullScreen(true);
391 | rdpClient.Dock = DockStyle.Fill;
392 | rdpClient.FullScreen = true;
393 | }
394 | }
395 | break;
396 | }
397 | }
398 | }
399 | }
400 | #endregion
401 |
402 | private void btnSetStyle_Click(object sender, EventArgs e)
403 | {
404 | var nextStyle = Convert.ToInt32(StyleManager.Style);
405 | do
406 | {
407 | nextStyle = nextStyle == 16 ? 1 : nextStyle + 1;
408 | } while (nextStyle == 2);//忽略白色
409 | btnSetStyle.Text = string.Format("切换主题[{0}/15]", nextStyle < 2 ? nextStyle : nextStyle - 1);
410 | StyleManager.Style = (MetroColorStyle)nextStyle;
411 | using (var conn = new SQLiteConnection(Common.ConnectionString))
412 | {
413 | conn.Execute("UPDATE MyConfig SET FValue=@styleId WHERE FKey='Style'", new { styleId = nextStyle });
414 | }
415 | }
416 |
417 | private void btnAddIpAddress_Click(object sender, EventArgs e)
418 | {
419 | var ipForm = new IpAddressForm { StyleManager = metroStyleManager };
420 | if (ipForm.ShowDialog() == DialogResult.OK)
421 | LoadHostConfig();
422 | }
423 |
424 | private void btnAddRemoteHost_Click(object sender, EventArgs e)
425 | {
426 | var hostForm = new RemoteForm { StyleManager = metroStyleManager };
427 | if (hostForm.ShowDialog() == DialogResult.OK)
428 | LoadHostConfig();
429 | }
430 |
431 | private void btnRefresh_Click(object sender, EventArgs e)
432 | {
433 | LoadHostConfig();
434 | }
435 |
436 | #region MetroTitle控制
437 | private MetroTile _currSelectTitle = null;//当前选择的MetroTitle
438 | void menuTitle_Show(object sender, MouseEventArgs e)
439 | {
440 | if (e.Button == MouseButtons.Right)
441 | {
442 | var title = (MetroTile)sender;
443 | _currSelectTitle = title;
444 | }
445 | }
446 | private void 确认无误删除ToolStripMenuItem_Click(object sender, EventArgs e)
447 | {
448 | if (_currSelectTitle == null) return;
449 |
450 | var host = (RemoteHost)_currSelectTitle.Tag;
451 | using (var conn = new SQLiteConnection(Common.ConnectionString))
452 | {
453 | conn.Execute("DELETE FROM RemoteHost WHERE FId=@id", new { id = host.FId });
454 | }
455 | _currSelectTitle.Parent.Controls.Remove(_currSelectTitle);
456 | _currSelectTitle = null;
457 | }
458 | private void 连同父级一起删除ToolStripMenuItem_Click(object sender, EventArgs e)
459 | {
460 | if (_currSelectTitle == null) return;
461 |
462 | var host = (RemoteHost)_currSelectTitle.Tag;
463 | using (var conn = new SQLiteConnection(Common.ConnectionString))
464 | {
465 | conn.Open();
466 | var tran = conn.BeginTransaction();
467 | conn.Execute("DELETE FROM RemoteHost WHERE FId=@id", new { id = host.FParentId });
468 | conn.Execute("DELETE FROM RemoteHost WHERE FParentId=@id", new { id = host.FParentId });
469 | tran.Commit();
470 | }
471 | var parent = _currSelectTitle.Parent.Parent;
472 | parent.Parent.Controls.Remove(parent);
473 | _currSelectTitle = null;
474 | }
475 | private void 编辑ToolStripMenuItem_Click(object sender, EventArgs e)
476 | {
477 | if (_currSelectTitle == null) return;
478 |
479 | var host = (RemoteHost)_currSelectTitle.Tag;
480 | var hostForm = new RemoteForm { StyleManager = metroStyleManager, RemoteHost = host };
481 |
482 | if (hostForm.ShowDialog() == DialogResult.OK)
483 | LoadHostConfig();
484 | }
485 | #endregion
486 |
487 | private void btnClear_Click(object sender, EventArgs e)
488 | {
489 | using (var conn = new SQLiteConnection(Common.ConnectionString))
490 | {
491 | //清理无效远程主机
492 | conn.Execute(
493 | "DELETE FROM RemoteHost WHERE FParentId>0 AND FConectId NOT IN (SELECT FId FROM ConnectLib)");
494 | //清理无效父级节点
495 | conn.Execute(
496 | "DELETE FROM RemoteHost WHERE FParentId=0 AND FId NOT IN (SELECT FParentId FROM RemoteHost)");
497 | }
498 | LoadHostConfig();
499 | }
500 | #region 生成新的全屏Form
501 | ///
502 | /// 由于设置了RdpClient的ContainerHandledFullScreen属性为1,ConnectionBar绑定到了第一次全屏时的父控件上,所以FullScreenForm控件要做到复用,
503 | /// 解决RdpClient附加回主界面后再次最大化时生成了一个全新的FullScreenForm导致ConnectionBar消失的问题
504 | ///
505 | ///
506 | ///
507 | private FullScreenForm CreateNewFullScreenForm(TabPage page)
508 | {
509 | var rdpClient = page.Controls[0];
510 | FullScreenForm form = null;
511 | if ((form = rdpClient.Tag as FullScreenForm) == null)
512 | {
513 | form = new FullScreenForm { Text = page.Text, Width = tabControl.Width, Height = tabControl.Height };
514 | rdpClient.Tag = form;
515 | }
516 | //form.AutoScroll = true;
517 | //foreach (Control control in page.Controls)
518 | //{
519 | // form.Controls.Add(control);
520 | //}
521 | form.Controls.Add(rdpClient);
522 | page.Dispose();
523 | //form.FormBorderStyle = FormBorderStyle.None;
524 | //form.WindowState = FormWindowState.Maximized;
525 | return form;
526 | }
527 | #endregion
528 | }
529 | }
530 |
--------------------------------------------------------------------------------
/远程桌面管理器/IpAddressForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace 远程桌面管理器
2 | {
3 | partial class IpAddressForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
33 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
34 | System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
35 | this.panelAdd = new Wisder.W3Common.WMetroControl.Controls.MetroPanel();
36 | this.btnShowManage = new Wisder.W3Common.WControl.WButton();
37 | this.label1 = new System.Windows.Forms.Label();
38 | this.txtIp = new System.Windows.Forms.TextBox();
39 | this.txtPwd = new System.Windows.Forms.TextBox();
40 | this.txtUser = new System.Windows.Forms.TextBox();
41 | this.metroLabel4 = new Wisder.W3Common.WMetroControl.Controls.MetroLabel();
42 | this.metroLabel3 = new Wisder.W3Common.WMetroControl.Controls.MetroLabel();
43 | this.numPort = new System.Windows.Forms.NumericUpDown();
44 | this.metroLabel2 = new Wisder.W3Common.WMetroControl.Controls.MetroLabel();
45 | this.metroLabel1 = new Wisder.W3Common.WMetroControl.Controls.MetroLabel();
46 | this.btnCancel = new Wisder.W3Common.WControl.WButton();
47 | this.btnSave = new Wisder.W3Common.WControl.WButton();
48 | this.panelManage = new Wisder.W3Common.WMetroControl.Controls.MetroPanel();
49 | this.grid = new Wisder.W3Common.WMetroControl.Controls.MetroGrid();
50 | this.menuGrid = new System.Windows.Forms.ContextMenuStrip(this.components);
51 | this.编辑ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
52 | this.删除ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
53 | this.确认无误删除ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
54 | this.btnRefresh = new Wisder.W3Common.WControl.WButton();
55 | this.btnClose = new Wisder.W3Common.WControl.WButton();
56 | this.btnShowAdd = new Wisder.W3Common.WControl.WButton();
57 | this.panelAdd.SuspendLayout();
58 | ((System.ComponentModel.ISupportInitialize)(this.numPort)).BeginInit();
59 | this.panelManage.SuspendLayout();
60 | ((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit();
61 | this.menuGrid.SuspendLayout();
62 | this.SuspendLayout();
63 | //
64 | // panelAdd
65 | //
66 | this.panelAdd.Controls.Add(this.btnShowManage);
67 | this.panelAdd.Controls.Add(this.label1);
68 | this.panelAdd.Controls.Add(this.txtIp);
69 | this.panelAdd.Controls.Add(this.txtPwd);
70 | this.panelAdd.Controls.Add(this.txtUser);
71 | this.panelAdd.Controls.Add(this.metroLabel4);
72 | this.panelAdd.Controls.Add(this.metroLabel3);
73 | this.panelAdd.Controls.Add(this.numPort);
74 | this.panelAdd.Controls.Add(this.metroLabel2);
75 | this.panelAdd.Controls.Add(this.metroLabel1);
76 | this.panelAdd.Controls.Add(this.btnCancel);
77 | this.panelAdd.Controls.Add(this.btnSave);
78 | this.panelAdd.HorizontalScrollbarBarColor = true;
79 | this.panelAdd.HorizontalScrollbarHighlightOnWheel = false;
80 | this.panelAdd.HorizontalScrollbarSize = 10;
81 | this.panelAdd.Location = new System.Drawing.Point(23, 57);
82 | this.panelAdd.Name = "panelAdd";
83 | this.panelAdd.Size = new System.Drawing.Size(285, 180);
84 | this.panelAdd.TabIndex = 14;
85 | this.panelAdd.VerticalScrollbarBarColor = true;
86 | this.panelAdd.VerticalScrollbarHighlightOnWheel = false;
87 | this.panelAdd.VerticalScrollbarSize = 10;
88 | //
89 | // btnShowManage
90 | //
91 | this.btnShowManage.BackColor = System.Drawing.Color.Transparent;
92 | this.btnShowManage.Image = global::远程桌面管理器.Properties.Resources.左;
93 | this.btnShowManage.Location = new System.Drawing.Point(4, 146);
94 | this.btnShowManage.Name = "btnShowManage";
95 | this.btnShowManage.Size = new System.Drawing.Size(35, 30);
96 | this.btnShowManage.TabIndex = 15;
97 | this.btnShowManage.Text = "";
98 | this.btnShowManage.UseVisualStyleBackColor = false;
99 | this.btnShowManage.Click += new System.EventHandler(this.btnShowManage_Click);
100 | //
101 | // label1
102 | //
103 | this.label1.AutoSize = true;
104 | this.label1.Font = new System.Drawing.Font("宋体", 10F);
105 | this.label1.ForeColor = System.Drawing.Color.Red;
106 | this.label1.Location = new System.Drawing.Point(157, 48);
107 | this.label1.Name = "label1";
108 | this.label1.Size = new System.Drawing.Size(105, 14);
109 | this.label1.TabIndex = 24;
110 | this.label1.Text = "零表示无端口号";
111 | //
112 | // txtIp
113 | //
114 | this.txtIp.Location = new System.Drawing.Point(67, 13);
115 | this.txtIp.Name = "txtIp";
116 | this.txtIp.Size = new System.Drawing.Size(123, 21);
117 | this.txtIp.TabIndex = 23;
118 | this.txtIp.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtIp_KeyDown);
119 | //
120 | // txtPwd
121 | //
122 | this.txtPwd.Location = new System.Drawing.Point(67, 106);
123 | this.txtPwd.Name = "txtPwd";
124 | this.txtPwd.PasswordChar = '●';
125 | this.txtPwd.Size = new System.Drawing.Size(123, 21);
126 | this.txtPwd.TabIndex = 26;
127 | this.txtPwd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPwd_KeyDown);
128 | //
129 | // txtUser
130 | //
131 | this.txtUser.Location = new System.Drawing.Point(67, 75);
132 | this.txtUser.Name = "txtUser";
133 | this.txtUser.Size = new System.Drawing.Size(123, 21);
134 | this.txtUser.TabIndex = 25;
135 | this.txtUser.Text = "Administrator";
136 | this.txtUser.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtUser_KeyDown);
137 | //
138 | // metroLabel4
139 | //
140 | this.metroLabel4.AutoSize = true;
141 | this.metroLabel4.Location = new System.Drawing.Point(17, 105);
142 | this.metroLabel4.Name = "metroLabel4";
143 | this.metroLabel4.Size = new System.Drawing.Size(37, 19);
144 | this.metroLabel4.TabIndex = 20;
145 | this.metroLabel4.Text = "密码";
146 | //
147 | // metroLabel3
148 | //
149 | this.metroLabel3.AutoSize = true;
150 | this.metroLabel3.Location = new System.Drawing.Point(17, 75);
151 | this.metroLabel3.Name = "metroLabel3";
152 | this.metroLabel3.Size = new System.Drawing.Size(37, 19);
153 | this.metroLabel3.TabIndex = 19;
154 | this.metroLabel3.Text = "用户";
155 | //
156 | // numPort
157 | //
158 | this.numPort.InterceptArrowKeys = false;
159 | this.numPort.Location = new System.Drawing.Point(67, 44);
160 | this.numPort.Maximum = new decimal(new int[] {
161 | 65535,
162 | 0,
163 | 0,
164 | 0});
165 | this.numPort.Name = "numPort";
166 | this.numPort.Size = new System.Drawing.Size(70, 21);
167 | this.numPort.TabIndex = 24;
168 | this.numPort.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
169 | this.numPort.KeyDown += new System.Windows.Forms.KeyEventHandler(this.numPort_KeyDown);
170 | //
171 | // metroLabel2
172 | //
173 | this.metroLabel2.AutoSize = true;
174 | this.metroLabel2.Location = new System.Drawing.Point(17, 43);
175 | this.metroLabel2.Name = "metroLabel2";
176 | this.metroLabel2.Size = new System.Drawing.Size(37, 19);
177 | this.metroLabel2.TabIndex = 17;
178 | this.metroLabel2.Text = "端口";
179 | //
180 | // metroLabel1
181 | //
182 | this.metroLabel1.AutoSize = true;
183 | this.metroLabel1.Location = new System.Drawing.Point(17, 13);
184 | this.metroLabel1.Name = "metroLabel1";
185 | this.metroLabel1.Size = new System.Drawing.Size(37, 19);
186 | this.metroLabel1.TabIndex = 16;
187 | this.metroLabel1.Text = "地址";
188 | //
189 | // btnCancel
190 | //
191 | this.btnCancel.BackColor = System.Drawing.Color.Transparent;
192 | this.btnCancel.Image = null;
193 | this.btnCancel.Location = new System.Drawing.Point(157, 147);
194 | this.btnCancel.Name = "btnCancel";
195 | this.btnCancel.Size = new System.Drawing.Size(75, 28);
196 | this.btnCancel.TabIndex = 15;
197 | this.btnCancel.Text = "取消";
198 | this.btnCancel.UseVisualStyleBackColor = false;
199 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
200 | //
201 | // btnSave
202 | //
203 | this.btnSave.BackColor = System.Drawing.Color.Transparent;
204 | this.btnSave.Image = null;
205 | this.btnSave.Location = new System.Drawing.Point(76, 147);
206 | this.btnSave.Name = "btnSave";
207 | this.btnSave.Size = new System.Drawing.Size(75, 28);
208 | this.btnSave.TabIndex = 27;
209 | this.btnSave.Text = "保存";
210 | this.btnSave.UseVisualStyleBackColor = false;
211 | this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
212 | //
213 | // panelManage
214 | //
215 | this.panelManage.Controls.Add(this.grid);
216 | this.panelManage.Controls.Add(this.btnRefresh);
217 | this.panelManage.Controls.Add(this.btnClose);
218 | this.panelManage.Controls.Add(this.btnShowAdd);
219 | this.panelManage.HorizontalScrollbarBarColor = true;
220 | this.panelManage.HorizontalScrollbarHighlightOnWheel = false;
221 | this.panelManage.HorizontalScrollbarSize = 10;
222 | this.panelManage.Location = new System.Drawing.Point(23, 57);
223 | this.panelManage.Name = "panelManage";
224 | this.panelManage.Size = new System.Drawing.Size(285, 180);
225 | this.panelManage.TabIndex = 27;
226 | this.panelManage.VerticalScrollbarBarColor = true;
227 | this.panelManage.VerticalScrollbarHighlightOnWheel = false;
228 | this.panelManage.VerticalScrollbarSize = 10;
229 | //
230 | // grid
231 | //
232 | this.grid.AllowUserToAddRows = false;
233 | this.grid.AllowUserToResizeRows = false;
234 | this.grid.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
235 | this.grid.BorderStyle = System.Windows.Forms.BorderStyle.None;
236 | this.grid.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
237 | this.grid.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
238 | dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
239 | dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(219)))));
240 | dataGridViewCellStyle1.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
241 | dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
242 | dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(219)))));
243 | dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
244 | dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
245 | this.grid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
246 | this.grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
247 | this.grid.ContextMenuStrip = this.menuGrid;
248 | dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
249 | dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
250 | dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
251 | dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(136)))), ((int)(((byte)(136)))), ((int)(((byte)(136)))));
252 | dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(219)))));
253 | dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
254 | dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
255 | this.grid.DefaultCellStyle = dataGridViewCellStyle2;
256 | this.grid.EnableHeadersVisualStyles = false;
257 | this.grid.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
258 | this.grid.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
259 | this.grid.Location = new System.Drawing.Point(4, 4);
260 | this.grid.Name = "grid";
261 | this.grid.ReadOnly = true;
262 | this.grid.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
263 | dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
264 | dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(219)))));
265 | dataGridViewCellStyle3.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
266 | dataGridViewCellStyle3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
267 | dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(219)))));
268 | dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(17)))), ((int)(((byte)(17)))));
269 | dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
270 | this.grid.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
271 | this.grid.RowHeadersVisible = false;
272 | this.grid.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
273 | this.grid.RowTemplate.Height = 23;
274 | this.grid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
275 | this.grid.Size = new System.Drawing.Size(276, 137);
276 | this.grid.TabIndex = 17;
277 | //
278 | // menuGrid
279 | //
280 | this.menuGrid.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
281 | this.编辑ToolStripMenuItem,
282 | this.删除ToolStripMenuItem});
283 | this.menuGrid.Name = "menu";
284 | this.menuGrid.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
285 | this.menuGrid.Size = new System.Drawing.Size(99, 48);
286 | //
287 | // 编辑ToolStripMenuItem
288 | //
289 | this.编辑ToolStripMenuItem.Name = "编辑ToolStripMenuItem";
290 | this.编辑ToolStripMenuItem.Size = new System.Drawing.Size(98, 22);
291 | this.编辑ToolStripMenuItem.Text = "编辑";
292 | this.编辑ToolStripMenuItem.Click += new System.EventHandler(this.编辑ToolStripMenuItem_Click);
293 | //
294 | // 删除ToolStripMenuItem
295 | //
296 | this.删除ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
297 | this.确认无误删除ToolStripMenuItem});
298 | this.删除ToolStripMenuItem.Name = "删除ToolStripMenuItem";
299 | this.删除ToolStripMenuItem.Size = new System.Drawing.Size(98, 22);
300 | this.删除ToolStripMenuItem.Text = "删除";
301 | //
302 | // 确认无误删除ToolStripMenuItem
303 | //
304 | this.确认无误删除ToolStripMenuItem.Name = "确认无误删除ToolStripMenuItem";
305 | this.确认无误删除ToolStripMenuItem.Size = new System.Drawing.Size(170, 22);
306 | this.确认无误删除ToolStripMenuItem.Text = "确认无误,删除!";
307 | this.确认无误删除ToolStripMenuItem.Click += new System.EventHandler(this.确认无误删除ToolStripMenuItem_Click);
308 | //
309 | // btnRefresh
310 | //
311 | this.btnRefresh.BackColor = System.Drawing.Color.Transparent;
312 | this.btnRefresh.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
313 | this.btnRefresh.Image = null;
314 | this.btnRefresh.Location = new System.Drawing.Point(106, 147);
315 | this.btnRefresh.Name = "btnRefresh";
316 | this.btnRefresh.Size = new System.Drawing.Size(75, 28);
317 | this.btnRefresh.TabIndex = 18;
318 | this.btnRefresh.Text = "刷新";
319 | this.btnRefresh.UseVisualStyleBackColor = false;
320 | this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
321 | //
322 | // btnClose
323 | //
324 | this.btnClose.BackColor = System.Drawing.Color.Transparent;
325 | this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
326 | this.btnClose.Image = null;
327 | this.btnClose.Location = new System.Drawing.Point(187, 147);
328 | this.btnClose.Name = "btnClose";
329 | this.btnClose.Size = new System.Drawing.Size(75, 28);
330 | this.btnClose.TabIndex = 16;
331 | this.btnClose.Text = "关闭";
332 | this.btnClose.UseVisualStyleBackColor = false;
333 | this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
334 | //
335 | // btnShowAdd
336 | //
337 | this.btnShowAdd.BackColor = System.Drawing.Color.Transparent;
338 | this.btnShowAdd.Image = global::远程桌面管理器.Properties.Resources.右;
339 | this.btnShowAdd.Location = new System.Drawing.Point(4, 146);
340 | this.btnShowAdd.Name = "btnShowAdd";
341 | this.btnShowAdd.Size = new System.Drawing.Size(35, 30);
342 | this.btnShowAdd.TabIndex = 15;
343 | this.btnShowAdd.Text = "";
344 | this.btnShowAdd.UseVisualStyleBackColor = false;
345 | this.btnShowAdd.Click += new System.EventHandler(this.btnShowAdd_Click);
346 | //
347 | // IpAddressForm
348 | //
349 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
350 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
351 | this.ClientSize = new System.Drawing.Size(326, 270);
352 | this.ControlBox = false;
353 | this.Controls.Add(this.panelAdd);
354 | this.Controls.Add(this.panelManage);
355 | this.MaximizeBox = false;
356 | this.MinimizeBox = false;
357 | this.Name = "IpAddressForm";
358 | this.Text = "连接地址配置";
359 | this.Load += new System.EventHandler(this.IpAddressForm_Load);
360 | this.panelAdd.ResumeLayout(false);
361 | this.panelAdd.PerformLayout();
362 | ((System.ComponentModel.ISupportInitialize)(this.numPort)).EndInit();
363 | this.panelManage.ResumeLayout(false);
364 | ((System.ComponentModel.ISupportInitialize)(this.grid)).EndInit();
365 | this.menuGrid.ResumeLayout(false);
366 | this.ResumeLayout(false);
367 |
368 | }
369 |
370 | #endregion
371 |
372 | private Wisder.W3Common.WMetroControl.Controls.MetroPanel panelAdd;
373 | private System.Windows.Forms.Label label1;
374 | private System.Windows.Forms.TextBox txtIp;
375 | private System.Windows.Forms.TextBox txtPwd;
376 | private System.Windows.Forms.TextBox txtUser;
377 | private Wisder.W3Common.WMetroControl.Controls.MetroLabel metroLabel4;
378 | private Wisder.W3Common.WMetroControl.Controls.MetroLabel metroLabel3;
379 | private System.Windows.Forms.NumericUpDown numPort;
380 | private Wisder.W3Common.WMetroControl.Controls.MetroLabel metroLabel2;
381 | private Wisder.W3Common.WMetroControl.Controls.MetroLabel metroLabel1;
382 | private Wisder.W3Common.WControl.WButton btnCancel;
383 | private Wisder.W3Common.WControl.WButton btnSave;
384 | private Wisder.W3Common.WControl.WButton btnShowManage;
385 | private Wisder.W3Common.WMetroControl.Controls.MetroPanel panelManage;
386 | private Wisder.W3Common.WControl.WButton btnShowAdd;
387 | private Wisder.W3Common.WControl.WButton btnClose;
388 | private Wisder.W3Common.WMetroControl.Controls.MetroGrid grid;
389 | private System.Windows.Forms.ContextMenuStrip menuGrid;
390 | private System.Windows.Forms.ToolStripMenuItem 编辑ToolStripMenuItem;
391 | private System.Windows.Forms.ToolStripMenuItem 删除ToolStripMenuItem;
392 | private System.Windows.Forms.ToolStripMenuItem 确认无误删除ToolStripMenuItem;
393 | private Wisder.W3Common.WControl.WButton btnRefresh;
394 |
395 | }
396 | }
--------------------------------------------------------------------------------
/远程桌面管理器/bin/Debug/Dapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Dapper
5 |
6 |
7 |
8 |
9 | Dapper, a light weight object mapper for ADO.NET
10 |
11 |
12 |
13 |
14 | Purge the query cache
15 |
16 |
17 |
18 |
19 | Return a count of all the cached queries by dapper
20 |
21 |
22 |
23 |
24 |
25 | Return a list of all the queries cached by dapper
26 |
27 |
28 |
29 |
30 |
31 |
32 | Deep diagnostics only: find any hash collisions in the cache
33 |
34 |
35 |
36 |
37 |
38 | Configire the specified type to be mapped to a given db-type
39 |
40 |
41 |
42 |
43 | Execute parameterized SQL
44 |
45 | Number of rows affected
46 |
47 |
48 |
49 | Return a list of dynamic objects, reader is closed after the call
50 |
51 |
52 |
53 |
54 | Executes a query, returning the data typed as per T
55 |
56 | the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object
57 | A sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is
58 | created per row, and a direct column-name===member-name mapping is assumed (case insensitive).
59 |
60 |
61 |
62 |
63 | Execute a command that returns multiple result sets, and access each in turn
64 |
65 |
66 |
67 |
68 | Return a typed list of objects, reader is closed after the call
69 |
70 |
71 |
72 |
73 | Maps a query to objects
74 |
75 | The first type in the recordset
76 | The second type in the recordset
77 | The return type
78 |
79 |
80 |
81 |
82 |
83 |
84 | The Field we should split and read the second object from (default: id)
85 | Number of seconds before command execution timeout
86 | Is it a stored proc or a batch?
87 |
88 |
89 |
90 |
91 | Maps a query to objects
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | The Field we should split and read the second object from (default: id)
104 | Number of seconds before command execution timeout
105 |
106 |
107 |
108 |
109 |
110 | Perform a multi mapping query with 4 input parameters
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 | Perform a multi mapping query with 5 input parameters
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 | Perform a multi mapping query with 6 input parameters
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 | Perform a multi mapping query with 7 input parameters
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 | Internal use only
197 |
198 |
199 |
200 |
201 |
202 |
203 | Internal use only
204 |
205 |
206 |
207 |
208 | Internal use only
209 |
210 |
211 |
212 |
213 | Internal use only
214 |
215 |
216 |
217 |
218 | Internal use only
219 |
220 |
221 |
222 |
223 | Gets type-map for the given type
224 |
225 | Type map implementation, DefaultTypeMap instance if no override present
226 |
227 |
228 |
229 | Set custom mapping for type deserializers
230 |
231 | Entity type to override
232 | Mapping rules impementation, null to remove custom map
233 |
234 |
235 |
236 | Internal use only
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 | Throws a data exception, only used internally
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 | Called if the query cache is purged via PurgeQueryCache
256 |
257 |
258 |
259 |
260 | How should connection strings be compared for equivalence? Defaults to StringComparer.Ordinal.
261 | Providing a custom implementation can be useful for allowing multi-tenancy databases with identical
262 | schema to share startegies. Note that usual equivalence rules apply: any equivalent connection strings
263 | MUST yield the same hash-code.
264 |
265 |
266 |
267 |
268 | Implement this interface to pass an arbitrary db specific set of parameters to Dapper
269 |
270 |
271 |
272 |
273 | Add all the parameters needed to the command just before it executes
274 |
275 | The raw command prior to execution
276 | Information about the query
277 |
278 |
279 |
280 | Implement this interface to pass an arbitrary db specific parameter to Dapper
281 |
282 |
283 |
284 |
285 | Add the parameter needed to the command before it executes
286 |
287 | The raw command prior to execution
288 | Parameter name
289 |
290 |
291 |
292 | Implement this interface to change default mapping of reader columns to type memebers
293 |
294 |
295 |
296 |
297 | Finds best constructor
298 |
299 | DataReader column names
300 | DataReader column types
301 | Matching constructor or default one
302 |
303 |
304 |
305 | Gets mapping for constructor parameter
306 |
307 | Constructor to resolve
308 | DataReader column name
309 | Mapping implementation
310 |
311 |
312 |
313 | Gets member mapping for column
314 |
315 | DataReader column name
316 | Mapping implementation
317 |
318 |
319 |
320 | Implements this interface to provide custom member mapping
321 |
322 |
323 |
324 |
325 | Source DataReader column name
326 |
327 |
328 |
329 |
330 | Target member type
331 |
332 |
333 |
334 |
335 | Target property
336 |
337 |
338 |
339 |
340 | Target field
341 |
342 |
343 |
344 |
345 | Target constructor parameter
346 |
347 |
348 |
349 |
350 | This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example),
351 | and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE**
352 | equality. The type is fully thread-safe.
353 |
354 |
355 |
356 |
357 | Identity of a cached query in Dapper, used for extensability
358 |
359 |
360 |
361 |
362 | Create an identity for use with DynamicParameters, internal use only
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 | The sql
377 |
378 |
379 |
380 |
381 | The command type
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 | Compare 2 Identity objects
418 |
419 |
420 |
421 |
422 |
423 |
424 | The grid reader provides interfaces for reading multiple result sets from a Dapper query
425 |
426 |
427 |
428 |
429 | Read the next grid of results, returned as a dynamic object
430 |
431 |
432 |
433 |
434 | Read the next grid of results
435 |
436 |
437 |
438 |
439 | Read multiple objects from a single recordset on the grid
440 |
441 |
442 |
443 |
444 | Read multiple objects from a single recordset on the grid
445 |
446 |
447 |
448 |
449 | Read multiple objects from a single record set on the grid
450 |
451 |
452 |
453 |
454 | Read multiple objects from a single record set on the grid
455 |
456 |
457 |
458 |
459 | Read multiple objects from a single record set on the grid
460 |
461 |
462 |
463 |
464 | Read multiple objects from a single record set on the grid
465 |
466 |
467 |
468 |
469 | Dispose the grid, closing and disposing both the underlying reader and command.
470 |
471 |
472 |
473 |
474 | A bag of parameters that can be passed to the Dapper Query and Execute methods
475 |
476 |
477 |
478 |
479 | construct a dynamic parameter bag
480 |
481 |
482 |
483 |
484 | construct a dynamic parameter bag
485 |
486 | can be an anonymous type or a DynamicParameters bag
487 |
488 |
489 |
490 | Append a whole object full of params to the dynamic
491 | EG: AddDynamicParams(new {A = 1, B = 2}) // will add property A and B to the dynamic
492 |
493 |
494 |
495 |
496 |
497 | Add a parameter to this dynamic parameter list
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 | Add all the parameters needed to the command just before it executes
508 |
509 | The raw command prior to execution
510 | Information about the query
511 |
512 |
513 |
514 | Get the value of a parameter
515 |
516 |
517 |
518 | The value, note DBNull.Value is not returned, instead the value is returned as null
519 |
520 |
521 |
522 | If true, the command-text is inspected and only values that are clearly used are included on the connection
523 |
524 |
525 |
526 |
527 | All the names of the param in the bag, use Get to yank them out
528 |
529 |
530 |
531 |
532 | This class represents a SQL string, it can be used if you need to denote your parameter is a Char vs VarChar vs nVarChar vs nChar
533 |
534 |
535 |
536 |
537 | Create a new DbString
538 |
539 |
540 |
541 |
542 | Add the parameter to the command... internal use only
543 |
544 |
545 |
546 |
547 |
548 |
549 | Ansi vs Unicode
550 |
551 |
552 |
553 |
554 | Fixed length
555 |
556 |
557 |
558 |
559 | Length of the string -1 for max
560 |
561 |
562 |
563 |
564 | The value of the string
565 |
566 |
567 |
568 |
569 | Handles variances in features per DBMS
570 |
571 |
572 |
573 |
574 | Dictionary of supported features index by connection type name
575 |
576 |
577 |
578 |
579 | Gets the featureset based on the passed connection
580 |
581 |
582 |
583 |
584 | True if the db supports array columns e.g. Postgresql
585 |
586 |
587 |
588 |
589 | Represents simple memeber map for one of target parameter or property or field to source DataReader column
590 |
591 |
592 |
593 |
594 | Creates instance for simple property mapping
595 |
596 | DataReader column name
597 | Target property
598 |
599 |
600 |
601 | Creates instance for simple field mapping
602 |
603 | DataReader column name
604 | Target property
605 |
606 |
607 |
608 | Creates instance for simple constructor parameter mapping
609 |
610 | DataReader column name
611 | Target constructor parameter
612 |
613 |
614 |
615 | DataReader column name
616 |
617 |
618 |
619 |
620 | Target member type
621 |
622 |
623 |
624 |
625 | Target property
626 |
627 |
628 |
629 |
630 | Target field
631 |
632 |
633 |
634 |
635 | Target constructor parameter
636 |
637 |
638 |
639 |
640 | Represents default type mapping strategy used by Dapper
641 |
642 |
643 |
644 |
645 | Creates default type map
646 |
647 | Entity type
648 |
649 |
650 |
651 | Finds best constructor
652 |
653 | DataReader column names
654 | DataReader column types
655 | Matching constructor or default one
656 |
657 |
658 |
659 | Gets mapping for constructor parameter
660 |
661 | Constructor to resolve
662 | DataReader column name
663 | Mapping implementation
664 |
665 |
666 |
667 | Gets member mapping for column
668 |
669 | DataReader column name
670 | Mapping implementation
671 |
672 |
673 |
674 | Implements custom property mapping by user provided criteria (usually presence of some custom attribute with column to member mapping)
675 |
676 |
677 |
678 |
679 | Creates custom property mapping
680 |
681 | Target entity type
682 | Property selector based on target type and DataReader column name
683 |
684 |
685 |
686 | Always returns default constructor
687 |
688 | DataReader column names
689 | DataReader column types
690 | Default constructor
691 |
692 |
693 |
694 | Not impelmeneted as far as default constructor used for all cases
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 | Returns property based on selector strategy
703 |
704 | DataReader column name
705 | Poperty member map
706 |
707 |
708 |
709 |
--------------------------------------------------------------------------------