├── .gitignore ├── ControlClient1.0 ├── BitmapTools │ └── RecoverBitmap.cs ├── ClientForm.Designer.cs ├── ClientForm.cs ├── ClientForm.resx ├── ControlClient1.0.csproj ├── DataPacket │ ├── ENUMS.cs │ ├── RecPacket.cs │ └── SendPacket.cs ├── ErrorMessage │ └── ErrorInfo.cs ├── ICSharpCode.SharpZLib │ ├── BZip2 │ │ ├── BZip2.cs │ │ ├── BZip2Constants.cs │ │ ├── BZip2Exception.cs │ │ ├── BZip2InputStream.cs │ │ └── BZip2OutputStream.cs │ ├── Checksums │ │ ├── Adler32.cs │ │ ├── Crc32.cs │ │ ├── IChecksum.cs │ │ └── StrangeCrc.cs │ ├── Core │ │ ├── FileSystemScanner.cs │ │ ├── INameTransform.cs │ │ ├── IScanFilter.cs │ │ ├── NameFilter.cs │ │ ├── PathFilter.cs │ │ ├── StreamUtils.cs │ │ └── WindowsPathUtils.cs │ ├── Encryption │ │ ├── PkzipClassic.cs │ │ ├── ZipAESStream.cs │ │ └── ZipAESTransform.cs │ ├── GZip │ │ ├── GZipConstants.cs │ │ ├── GZipException.cs │ │ ├── GzipInputStream.cs │ │ └── GzipOutputStream.cs │ ├── ICSharpCode.SharpZLib.csproj │ ├── ICSharpCode.SharpZLib.prjx │ ├── Lzw │ │ ├── LzwConstants.cs │ │ ├── LzwException.cs │ │ └── LzwInputStream.cs │ ├── Main.cs │ ├── SharpZipBaseException.cs │ ├── Tar │ │ ├── InvalidHeaderException.cs │ │ ├── TarArchive.cs │ │ ├── TarBuffer.cs │ │ ├── TarEntry.cs │ │ ├── TarException.cs │ │ ├── TarHeader.cs │ │ ├── TarInputStream.cs │ │ └── TarOutputStream.cs │ └── Zip │ │ ├── Compression │ │ ├── Deflater.cs │ │ ├── DeflaterConstants.cs │ │ ├── DeflaterEngine.cs │ │ ├── DeflaterHuffman.cs │ │ ├── DeflaterPending.cs │ │ ├── Inflater.cs │ │ ├── InflaterDynHeader.cs │ │ ├── InflaterHuffmanTree.cs │ │ ├── PendingBuffer.cs │ │ └── Streams │ │ │ ├── DeflaterOutputStream.cs │ │ │ ├── InflaterInputStream.cs │ │ │ ├── OutputWindow.cs │ │ │ └── StreamManipulator.cs │ │ ├── FastZip.cs │ │ ├── IEntryFactory.cs │ │ ├── WindowsNameTransform.cs │ │ ├── ZipConstants.cs │ │ ├── ZipEntry.cs │ │ ├── ZipEntryFactory.cs │ │ ├── ZipException.cs │ │ ├── ZipExtraData.cs │ │ ├── ZipFile.cs │ │ ├── ZipHelperStream.cs │ │ ├── ZipInputStream.cs │ │ ├── ZipNameTransform.cs │ │ └── ZipOutputStream.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── ScreenBitmap │ ├── BitmapWithCursor.cs │ ├── DifferentBitmapWithCursor.cs │ ├── ShortPoint.cs │ └── ShortRec.cs ├── StreamLine │ └── BlockingQueue.cs ├── app.config ├── client.ico └── libs │ ├── LZ4Sharp.dll │ ├── LZOHelper.dll │ ├── SharpDX.DXGI.dll │ ├── SharpDX.Direct3D11.dll │ ├── SharpDX.dll │ ├── Simplicit.Net.Lzo.dll │ ├── lzo.dll │ └── lzo2.dll ├── ControlServer1.0 ├── 2vt0zr5f.nn5 ├── App.ico ├── BitmapTools │ ├── BitmapCmp24Bit.cs │ ├── BitmapCmp32Bit.cs │ ├── GetDifBlocks.cs │ └── JpegZip.cs ├── CommandProcess │ └── CmdProcess.cs ├── ControlServer1.0.csproj ├── CopyScreenAndBitmapTools │ ├── Compress2JepgWithQty.cs │ └── CopyScreen.cs ├── DataPacket │ ├── ENUMS.cs │ ├── RecPacket.cs │ └── SendPacket.cs ├── DesktopDuplication │ ├── DesktopDuplicationException.cs │ ├── DesktopDuplicator.cs │ ├── DesktopFrame.cs │ ├── MovedRegion.cs │ └── PointerInfo.cs ├── ErrorMessage │ └── ErrorInfo.cs ├── ICSharpCode.SharpZLib │ ├── BZip2 │ │ ├── BZip2.cs │ │ ├── BZip2Constants.cs │ │ ├── BZip2Exception.cs │ │ ├── BZip2InputStream.cs │ │ └── BZip2OutputStream.cs │ ├── Checksums │ │ ├── Adler32.cs │ │ ├── Crc32.cs │ │ ├── IChecksum.cs │ │ └── StrangeCrc.cs │ ├── Core │ │ ├── FileSystemScanner.cs │ │ ├── INameTransform.cs │ │ ├── IScanFilter.cs │ │ ├── NameFilter.cs │ │ ├── PathFilter.cs │ │ ├── StreamUtils.cs │ │ └── WindowsPathUtils.cs │ ├── Encryption │ │ ├── PkzipClassic.cs │ │ ├── ZipAESStream.cs │ │ └── ZipAESTransform.cs │ ├── GZip │ │ ├── GZipConstants.cs │ │ ├── GZipException.cs │ │ ├── GzipInputStream.cs │ │ └── GzipOutputStream.cs │ ├── ICSharpCode.SharpZLib.csproj │ ├── ICSharpCode.SharpZLib.prjx │ ├── Lzw │ │ ├── LzwConstants.cs │ │ ├── LzwException.cs │ │ └── LzwInputStream.cs │ ├── Main.cs │ ├── SharpZipBaseException.cs │ ├── Tar │ │ ├── InvalidHeaderException.cs │ │ ├── TarArchive.cs │ │ ├── TarBuffer.cs │ │ ├── TarEntry.cs │ │ ├── TarException.cs │ │ ├── TarHeader.cs │ │ ├── TarInputStream.cs │ │ └── TarOutputStream.cs │ └── Zip │ │ ├── Compression │ │ ├── Deflater.cs │ │ ├── DeflaterConstants.cs │ │ ├── DeflaterEngine.cs │ │ ├── DeflaterHuffman.cs │ │ ├── DeflaterPending.cs │ │ ├── Inflater.cs │ │ ├── InflaterDynHeader.cs │ │ ├── InflaterHuffmanTree.cs │ │ ├── PendingBuffer.cs │ │ └── Streams │ │ │ ├── DeflaterOutputStream.cs │ │ │ ├── InflaterInputStream.cs │ │ │ ├── OutputWindow.cs │ │ │ └── StreamManipulator.cs │ │ ├── FastZip.cs │ │ ├── IEntryFactory.cs │ │ ├── WindowsNameTransform.cs │ │ ├── ZipConstants.cs │ │ ├── ZipEntry.cs │ │ ├── ZipEntryFactory.cs │ │ ├── ZipException.cs │ │ ├── ZipExtraData.cs │ │ ├── ZipFile.cs │ │ ├── ZipHelperStream.cs │ │ ├── ZipInputStream.cs │ │ ├── ZipNameTransform.cs │ │ └── ZipOutputStream.cs ├── Images │ ├── App.ico │ └── App.jpg ├── OSInfos │ └── OperatingSystemInfos.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── ScreenBitmap │ ├── BitmapWithCursor.cs │ ├── DifferentBitmapWithCursor.cs │ ├── ShortPoint.cs │ └── ShortRec.cs ├── ServerForm.Designer.cs ├── ServerForm.cs ├── ServerForm.resx ├── StreamLine │ └── BlockingQueue.cs ├── app.config ├── libs │ ├── LZ4Sharp.dll │ ├── LZOHelper.dll │ ├── Note.txt │ ├── SharpDX.DXGI.dll │ ├── SharpDX.Direct3D11.dll │ ├── SharpDX.dll │ ├── Simplicit.Net.Lzo.dll │ ├── lzo.dll │ └── lzo2.dll └── server.ico ├── DXGI desktop duplication sample ├── .DS_Store ├── C++ │ ├── CommonTypes.h │ ├── DesktopDuplication.cpp │ ├── DesktopDuplication.sln │ ├── DesktopDuplication.vcxproj │ ├── DisplayManager.cpp │ ├── DisplayManager.h │ ├── DuplicationManager.cpp │ ├── DuplicationManager.h │ ├── OutputManager.cpp │ ├── OutputManager.h │ ├── PixelShader.hlsl │ ├── ThreadManager.cpp │ ├── ThreadManager.h │ └── VertexShader.hlsl ├── description.html ├── description │ ├── .DS_Store │ ├── Brand.css │ ├── Combined.css │ ├── Galleries.css │ ├── Layout.css │ ├── a7d1e078-8570-47da-a87b-ff462dfc958dCombined.css │ ├── iframedescription.css │ └── offline.js └── license.rtf ├── Great reference projects ├── AForge.zip └── LinXSplit.rar ├── LICENSE ├── README.md ├── RemoteControl_PC.sln └── TestProject ├── BitmapTool.cs ├── BlockQueue.cs ├── ComparerTest.csproj ├── Core └── ImageComparer.cs ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── ICSharpCode.SharpZLib ├── BZip2 │ ├── BZip2.cs │ ├── BZip2Constants.cs │ ├── BZip2Exception.cs │ ├── BZip2InputStream.cs │ └── BZip2OutputStream.cs ├── Checksums │ ├── Adler32.cs │ ├── CRC32.cs │ ├── IChecksum.cs │ └── StrangeCRC.cs ├── Core │ ├── FileSystemScanner.cs │ ├── INameTransform.cs │ ├── IScanFilter.cs │ ├── NameFilter.cs │ ├── PathFilter.cs │ ├── StreamUtils.cs │ └── WindowsPathUtils.cs ├── Encryption │ └── PkzipClassic.cs ├── GZip │ ├── GZIPConstants.cs │ ├── GZipException.cs │ ├── GzipInputStream.cs │ └── GzipOutputStream.cs ├── ICSharpCode.SharpZLib.csproj ├── ICSharpCode.SharpZLib.prjx ├── Main.cs ├── SharpZipBaseException.cs ├── Tar │ ├── InvalidHeaderException.cs │ ├── TarArchive.cs │ ├── TarBuffer.cs │ ├── TarEntry.cs │ ├── TarException.cs │ ├── TarHeader.cs │ ├── TarInputStream.cs │ └── TarOutputStream.cs └── Zip │ ├── Compression │ ├── Deflater.cs │ ├── DeflaterConstants.cs │ ├── DeflaterEngine.cs │ ├── DeflaterHuffman.cs │ ├── DeflaterPending.cs │ ├── Inflater.cs │ ├── InflaterDynHeader.cs │ ├── InflaterHuffmanTree.cs │ ├── PendingBuffer.cs │ └── Streams │ │ ├── DeflaterOutputStream.cs │ │ ├── InflaterInputStream.cs │ │ ├── OutputWindow.cs │ │ └── StreamManipulator.cs │ ├── FastZip.cs │ ├── IEntryFactory.cs │ ├── WindowsNameTransform.cs │ ├── ZipConstants.cs │ ├── ZipEntry.cs │ ├── ZipEntryFactory.cs │ ├── ZipException.cs │ ├── ZipExtraData.cs │ ├── ZipFile.cs │ ├── ZipHelperStream.cs │ ├── ZipInputStream.cs │ ├── ZipNameTransform.cs │ └── ZipOutputStream.cs ├── ImageComparer.sln ├── Program.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings ├── Resources └── win10.jpg ├── app.config ├── libs ├── LZ4Sharp.dll ├── Simplicit.Net.Lzo.dll ├── lzo.dll └── lzo2.dll ├── sshot-1.bmp └── sshot-2.bmp /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studo 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | *_i.c 42 | *_p.c 43 | *_i.h 44 | *.ilk 45 | *.meta 46 | *.obj 47 | *.pch 48 | *.pdb 49 | *.pgc 50 | *.pgd 51 | *.rsp 52 | *.sbr 53 | *.tlb 54 | *.tli 55 | *.tlh 56 | *.tmp 57 | *.tmp_proj 58 | *.log 59 | *.vspscc 60 | *.vssscc 61 | .builds 62 | *.pidb 63 | *.svclog 64 | *.scc 65 | 66 | # Chutzpah Test files 67 | _Chutzpah* 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | *.cachefile 76 | 77 | # Visual Studio profiler 78 | *.psess 79 | *.vsp 80 | *.vspx 81 | 82 | # TFS 2012 Local Workspace 83 | $tf/ 84 | 85 | # Guidance Automation Toolkit 86 | *.gpState 87 | 88 | # ReSharper is a .NET coding add-in 89 | _ReSharper*/ 90 | *.[Rr]e[Ss]harper 91 | *.DotSettings.user 92 | 93 | # JustCode is a .NET coding addin-in 94 | .JustCode 95 | 96 | # TeamCity is a build add-in 97 | _TeamCity* 98 | 99 | # DotCover is a Code Coverage Tool 100 | *.dotCover 101 | 102 | # NCrunch 103 | _NCrunch_* 104 | .*crunch*.local.xml 105 | 106 | # MightyMoose 107 | *.mm.* 108 | AutoTest.Net/ 109 | 110 | # Web workbench (sass) 111 | .sass-cache/ 112 | 113 | # Installshield output folder 114 | [Ee]xpress/ 115 | 116 | # DocProject is a documentation generator add-in 117 | DocProject/buildhelp/ 118 | DocProject/Help/*.HxT 119 | DocProject/Help/*.HxC 120 | DocProject/Help/*.hhc 121 | DocProject/Help/*.hhk 122 | DocProject/Help/*.hhp 123 | DocProject/Help/Html2 124 | DocProject/Help/html 125 | 126 | # Click-Once directory 127 | publish/ 128 | 129 | # Publish Web Output 130 | *.[Pp]ublish.xml 131 | *.azurePubxml 132 | # TODO: Comment the next line if you want to checkin your web deploy settings 133 | # but database connection strings (with potential passwords) will be unencrypted 134 | *.pubxml 135 | *.publishproj 136 | 137 | # NuGet Packages 138 | *.nupkg 139 | # The packages folder can be ignored because of Package Restore 140 | **/packages/* 141 | # except build/, which is used as an MSBuild target. 142 | !**/packages/build/ 143 | # Uncomment if necessary however generally it will be regenerated when needed 144 | #!**/packages/repositories.config 145 | 146 | # Windows Azure Build Output 147 | csx/ 148 | *.build.csdef 149 | 150 | # Windows Store app package directory 151 | AppPackages/ 152 | 153 | # Others 154 | *.[Cc]ache 155 | ClientBin/ 156 | [Ss]tyle[Cc]op.* 157 | ~$* 158 | *~ 159 | *.dbmdl 160 | *.dbproj.schemaview 161 | *.pfx 162 | *.publishsettings 163 | node_modules/ 164 | bower_components/ 165 | 166 | # RIA/Silverlight projects 167 | Generated_Code/ 168 | 169 | # Backup & report files from converting an old project file 170 | # to a newer Visual Studio version. Backup files are not needed, 171 | # because we have git ;-) 172 | _UpgradeReport_Files/ 173 | Backup*/ 174 | UpgradeLog*.XML 175 | UpgradeLog*.htm 176 | 177 | # SQL Server files 178 | *.mdf 179 | *.ldf 180 | 181 | # Business Intelligence projects 182 | *.rdl.data 183 | *.bim.layout 184 | *.bim_*.settings 185 | 186 | # Microsoft Fakes 187 | FakesAssemblies/ 188 | 189 | # Node.js Tools for Visual Studio 190 | .ntvs_analysis.dat 191 | 192 | # Visual Studio 6 build log 193 | *.plg 194 | 195 | # Visual Studio 6 workspace options file 196 | *.opt 197 | -------------------------------------------------------------------------------- /ControlClient1.0/DataPacket/SendPacket.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ControlClient1._0.DataPacket 7 | { 8 | class SendPacket 9 | { 10 | public ENUMS.MESSAGETYPE type; 11 | public ENUMS.SPECIALKEYS key; 12 | public int intValue1; 13 | public int intValue2; 14 | public String stringValue; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ControlClient1.0/ErrorMessage/ErrorInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace ControlClient1._0.ErrorMessage 8 | { 9 | class ErrorInfo 10 | { 11 | private static readonly object lockHelper = new object();//线程安全 12 | private const string errorOutputFilePath = "ErrorMessage.txt"; 13 | private bool isErrorOn=true; 14 | private volatile static ErrorInfo instance = null; 15 | private ErrorInfo() { } 16 | public static ErrorInfo getErrorWriter() 17 | { 18 | if (instance == null) 19 | { 20 | lock (lockHelper) 21 | { 22 | if(instance==null) 23 | instance=new ErrorInfo(); 24 | } 25 | } 26 | return instance; 27 | } 28 | 29 | public void writeErrorMassageToFile(String message) 30 | { 31 | lock (this) 32 | { 33 | if (isErrorOn) 34 | { 35 | try 36 | { 37 | FileStream fs = new FileStream(errorOutputFilePath, FileMode.Append); 38 | if (fs.Length > 1024 * 1024) 39 | { 40 | fs.Close(); 41 | fs = new FileStream(errorOutputFilePath, FileMode.Create); 42 | } 43 | StreamWriter sw = new StreamWriter(fs, Encoding.Default); 44 | sw.Write(DateTime.Now.ToLocalTime()+":"+message); 45 | sw.WriteLine(); 46 | sw.Close(); 47 | fs.Close(); 48 | } 49 | catch (IOException ex) 50 | { 51 | Console.WriteLine(ex.Message); 52 | } 53 | catch (Exception ex2) 54 | { 55 | Console.WriteLine(ex2.Message); 56 | } 57 | } 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/BZip2/BZip2Exception.cs: -------------------------------------------------------------------------------- 1 | // BZip2.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | namespace ICSharpCode.SharpZipLib.BZip2 43 | { 44 | /// 45 | /// BZip2Exception represents exceptions specific to Bzip2 algorithm 46 | /// 47 | #if !NETCF_1_0 && !NETCF_2_0 48 | [Serializable] 49 | #endif 50 | public class BZip2Exception : SharpZipBaseException 51 | { 52 | 53 | #if !NETCF_1_0 && !NETCF_2_0 54 | /// 55 | /// Deserialization constructor 56 | /// 57 | /// for this constructor 58 | /// for this constructor 59 | protected BZip2Exception(SerializationInfo info, StreamingContext context) 60 | : base(info, context) 61 | 62 | { 63 | } 64 | #endif 65 | /// 66 | /// Initialise a new instance of BZip2Exception. 67 | /// 68 | public BZip2Exception() 69 | { 70 | } 71 | 72 | /// 73 | /// Initialise a new instance of BZip2Exception with its message set to message. 74 | /// 75 | /// The message describing the error. 76 | public BZip2Exception(string message) : base(message) 77 | { 78 | } 79 | 80 | /// 81 | /// Initialise an instance of BZip2Exception 82 | /// 83 | /// A message describing the error. 84 | /// The exception that is the cause of the current exception. 85 | public BZip2Exception(string message, Exception exception) 86 | : base(message, exception) 87 | { 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/Checksums/IChecksum.cs: -------------------------------------------------------------------------------- 1 | // IChecksum.cs - Interface to compute a data checksum 2 | // Copyright (C) 2001 Mike Krueger 3 | // 4 | // This file was translated from java, it was part of the GNU Classpath 5 | // Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 6 | // 7 | // This program is free software; you can redistribute it and/or 8 | // modify it under the terms of the GNU General Public License 9 | // as published by the Free Software Foundation; either version 2 10 | // of the License, or (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program; if not, write to the Free Software 19 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | // 21 | // Linking this library statically or dynamically with other modules is 22 | // making a combined work based on this library. Thus, the terms and 23 | // conditions of the GNU General Public License cover the whole 24 | // combination. 25 | // 26 | // As a special exception, the copyright holders of this library give you 27 | // permission to link this library with independent modules to produce an 28 | // executable, regardless of the license terms of these independent 29 | // modules, and to copy and distribute the resulting executable under 30 | // terms of your choice, provided that you also meet, for each linked 31 | // independent module, the terms and conditions of the license of that 32 | // module. An independent module is a module which is not derived from 33 | // or based on this library. If you modify this library, you may extend 34 | // this exception to your version of the library, but you are not 35 | // obligated to do so. If you do not wish to do so, delete this 36 | // exception statement from your version. 37 | 38 | namespace ICSharpCode.SharpZipLib.Checksums 39 | { 40 | 41 | /// 42 | /// Interface to compute a data checksum used by checked input/output streams. 43 | /// A data checksum can be updated by one byte or with a byte array. After each 44 | /// update the value of the current checksum can be returned by calling 45 | /// getValue. The complete checksum object can also be reset 46 | /// so it can be used again with new data. 47 | /// 48 | public interface IChecksum 49 | { 50 | /// 51 | /// Returns the data checksum computed so far. 52 | /// 53 | long Value 54 | { 55 | get; 56 | } 57 | 58 | /// 59 | /// Resets the data checksum as if no update was ever called. 60 | /// 61 | void Reset(); 62 | 63 | /// 64 | /// Adds one byte to the data checksum. 65 | /// 66 | /// 67 | /// the data value to add. The high byte of the int is ignored. 68 | /// 69 | void Update(int value); 70 | 71 | /// 72 | /// Updates the data checksum with the bytes taken from the array. 73 | /// 74 | /// 75 | /// buffer an array of bytes 76 | /// 77 | void Update(byte[] buffer); 78 | 79 | /// 80 | /// Adds the byte array to the data checksum. 81 | /// 82 | /// 83 | /// The buffer which contains the data 84 | /// 85 | /// 86 | /// The offset in the buffer where the data starts 87 | /// 88 | /// 89 | /// the number of data bytes to add. 90 | /// 91 | void Update(byte[] buffer, int offset, int count); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/Core/INameTransform.cs: -------------------------------------------------------------------------------- 1 | // INameTransform.cs 2 | // 3 | // Copyright 2005 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | namespace ICSharpCode.SharpZipLib.Core 37 | { 38 | /// 39 | /// INameTransform defines how file system names are transformed for use with archives, or vice versa. 40 | /// 41 | public interface INameTransform 42 | { 43 | /// 44 | /// Given a file name determine the transformed value. 45 | /// 46 | /// The name to transform. 47 | /// The transformed file name. 48 | string TransformFile(string name); 49 | 50 | /// 51 | /// Given a directory name determine the transformed value. 52 | /// 53 | /// The name to transform. 54 | /// The transformed directory name 55 | string TransformDirectory(string name); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/Core/IScanFilter.cs: -------------------------------------------------------------------------------- 1 | // IScanFilter.cs 2 | // 3 | // Copyright 2006 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | namespace ICSharpCode.SharpZipLib.Core 37 | { 38 | /// 39 | /// Scanning filters support filtering of names. 40 | /// 41 | public interface IScanFilter 42 | { 43 | /// 44 | /// Test a name to see if it 'matches' the filter. 45 | /// 46 | /// The name to test. 47 | /// Returns true if the name matches the filter, false if it does not match. 48 | bool IsMatch(string name); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/Core/WindowsPathUtils.cs: -------------------------------------------------------------------------------- 1 | // WindowsPathUtils.cs 2 | // 3 | // Copyright 2007 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | namespace ICSharpCode.SharpZipLib.Core 37 | { 38 | /// 39 | /// WindowsPathUtils provides simple utilities for handling windows paths. 40 | /// 41 | public abstract class WindowsPathUtils 42 | { 43 | /// 44 | /// Initializes a new instance of the class. 45 | /// 46 | internal WindowsPathUtils() 47 | { 48 | } 49 | 50 | /// 51 | /// Remove any path root present in the path 52 | /// 53 | /// A containing path information. 54 | /// The path with the root removed if it was present; path otherwise. 55 | /// Unlike the class the path isnt otherwise checked for validity. 56 | public static string DropPathRoot(string path) 57 | { 58 | string result = path; 59 | 60 | if ( (path != null) && (path.Length > 0) ) { 61 | if ((path[0] == '\\') || (path[0] == '/')) { 62 | // UNC name ? 63 | if ((path.Length > 1) && ((path[1] == '\\') || (path[1] == '/'))) { 64 | int index = 2; 65 | int elements = 2; 66 | 67 | // Scan for two separate elements \\machine\share\restofpath 68 | while ((index <= path.Length) && 69 | (((path[index] != '\\') && (path[index] != '/')) || (--elements > 0))) { 70 | index++; 71 | } 72 | 73 | index++; 74 | 75 | if (index < path.Length) { 76 | result = path.Substring(index); 77 | } 78 | else { 79 | result = ""; 80 | } 81 | } 82 | } 83 | else if ((path.Length > 1) && (path[1] == ':')) { 84 | int dropCount = 2; 85 | if ((path.Length > 2) && ((path[2] == '\\') || (path[2] == '/'))) { 86 | dropCount = 3; 87 | } 88 | result = result.Remove(0, dropCount); 89 | } 90 | } 91 | return result; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/GZip/GZipConstants.cs: -------------------------------------------------------------------------------- 1 | // GZipConstants.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // 5 | // This file was translated from java, it was part of the GNU Classpath 6 | // Copyright (C) 2001 Free Software Foundation, Inc. 7 | // 8 | // This program is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU General Public License 10 | // as published by the Free Software Foundation; either version 2 11 | // of the License, or (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | // 22 | // Linking this library statically or dynamically with other modules is 23 | // making a combined work based on this library. Thus, the terms and 24 | // conditions of the GNU General Public License cover the whole 25 | // combination. 26 | // 27 | // As a special exception, the copyright holders of this library give you 28 | // permission to link this library with independent modules to produce an 29 | // executable, regardless of the license terms of these independent 30 | // modules, and to copy and distribute the resulting executable under 31 | // terms of your choice, provided that you also meet, for each linked 32 | // independent module, the terms and conditions of the license of that 33 | // module. An independent module is a module which is not derived from 34 | // or based on this library. If you modify this library, you may extend 35 | // this exception to your version of the library, but you are not 36 | // obligated to do so. If you do not wish to do so, delete this 37 | // exception statement from your version. 38 | 39 | namespace ICSharpCode.SharpZipLib.GZip 40 | { 41 | 42 | /// 43 | /// This class contains constants used for gzip. 44 | /// 45 | sealed public class GZipConstants 46 | { 47 | /// 48 | /// Magic number found at start of GZIP header 49 | /// 50 | public const int GZIP_MAGIC = 0x1F8B; 51 | 52 | /* The flag byte is divided into individual bits as follows: 53 | 54 | bit 0 FTEXT 55 | bit 1 FHCRC 56 | bit 2 FEXTRA 57 | bit 3 FNAME 58 | bit 4 FCOMMENT 59 | bit 5 reserved 60 | bit 6 reserved 61 | bit 7 reserved 62 | */ 63 | 64 | /// 65 | /// Flag bit mask for text 66 | /// 67 | public const int FTEXT = 0x1; 68 | 69 | /// 70 | /// Flag bitmask for Crc 71 | /// 72 | public const int FHCRC = 0x2; 73 | 74 | /// 75 | /// Flag bit mask for extra 76 | /// 77 | public const int FEXTRA = 0x4; 78 | 79 | /// 80 | /// flag bitmask for name 81 | /// 82 | public const int FNAME = 0x8; 83 | 84 | /// 85 | /// flag bit mask indicating comment is present 86 | /// 87 | public const int FCOMMENT = 0x10; 88 | 89 | /// 90 | /// Initialise default instance. 91 | /// 92 | /// Constructor is private to prevent instances being created. 93 | GZipConstants() 94 | { 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/GZip/GZipException.cs: -------------------------------------------------------------------------------- 1 | // GZipException.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | namespace ICSharpCode.SharpZipLib.GZip 43 | { 44 | /// 45 | /// GZipException represents a Gzip specific exception 46 | /// 47 | #if !NETCF_1_0 && !NETCF_2_0 48 | [Serializable] 49 | #endif 50 | public class GZipException : SharpZipBaseException 51 | { 52 | #if !NETCF_1_0 && !NETCF_2_0 53 | /// 54 | /// Deserialization constructor 55 | /// 56 | /// for this constructor 57 | /// for this constructor 58 | protected GZipException(SerializationInfo info, StreamingContext context) 59 | : base(info, context) 60 | 61 | { 62 | } 63 | #endif 64 | 65 | /// 66 | /// Initialise a new instance of GZipException 67 | /// 68 | public GZipException() 69 | { 70 | } 71 | 72 | /// 73 | /// Initialise a new instance of GZipException with its message string. 74 | /// 75 | /// A that describes the error. 76 | public GZipException(string message) 77 | : base(message) 78 | { 79 | } 80 | 81 | /// 82 | /// Initialise a new instance of . 83 | /// 84 | /// A that describes the error. 85 | /// The that caused this exception. 86 | public GZipException(string message, Exception innerException) 87 | : base (message, innerException) 88 | { 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/Lzw/LzwConstants.cs: -------------------------------------------------------------------------------- 1 | // LzwConstants.cs 2 | // 3 | // Copyright (C) 2009 Gabriel Burca 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | namespace ICSharpCode.SharpZipLib.LZW { 37 | 38 | /// 39 | /// This class contains constants used for LZW 40 | /// 41 | sealed public class LzwConstants { 42 | /// 43 | /// Magic number found at start of LZW header: 0x1f 0x9d 44 | /// 45 | public const int MAGIC = 0x1f9d; 46 | 47 | /// 48 | /// Maximum number of bits per code 49 | /// 50 | public const int MAX_BITS = 16; 51 | 52 | /* 3rd header byte: 53 | * bit 0..4 Number of compression bits 54 | * bit 5 Extended header 55 | * bit 6 Free 56 | * bit 7 Block mode 57 | */ 58 | 59 | /// 60 | /// Mask for 'number of compression bits' 61 | /// 62 | public const int BIT_MASK = 0x1f; 63 | 64 | /// 65 | /// Indicates the presence of a fourth header byte 66 | /// 67 | public const int EXTENDED_MASK = 0x20; 68 | //public const int FREE_MASK = 0x40; 69 | 70 | /// 71 | /// Reserved bits 72 | /// 73 | public const int RESERVED_MASK = 0x60; 74 | 75 | /// 76 | /// Block compression: if table is full and compression rate is dropping, 77 | /// clear the dictionary. 78 | /// 79 | public const int BLOCK_MODE_MASK = 0x80; 80 | 81 | /// 82 | /// LZW file header size (in bytes) 83 | /// 84 | public const int HDR_SIZE = 3; 85 | 86 | /// 87 | /// Initial number of bits per code 88 | /// 89 | public const int INIT_BITS = 9; 90 | 91 | LzwConstants() { 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/Lzw/LzwException.cs: -------------------------------------------------------------------------------- 1 | // LzwException.cs 2 | // 3 | // Copyright (C) 2009 Gabriel Burca 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | namespace ICSharpCode.SharpZipLib.LZW 43 | { 44 | 45 | /// 46 | /// LzwException represents a LZW specific exception 47 | /// 48 | #if !NETCF_1_0 && !NETCF_2_0 49 | [Serializable] 50 | #endif 51 | public class LzwException : SharpZipBaseException 52 | { 53 | 54 | #if !NETCF_1_0 && !NETCF_2_0 55 | /// 56 | /// Deserialization constructor 57 | /// 58 | /// for this constructor 59 | /// for this constructor 60 | protected LzwException(SerializationInfo info, StreamingContext context) 61 | : base(info, context) { 62 | } 63 | #endif 64 | 65 | /// 66 | /// Initialise a new instance of LzwException 67 | /// 68 | public LzwException() { 69 | } 70 | 71 | /// 72 | /// Initialise a new instance of LzwException with its message string. 73 | /// 74 | /// A that describes the error. 75 | public LzwException(string message) 76 | : base(message) { 77 | } 78 | 79 | /// 80 | /// Initialise a new instance of . 81 | /// 82 | /// A that describes the error. 83 | /// The that caused this exception. 84 | public LzwException(string message, Exception innerException) 85 | : base(message, innerException) { 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/Main.cs: -------------------------------------------------------------------------------- 1 | // Main.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | // 36 | 37 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/SharpZipBaseException.cs: -------------------------------------------------------------------------------- 1 | // SharpZipBaseException.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | namespace ICSharpCode.SharpZipLib 43 | { 44 | /// 45 | /// SharpZipBaseException is the base exception class for the SharpZipLibrary. 46 | /// All library exceptions are derived from this. 47 | /// 48 | /// NOTE: Not all exceptions thrown will be derived from this class. 49 | /// A variety of other exceptions are possible for example 50 | #if !NETCF_1_0 && !NETCF_2_0 51 | [Serializable] 52 | #endif 53 | public class SharpZipBaseException : ApplicationException 54 | { 55 | #if !NETCF_1_0 && !NETCF_2_0 56 | /// 57 | /// Deserialization constructor 58 | /// 59 | /// for this constructor 60 | /// for this constructor 61 | protected SharpZipBaseException(SerializationInfo info, StreamingContext context ) 62 | : base( info, context ) 63 | { 64 | } 65 | #endif 66 | 67 | /// 68 | /// Initializes a new instance of the SharpZipBaseException class. 69 | /// 70 | public SharpZipBaseException() 71 | { 72 | } 73 | 74 | /// 75 | /// Initializes a new instance of the SharpZipBaseException class with a specified error message. 76 | /// 77 | /// A message describing the exception. 78 | public SharpZipBaseException(string message) 79 | : base(message) 80 | { 81 | } 82 | 83 | /// 84 | /// Initializes a new instance of the SharpZipBaseException class with a specified 85 | /// error message and a reference to the inner exception that is the cause of this exception. 86 | /// 87 | /// A message describing the exception. 88 | /// The inner exception 89 | public SharpZipBaseException(string message, Exception innerException) 90 | : base(message, innerException) 91 | { 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/Tar/TarException.cs: -------------------------------------------------------------------------------- 1 | // TarException.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | namespace ICSharpCode.SharpZipLib.Tar { 43 | 44 | /// 45 | /// TarExceptions are used for exceptions specific to tar classes and code. 46 | /// 47 | #if !NETCF_1_0 && !NETCF_2_0 48 | [Serializable] 49 | #endif 50 | public class TarException : SharpZipBaseException 51 | { 52 | #if !NETCF_1_0 && !NETCF_2_0 53 | /// 54 | /// Deserialization constructor 55 | /// 56 | /// for this constructor 57 | /// for this constructor 58 | protected TarException(SerializationInfo info, StreamingContext context) 59 | : base(info, context) 60 | 61 | { 62 | } 63 | #endif 64 | 65 | /// 66 | /// Initialises a new instance of the TarException class. 67 | /// 68 | public TarException() 69 | { 70 | } 71 | 72 | /// 73 | /// Initialises a new instance of the TarException class with a specified message. 74 | /// 75 | /// The message that describes the error. 76 | public TarException(string message) 77 | : base(message) 78 | { 79 | } 80 | 81 | /// 82 | /// 83 | /// 84 | /// A message describing the error. 85 | /// The exception that is the cause of the current exception. 86 | public TarException(string message, Exception exception) 87 | : base(message, exception) 88 | { 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/Zip/Compression/DeflaterPending.cs: -------------------------------------------------------------------------------- 1 | // DeflaterPending.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // Copyright (C) 2004 John Reilly 5 | // 6 | // This file was translated from java, it was part of the GNU Classpath 7 | // Copyright (C) 2001 Free Software Foundation, Inc. 8 | // 9 | // This program is free software; you can redistribute it and/or 10 | // modify it under the terms of the GNU General Public License 11 | // as published by the Free Software Foundation; either version 2 12 | // of the License, or (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with this program; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | // 23 | // Linking this library statically or dynamically with other modules is 24 | // making a combined work based on this library. Thus, the terms and 25 | // conditions of the GNU General Public License cover the whole 26 | // combination. 27 | // 28 | // As a special exception, the copyright holders of this library give you 29 | // permission to link this library with independent modules to produce an 30 | // executable, regardless of the license terms of these independent 31 | // modules, and to copy and distribute the resulting executable under 32 | // terms of your choice, provided that you also meet, for each linked 33 | // independent module, the terms and conditions of the license of that 34 | // module. An independent module is a module which is not derived from 35 | // or based on this library. If you modify this library, you may extend 36 | // this exception to your version of the library, but you are not 37 | // obligated to do so. If you do not wish to do so, delete this 38 | // exception statement from your version. 39 | 40 | namespace ICSharpCode.SharpZipLib.Zip.Compression 41 | { 42 | 43 | /// 44 | /// This class stores the pending output of the Deflater. 45 | /// 46 | /// author of the original java version : Jochen Hoenicke 47 | /// 48 | public class DeflaterPending : PendingBuffer 49 | { 50 | /// 51 | /// Construct instance with default buffer size 52 | /// 53 | public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE) 54 | { 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ControlClient1.0/ICSharpCode.SharpZLib/Zip/ZipException.cs: -------------------------------------------------------------------------------- 1 | // ZipException.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // 5 | // This file was translated from java, it was part of the GNU Classpath 6 | // Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. 7 | // 8 | // This program is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU General Public License 10 | // as published by the Free Software Foundation; either version 2 11 | // of the License, or (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | // 22 | // Linking this library statically or dynamically with other modules is 23 | // making a combined work based on this library. Thus, the terms and 24 | // conditions of the GNU General Public License cover the whole 25 | // combination. 26 | // 27 | // As a special exception, the copyright holders of this library give you 28 | // permission to link this library with independent modules to produce an 29 | // executable, regardless of the license terms of these independent 30 | // modules, and to copy and distribute the resulting executable under 31 | // terms of your choice, provided that you also meet, for each linked 32 | // independent module, the terms and conditions of the license of that 33 | // module. An independent module is a module which is not derived from 34 | // or based on this library. If you modify this library, you may extend 35 | // this exception to your version of the library, but you are not 36 | // obligated to do so. If you do not wish to do so, delete this 37 | // exception statement from your version. 38 | 39 | using System; 40 | 41 | #if !NETCF_1_0 && !NETCF_2_0 42 | using System.Runtime.Serialization; 43 | #endif 44 | 45 | namespace ICSharpCode.SharpZipLib.Zip 46 | { 47 | 48 | /// 49 | /// Represents exception conditions specific to Zip archive handling 50 | /// 51 | #if !NETCF_1_0 && !NETCF_2_0 52 | [Serializable] 53 | #endif 54 | public class ZipException : SharpZipBaseException 55 | { 56 | #if !NETCF_1_0 && !NETCF_2_0 57 | /// 58 | /// Deserialization constructor 59 | /// 60 | /// for this constructor 61 | /// for this constructor 62 | protected ZipException(SerializationInfo info, StreamingContext context ) 63 | : base( info, context ) 64 | { 65 | } 66 | #endif 67 | 68 | /// 69 | /// Initializes a new instance of the ZipException class. 70 | /// 71 | public ZipException() 72 | { 73 | } 74 | 75 | /// 76 | /// Initializes a new instance of the ZipException class with a specified error message. 77 | /// 78 | /// The error message that explains the reason for the exception. 79 | public ZipException(string message) 80 | : base(message) 81 | { 82 | } 83 | 84 | /// 85 | /// Initialise a new instance of ZipException. 86 | /// 87 | /// A message describing the error. 88 | /// The exception that is the cause of the current exception. 89 | public ZipException(string message, Exception exception) 90 | : base(message, exception) 91 | { 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /ControlClient1.0/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace ControlClient1._0 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// 应用程序的主入口点。 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new ClientForm()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ControlClient1.0/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("ControlClient1.0")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ControlClient1.0")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 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("a5abb31d-e528-49b3-9294-b2e2329d5848")] 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 | -------------------------------------------------------------------------------- /ControlClient1.0/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ControlClient1._0.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("ControlClient1._0.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 | -------------------------------------------------------------------------------- /ControlClient1.0/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ControlClient1._0.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 | -------------------------------------------------------------------------------- /ControlClient1.0/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ControlClient1.0/ScreenBitmap/BitmapWithCursor.cs: -------------------------------------------------------------------------------- 1 | using ControlClient1._0.ReceivePacket; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.Drawing.Imaging; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Text; 9 | 10 | namespace ControlClient1._0.ScreenBitmap 11 | { 12 | class BitmapWithCursor 13 | { 14 | private ShortPoint cursorPoisiton = null; 15 | private Bitmap screenBitmap=null; 16 | private RecPacket.PacketType packetType; 17 | private String stringValue; 18 | 19 | 20 | public void setStringValue(String stringValue) 21 | { 22 | this.stringValue = stringValue; 23 | } 24 | public String getStringValue() 25 | { 26 | return this.stringValue; 27 | } 28 | 29 | public void setPacketType(RecPacket.PacketType packetType) 30 | { 31 | this.packetType = packetType; 32 | } 33 | public RecPacket.PacketType getPacketType() 34 | { 35 | return this.packetType; 36 | } 37 | 38 | public void setCursorPoint(ShortPoint point) 39 | { 40 | this.cursorPoisiton = point; 41 | } 42 | public ShortPoint getCursorPoint() 43 | { 44 | return this.cursorPoisiton; 45 | } 46 | public void setScreenBitmap(Bitmap btm) 47 | { 48 | this.screenBitmap = btm; 49 | } 50 | public Bitmap getScreenBitmap() 51 | { 52 | return this.screenBitmap; 53 | } 54 | 55 | 56 | 57 | public void releaseScreenBitmap() 58 | { 59 | this.screenBitmap.Dispose(); 60 | this.screenBitmap = null; 61 | 62 | } 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /ControlClient1.0/ScreenBitmap/DifferentBitmapWithCursor.cs: -------------------------------------------------------------------------------- 1 | using ControlClient1._0.DataPacket; 2 | using ControlClient1._0.ReceivePacket; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | 9 | namespace ControlClient1._0.ScreenBitmap 10 | { 11 | class DifferentBitmapWithCursor 12 | { 13 | private Bitmap difBitmap; 14 | private ShortPoint cursorPoint; 15 | private List difPointsList; 16 | private RecPacket.BitmapType type; 17 | private RecPacket.PacketType packetType; 18 | private String stringValue; 19 | 20 | 21 | public void setStringValue(String stringValue) 22 | { 23 | this.stringValue = stringValue; 24 | } 25 | public String getStringValue() 26 | { 27 | return this.stringValue; 28 | } 29 | 30 | public void setPacketType(RecPacket.PacketType packetType) 31 | { 32 | this.packetType = packetType; 33 | } 34 | public RecPacket.PacketType getPacketType() 35 | { 36 | return this.packetType; 37 | } 38 | public Bitmap getDifBitmap() 39 | { 40 | return this.difBitmap; 41 | } 42 | public void setDifBitmap(Bitmap btm) 43 | { 44 | this.difBitmap = btm; 45 | } 46 | public ShortPoint getCursorPoint() 47 | { 48 | return this.cursorPoint; 49 | } 50 | public void setCursorPoint(ShortPoint cursorPoint) 51 | { 52 | this.cursorPoint = cursorPoint; 53 | } 54 | public List getDifPointsList() 55 | { 56 | return this.difPointsList; 57 | } 58 | public void setDifPointsList(List difPointsList) 59 | { 60 | this.difPointsList = difPointsList; 61 | } 62 | 63 | public void setBitmapType(RecPacket.BitmapType type) 64 | { 65 | this.type = type; 66 | } 67 | public RecPacket.BitmapType getBitmapType() 68 | { 69 | return this.type; 70 | } 71 | 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /ControlClient1.0/ScreenBitmap/ShortPoint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ControlClient1._0.ScreenBitmap 7 | { 8 | /**图像差异起始地址,需要配合block的大小进行图形复原*/ 9 | class ShortPoint 10 | { 11 | private short xPoint; 12 | private short yPoint; 13 | 14 | public ShortPoint(int xPoint, int yPoint) 15 | { 16 | this.xPoint = (short)xPoint; 17 | this.yPoint = (short)yPoint; 18 | } 19 | public short getXPoint() 20 | { 21 | return this.xPoint; 22 | } 23 | public short getYPoint() 24 | { 25 | return this.yPoint; 26 | } 27 | public void setXPoint(short xPoint) 28 | { 29 | this.xPoint = xPoint; 30 | } 31 | public void setYPoint(short yPoint) 32 | { 33 | this.yPoint = yPoint; 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ControlClient1.0/ScreenBitmap/ShortRec.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ControlClient1._0.ScreenBitmap 7 | { 8 | class ShortRec 9 | { 10 | public short xPoint; 11 | public short yPoint; 12 | public short width; 13 | public short height; 14 | 15 | public ShortRec(int x, int y, int w, int h) 16 | { 17 | this.xPoint = (short)x; 18 | this.yPoint = (short)y; 19 | this.width = (short)w; 20 | this.height = (short)h; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ControlClient1.0/StreamLine/BlockingQueue.cs: -------------------------------------------------------------------------------- 1 | using ControlClient1._0.ErrorMessage; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading; 7 | 8 | namespace ControlClient1._0.StreamLine 9 | {/**a blocking queue */ 10 | class BlockingQueue 11 | { 12 | private readonly Queue queue = null; 13 | private readonly int maxSize = 10; 14 | public BlockingQueue(int maxSize) { this.maxSize = maxSize; queue = new Queue(); } 15 | public int getQueueSize() 16 | { 17 | return queue.Count; 18 | } 19 | public void clearQueue() 20 | { 21 | lock(queue){ 22 | queue.Clear(); 23 | } 24 | } 25 | public void Enqueue(T item) 26 | { 27 | lock (queue) 28 | { 29 | while (queue.Count >= maxSize) 30 | { 31 | try 32 | { 33 | Monitor.Wait(queue); 34 | } 35 | catch (Exception ex) 36 | { 37 | ErrorInfo.getErrorWriter().writeErrorMassageToFile(ex.Message + ex.StackTrace); 38 | return; 39 | } 40 | } 41 | queue.Enqueue(item); 42 | if (queue.Count == 1) 43 | { 44 | // wake up any blocked dequeue 45 | Monitor.PulseAll(queue); 46 | } 47 | } 48 | } 49 | public T Dequeue() 50 | { 51 | lock (queue) 52 | { 53 | while (queue.Count == 0) 54 | { 55 | try 56 | { 57 | /**wait for add*/ 58 | Monitor.Wait(queue); 59 | } 60 | catch (Exception ex) 61 | { 62 | ErrorInfo.getErrorWriter().writeErrorMassageToFile(ex.Message + ex.StackTrace); 63 | return default(T); 64 | } 65 | } 66 | T item = queue.Dequeue(); 67 | if (queue.Count == maxSize - 1) 68 | { 69 | // wake up any blocked enqueue 70 | Monitor.PulseAll(queue); 71 | } 72 | return item; 73 | } 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /ControlClient1.0/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ControlClient1.0/client.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlClient1.0/client.ico -------------------------------------------------------------------------------- /ControlClient1.0/libs/LZ4Sharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlClient1.0/libs/LZ4Sharp.dll -------------------------------------------------------------------------------- /ControlClient1.0/libs/LZOHelper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlClient1.0/libs/LZOHelper.dll -------------------------------------------------------------------------------- /ControlClient1.0/libs/SharpDX.DXGI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlClient1.0/libs/SharpDX.DXGI.dll -------------------------------------------------------------------------------- /ControlClient1.0/libs/SharpDX.Direct3D11.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlClient1.0/libs/SharpDX.Direct3D11.dll -------------------------------------------------------------------------------- /ControlClient1.0/libs/SharpDX.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlClient1.0/libs/SharpDX.dll -------------------------------------------------------------------------------- /ControlClient1.0/libs/Simplicit.Net.Lzo.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlClient1.0/libs/Simplicit.Net.Lzo.dll -------------------------------------------------------------------------------- /ControlClient1.0/libs/lzo.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlClient1.0/libs/lzo.dll -------------------------------------------------------------------------------- /ControlClient1.0/libs/lzo2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlClient1.0/libs/lzo2.dll -------------------------------------------------------------------------------- /ControlServer1.0/App.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/App.ico -------------------------------------------------------------------------------- /ControlServer1.0/BitmapTools/JpegZip.cs: -------------------------------------------------------------------------------- 1 | using ICSharpCode.SharpZipLib.Zip; 2 | using Simplicit.Net.Lzo; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Drawing; 6 | using System.Drawing.Imaging; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Runtime.InteropServices; 10 | using System.Text; 11 | using System.Windows.Forms; 12 | 13 | namespace ControlServer1._0.BitmapTools 14 | { 15 | class JpegZip 16 | { 17 | 18 | private static LZOCompressor lzoCompress = new LZOCompressor(); 19 | public static byte[] jpegAndZip(Bitmap btm) 20 | { 21 | MemoryStream msIzip = new MemoryStream(); 22 | MemoryStream ms = new MemoryStream(); 23 | btm.Save(ms, ImageFormat.Jpeg); 24 | ms.Close(); 25 | byte[] retByte = lzoCompress.Compress(ms.ToArray()); 26 | /*zip compress ,it is cost too much cpu ,so we do not use this compress way. 27 | ZipOutputStream outZip = new ZipOutputStream(msIzip); 28 | outZip.SetLevel(9); 29 | outZip.PutNextEntry(new ZipEntry("KS")); 30 | byte[] temp=ms.ToArray(); 31 | outZip.Write(temp, 0, temp.Length); 32 | outZip.CloseEntry(); 33 | outZip.Close(); 34 | msIzip.Close(); 35 | return msIzip.ToArray(); 36 | * */ 37 | return retByte; 38 | 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ControlServer1.0/CopyScreenAndBitmapTools/Compress2JepgWithQty.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Imaging; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | 9 | namespace ControlServer1._0.CopyScreenAndBitmapTools 10 | { 11 | class Compress2JepgWithQty 12 | { 13 | private static EncoderParameter p; 14 | private static EncoderParameters ps; 15 | private static ImageCodecInfo[] CodecInfo; 16 | private static ImageCodecInfo result; 17 | static Compress2JepgWithQty() 18 | { 19 | 20 | CodecInfo = ImageCodecInfo.GetImageEncoders(); 21 | result = getcodecinfo("image/jpeg"); 22 | } 23 | /** 24 | * 25 | * 经过试验验证,同一幅图片只要是采用相同的压缩算法, 26 | * 最后得到的数据是完全一致的,所以完全可以先压缩在判断出图像的差异值, 27 | * 速度更快 28 | * 29 | */ 30 | private static ImageCodecInfo getcodecinfo(string codestr) 31 | { 32 | ImageCodecInfo result2 = ImageCodecInfo.GetImageEncoders()[0]; 33 | foreach (ImageCodecInfo ici in CodecInfo) //定义一个编码器型参数ici,并建立循环             34 | { 35 | if (ici.MimeType == codestr)//返回传递进来的格式的编码   36 | { 37 | result2 = ici; 38 | } 39 | } 40 | return result2; 41 | } 42 | /**jpeg压缩代码*/ 43 | //指定的数值越低,压缩越高,因此图像的质量越低。值为0 时,图像的质量最差;值为100 时,图像的质量最佳  44 | //得到图片的编码格式 45 | public static byte[] compressPictureToJpegBytesWithNewSize(Bitmap btm, int width, int height, int BitmapQty) 46 | { 47 | p = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, BitmapQty); 48 | ps = new EncoderParameters(1);             //EncoderParameters是EncoderParameter类的集合数组  49 | ps.Param[0] = p;   //将EncoderParameter中的值传递给EncoderParameters   50 | MemoryStream ret = new MemoryStream(); 51 | Bitmap bmb = new Bitmap(width, height);  //创建一个宽w长h的位图(画布)  52 | Graphics grap = Graphics.FromImage(bmb); //将要绘制的位图定义为grap。grap继承bmb              53 | grap.DrawImage(btm, new Rectangle(0, 0, width,height)); //用Rectangle指定一个区域,将img内Rectangle所指定的区域绘制到bmb  54 | grap.Dispose(); 55 | bmb.Save(ret, result, ps); 56 | bmb.Dispose(); 57 | ret.Close(); 58 | return ret.ToArray(); 59 | } 60 | /**compress the bitmap to jpeg with specify quality*/ 61 | public static byte[] compressPictureToJpegBytesWithQty(Bitmap btm, int BitmapQty) 62 | { 63 | p = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, BitmapQty); 64 | ps = new EncoderParameters(1);             //EncoderParameters是EncoderParameter类的集合数组  65 | ps.Param[0] = p;   //将EncoderParameter中的值传递给EncoderParameters   66 | MemoryStream ret = new MemoryStream(); 67 | btm.Save(ret, result, ps); 68 | ret.Close(); 69 | return ret.ToArray(); 70 | } 71 | public static Bitmap compressPictureToJpegWithNewSize(Bitmap btm, int width, int height, int BitmapQty) 72 | { 73 | p = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, BitmapQty); 74 | ps = new EncoderParameters(1);             //EncoderParameters是EncoderParameter类的集合数组  75 | ps.Param[0] = p;   //将EncoderParameter中的值传递给EncoderParameters   76 | MemoryStream ret = new MemoryStream(); 77 | Bitmap bmb = new Bitmap(width, height);  //创建一个宽w长h的位图(画布)  78 | Graphics grap = Graphics.FromImage(bmb); //将要绘制的位图定义为grap。grap继承bmb              79 | grap.DrawImage(btm, new Rectangle(0, 0, width, height)); //用Rectangle指定一个区域,将img内Rectangle所指定的区域绘制到bmb  80 | grap.Dispose(); 81 | bmb.Save(ret, result, ps); 82 | bmb.Dispose(); 83 | return new Bitmap(ret); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /ControlServer1.0/DataPacket/RecPacket.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ControlServer1._0.DataPacket 7 | { 8 | class RecPacket 9 | { 10 | public ENUMS.MESSAGETYPE type; 11 | public ENUMS.SPECIALKEYS key; 12 | public int intValue1; 13 | public int intValue2; 14 | public String stringValue; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ControlServer1.0/DesktopDuplication/DesktopDuplicationException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace DesktopDuplication 8 | { 9 | public class DesktopDuplicationException : Exception 10 | { 11 | public DesktopDuplicationException(string message) 12 | : base(message) { } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ControlServer1.0/DesktopDuplication/DesktopFrame.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesktopDuplication 9 | { 10 | /// 11 | /// Provides image data, cursor data, and image metadata about the retrieved desktop frame. 12 | /// 13 | public class DesktopFrame 14 | { 15 | /// 16 | /// Gets the bitmap representing the last retrieved desktop frame. This image spans the entire bounds of the specified monitor. 17 | /// 18 | public Bitmap DesktopImage { get; internal set; } 19 | 20 | /// 21 | /// Gets a list of the rectangles of pixels in the desktop image that the operating system moved to another location within the same image. 22 | /// 23 | /// 24 | /// To produce a visually accurate copy of the desktop, an application must first process all moved regions before it processes updated regions. 25 | /// 26 | public MovedRegion[] MovedRegions { get; internal set; } 27 | 28 | /// 29 | /// Returns the list of non-overlapping rectangles that indicate the areas of the desktop image that the operating system updated since the last retrieved frame. 30 | /// 31 | /// 32 | /// To produce a visually accurate copy of the desktop, an application must first process all moved regions before it processes updated regions. 33 | /// 34 | public Rectangle[] UpdatedRegions { get; internal set; } 35 | 36 | /// 37 | /// The number of frames that the operating system accumulated in the desktop image surface since the last retrieved frame. 38 | /// 39 | public int AccumulatedFrames { get; internal set; } 40 | 41 | /// 42 | /// Gets the location of the top-left-hand corner of the cursor. This is not necessarily the same position as the cursor's hot spot, which is the location in the cursor that interacts with other elements on the screen. 43 | /// 44 | public Point CursorLocation { get; internal set; } 45 | 46 | /// 47 | /// Gets whether the cursor on the last retrieved desktop image was visible. 48 | /// 49 | public bool CursorVisible { get; internal set; } 50 | 51 | /// 52 | /// Gets whether the desktop image contains protected content that was already blacked out in the desktop image. 53 | /// 54 | public bool ProtectedContentMaskedOut { get; internal set; } 55 | 56 | /// 57 | /// Gets whether the operating system accumulated updates by coalescing updated regions. If so, the updated regions might contain unmodified pixels. 58 | /// 59 | public bool RectanglesCoalesced { get; internal set; } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ControlServer1.0/DesktopDuplication/MovedRegion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesktopDuplication 9 | { 10 | /// 11 | /// Describes the movement of an image rectangle within a desktop frame. 12 | /// 13 | /// 14 | /// Move regions are always non-stretched regions so the source is always the same size as the destination. 15 | /// 16 | public struct MovedRegion 17 | { 18 | /// 19 | /// Gets the location from where the operating system copied the image region. 20 | /// 21 | public Point Source { get; internal set; } 22 | 23 | /// 24 | /// Gets the target region to where the operating system moved the image region. 25 | /// 26 | public Rectangle Destination { get; internal set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ControlServer1.0/DesktopDuplication/PointerInfo.cs: -------------------------------------------------------------------------------- 1 | using SharpDX.DXGI; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace DesktopDuplication 9 | { 10 | internal class PointerInfo 11 | { 12 | public byte[] PtrShapeBuffer; 13 | public OutputDuplicatePointerShapeInformation ShapeInfo; 14 | public SharpDX.Point Position; 15 | public bool Visible; 16 | public int BufferSize; 17 | public int WhoUpdatedPositionLast; 18 | public long LastTimeStamp; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ControlServer1.0/ErrorMessage/ErrorInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace ControlServer1._0.ErrorMessage 8 | { 9 | class ErrorInfo 10 | { 11 | private static readonly object lockHelper = new object();//线程安全 12 | private const string errorOutputFilePath = "ErrorMessage.txt"; 13 | private bool isErrorOn=true; 14 | private volatile static ErrorInfo instance = null; 15 | private ErrorInfo() { } 16 | public static ErrorInfo getErrorWriter() 17 | { 18 | if (instance == null) 19 | { 20 | lock (lockHelper) 21 | { 22 | if(instance==null) 23 | instance=new ErrorInfo(); 24 | } 25 | } 26 | return instance; 27 | } 28 | 29 | public void writeErrorMassageToFile(String message) 30 | { 31 | lock (this) 32 | { 33 | if (isErrorOn) 34 | { 35 | try 36 | { 37 | FileStream fs = new FileStream(errorOutputFilePath, FileMode.Append); 38 | if (fs.Length > 1024 * 1024) 39 | { 40 | fs.Close(); 41 | fs = new FileStream(errorOutputFilePath, FileMode.Create); 42 | } 43 | StreamWriter sw = new StreamWriter(fs, Encoding.Default); 44 | sw.Write(DateTime.Now.ToLocalTime()+":"+message); 45 | sw.WriteLine(); 46 | sw.Close(); 47 | } 48 | catch (IOException ex) 49 | { 50 | Console.WriteLine(ex.Message); 51 | } 52 | catch (Exception ex2) 53 | { 54 | Console.WriteLine(ex2.Message); 55 | } 56 | } 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/BZip2/BZip2Exception.cs: -------------------------------------------------------------------------------- 1 | // BZip2.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | namespace ICSharpCode.SharpZipLib.BZip2 43 | { 44 | /// 45 | /// BZip2Exception represents exceptions specific to Bzip2 algorithm 46 | /// 47 | #if !NETCF_1_0 && !NETCF_2_0 48 | [Serializable] 49 | #endif 50 | public class BZip2Exception : SharpZipBaseException 51 | { 52 | 53 | #if !NETCF_1_0 && !NETCF_2_0 54 | /// 55 | /// Deserialization constructor 56 | /// 57 | /// for this constructor 58 | /// for this constructor 59 | protected BZip2Exception(SerializationInfo info, StreamingContext context) 60 | : base(info, context) 61 | 62 | { 63 | } 64 | #endif 65 | /// 66 | /// Initialise a new instance of BZip2Exception. 67 | /// 68 | public BZip2Exception() 69 | { 70 | } 71 | 72 | /// 73 | /// Initialise a new instance of BZip2Exception with its message set to message. 74 | /// 75 | /// The message describing the error. 76 | public BZip2Exception(string message) : base(message) 77 | { 78 | } 79 | 80 | /// 81 | /// Initialise an instance of BZip2Exception 82 | /// 83 | /// A message describing the error. 84 | /// The exception that is the cause of the current exception. 85 | public BZip2Exception(string message, Exception exception) 86 | : base(message, exception) 87 | { 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/Checksums/IChecksum.cs: -------------------------------------------------------------------------------- 1 | // IChecksum.cs - Interface to compute a data checksum 2 | // Copyright (C) 2001 Mike Krueger 3 | // 4 | // This file was translated from java, it was part of the GNU Classpath 5 | // Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 6 | // 7 | // This program is free software; you can redistribute it and/or 8 | // modify it under the terms of the GNU General Public License 9 | // as published by the Free Software Foundation; either version 2 10 | // of the License, or (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program; if not, write to the Free Software 19 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | // 21 | // Linking this library statically or dynamically with other modules is 22 | // making a combined work based on this library. Thus, the terms and 23 | // conditions of the GNU General Public License cover the whole 24 | // combination. 25 | // 26 | // As a special exception, the copyright holders of this library give you 27 | // permission to link this library with independent modules to produce an 28 | // executable, regardless of the license terms of these independent 29 | // modules, and to copy and distribute the resulting executable under 30 | // terms of your choice, provided that you also meet, for each linked 31 | // independent module, the terms and conditions of the license of that 32 | // module. An independent module is a module which is not derived from 33 | // or based on this library. If you modify this library, you may extend 34 | // this exception to your version of the library, but you are not 35 | // obligated to do so. If you do not wish to do so, delete this 36 | // exception statement from your version. 37 | 38 | namespace ICSharpCode.SharpZipLib.Checksums 39 | { 40 | 41 | /// 42 | /// Interface to compute a data checksum used by checked input/output streams. 43 | /// A data checksum can be updated by one byte or with a byte array. After each 44 | /// update the value of the current checksum can be returned by calling 45 | /// getValue. The complete checksum object can also be reset 46 | /// so it can be used again with new data. 47 | /// 48 | public interface IChecksum 49 | { 50 | /// 51 | /// Returns the data checksum computed so far. 52 | /// 53 | long Value 54 | { 55 | get; 56 | } 57 | 58 | /// 59 | /// Resets the data checksum as if no update was ever called. 60 | /// 61 | void Reset(); 62 | 63 | /// 64 | /// Adds one byte to the data checksum. 65 | /// 66 | /// 67 | /// the data value to add. The high byte of the int is ignored. 68 | /// 69 | void Update(int value); 70 | 71 | /// 72 | /// Updates the data checksum with the bytes taken from the array. 73 | /// 74 | /// 75 | /// buffer an array of bytes 76 | /// 77 | void Update(byte[] buffer); 78 | 79 | /// 80 | /// Adds the byte array to the data checksum. 81 | /// 82 | /// 83 | /// The buffer which contains the data 84 | /// 85 | /// 86 | /// The offset in the buffer where the data starts 87 | /// 88 | /// 89 | /// the number of data bytes to add. 90 | /// 91 | void Update(byte[] buffer, int offset, int count); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/Core/INameTransform.cs: -------------------------------------------------------------------------------- 1 | // INameTransform.cs 2 | // 3 | // Copyright 2005 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | namespace ICSharpCode.SharpZipLib.Core 37 | { 38 | /// 39 | /// INameTransform defines how file system names are transformed for use with archives, or vice versa. 40 | /// 41 | public interface INameTransform 42 | { 43 | /// 44 | /// Given a file name determine the transformed value. 45 | /// 46 | /// The name to transform. 47 | /// The transformed file name. 48 | string TransformFile(string name); 49 | 50 | /// 51 | /// Given a directory name determine the transformed value. 52 | /// 53 | /// The name to transform. 54 | /// The transformed directory name 55 | string TransformDirectory(string name); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/Core/IScanFilter.cs: -------------------------------------------------------------------------------- 1 | // IScanFilter.cs 2 | // 3 | // Copyright 2006 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | namespace ICSharpCode.SharpZipLib.Core 37 | { 38 | /// 39 | /// Scanning filters support filtering of names. 40 | /// 41 | public interface IScanFilter 42 | { 43 | /// 44 | /// Test a name to see if it 'matches' the filter. 45 | /// 46 | /// The name to test. 47 | /// Returns true if the name matches the filter, false if it does not match. 48 | bool IsMatch(string name); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/Core/WindowsPathUtils.cs: -------------------------------------------------------------------------------- 1 | // WindowsPathUtils.cs 2 | // 3 | // Copyright 2007 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | namespace ICSharpCode.SharpZipLib.Core 37 | { 38 | /// 39 | /// WindowsPathUtils provides simple utilities for handling windows paths. 40 | /// 41 | public abstract class WindowsPathUtils 42 | { 43 | /// 44 | /// Initializes a new instance of the class. 45 | /// 46 | internal WindowsPathUtils() 47 | { 48 | } 49 | 50 | /// 51 | /// Remove any path root present in the path 52 | /// 53 | /// A containing path information. 54 | /// The path with the root removed if it was present; path otherwise. 55 | /// Unlike the class the path isnt otherwise checked for validity. 56 | public static string DropPathRoot(string path) 57 | { 58 | string result = path; 59 | 60 | if ( (path != null) && (path.Length > 0) ) { 61 | if ((path[0] == '\\') || (path[0] == '/')) { 62 | // UNC name ? 63 | if ((path.Length > 1) && ((path[1] == '\\') || (path[1] == '/'))) { 64 | int index = 2; 65 | int elements = 2; 66 | 67 | // Scan for two separate elements \\machine\share\restofpath 68 | while ((index <= path.Length) && 69 | (((path[index] != '\\') && (path[index] != '/')) || (--elements > 0))) { 70 | index++; 71 | } 72 | 73 | index++; 74 | 75 | if (index < path.Length) { 76 | result = path.Substring(index); 77 | } 78 | else { 79 | result = ""; 80 | } 81 | } 82 | } 83 | else if ((path.Length > 1) && (path[1] == ':')) { 84 | int dropCount = 2; 85 | if ((path.Length > 2) && ((path[2] == '\\') || (path[2] == '/'))) { 86 | dropCount = 3; 87 | } 88 | result = result.Remove(0, dropCount); 89 | } 90 | } 91 | return result; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/GZip/GZipConstants.cs: -------------------------------------------------------------------------------- 1 | // GZipConstants.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // 5 | // This file was translated from java, it was part of the GNU Classpath 6 | // Copyright (C) 2001 Free Software Foundation, Inc. 7 | // 8 | // This program is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU General Public License 10 | // as published by the Free Software Foundation; either version 2 11 | // of the License, or (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | // 22 | // Linking this library statically or dynamically with other modules is 23 | // making a combined work based on this library. Thus, the terms and 24 | // conditions of the GNU General Public License cover the whole 25 | // combination. 26 | // 27 | // As a special exception, the copyright holders of this library give you 28 | // permission to link this library with independent modules to produce an 29 | // executable, regardless of the license terms of these independent 30 | // modules, and to copy and distribute the resulting executable under 31 | // terms of your choice, provided that you also meet, for each linked 32 | // independent module, the terms and conditions of the license of that 33 | // module. An independent module is a module which is not derived from 34 | // or based on this library. If you modify this library, you may extend 35 | // this exception to your version of the library, but you are not 36 | // obligated to do so. If you do not wish to do so, delete this 37 | // exception statement from your version. 38 | 39 | namespace ICSharpCode.SharpZipLib.GZip 40 | { 41 | 42 | /// 43 | /// This class contains constants used for gzip. 44 | /// 45 | sealed public class GZipConstants 46 | { 47 | /// 48 | /// Magic number found at start of GZIP header 49 | /// 50 | public const int GZIP_MAGIC = 0x1F8B; 51 | 52 | /* The flag byte is divided into individual bits as follows: 53 | 54 | bit 0 FTEXT 55 | bit 1 FHCRC 56 | bit 2 FEXTRA 57 | bit 3 FNAME 58 | bit 4 FCOMMENT 59 | bit 5 reserved 60 | bit 6 reserved 61 | bit 7 reserved 62 | */ 63 | 64 | /// 65 | /// Flag bit mask for text 66 | /// 67 | public const int FTEXT = 0x1; 68 | 69 | /// 70 | /// Flag bitmask for Crc 71 | /// 72 | public const int FHCRC = 0x2; 73 | 74 | /// 75 | /// Flag bit mask for extra 76 | /// 77 | public const int FEXTRA = 0x4; 78 | 79 | /// 80 | /// flag bitmask for name 81 | /// 82 | public const int FNAME = 0x8; 83 | 84 | /// 85 | /// flag bit mask indicating comment is present 86 | /// 87 | public const int FCOMMENT = 0x10; 88 | 89 | /// 90 | /// Initialise default instance. 91 | /// 92 | /// Constructor is private to prevent instances being created. 93 | GZipConstants() 94 | { 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/GZip/GZipException.cs: -------------------------------------------------------------------------------- 1 | // GZipException.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | namespace ICSharpCode.SharpZipLib.GZip 43 | { 44 | /// 45 | /// GZipException represents a Gzip specific exception 46 | /// 47 | #if !NETCF_1_0 && !NETCF_2_0 48 | [Serializable] 49 | #endif 50 | public class GZipException : SharpZipBaseException 51 | { 52 | #if !NETCF_1_0 && !NETCF_2_0 53 | /// 54 | /// Deserialization constructor 55 | /// 56 | /// for this constructor 57 | /// for this constructor 58 | protected GZipException(SerializationInfo info, StreamingContext context) 59 | : base(info, context) 60 | 61 | { 62 | } 63 | #endif 64 | 65 | /// 66 | /// Initialise a new instance of GZipException 67 | /// 68 | public GZipException() 69 | { 70 | } 71 | 72 | /// 73 | /// Initialise a new instance of GZipException with its message string. 74 | /// 75 | /// A that describes the error. 76 | public GZipException(string message) 77 | : base(message) 78 | { 79 | } 80 | 81 | /// 82 | /// Initialise a new instance of . 83 | /// 84 | /// A that describes the error. 85 | /// The that caused this exception. 86 | public GZipException(string message, Exception innerException) 87 | : base (message, innerException) 88 | { 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/Lzw/LzwConstants.cs: -------------------------------------------------------------------------------- 1 | // LzwConstants.cs 2 | // 3 | // Copyright (C) 2009 Gabriel Burca 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | namespace ICSharpCode.SharpZipLib.LZW { 37 | 38 | /// 39 | /// This class contains constants used for LZW 40 | /// 41 | sealed public class LzwConstants { 42 | /// 43 | /// Magic number found at start of LZW header: 0x1f 0x9d 44 | /// 45 | public const int MAGIC = 0x1f9d; 46 | 47 | /// 48 | /// Maximum number of bits per code 49 | /// 50 | public const int MAX_BITS = 16; 51 | 52 | /* 3rd header byte: 53 | * bit 0..4 Number of compression bits 54 | * bit 5 Extended header 55 | * bit 6 Free 56 | * bit 7 Block mode 57 | */ 58 | 59 | /// 60 | /// Mask for 'number of compression bits' 61 | /// 62 | public const int BIT_MASK = 0x1f; 63 | 64 | /// 65 | /// Indicates the presence of a fourth header byte 66 | /// 67 | public const int EXTENDED_MASK = 0x20; 68 | //public const int FREE_MASK = 0x40; 69 | 70 | /// 71 | /// Reserved bits 72 | /// 73 | public const int RESERVED_MASK = 0x60; 74 | 75 | /// 76 | /// Block compression: if table is full and compression rate is dropping, 77 | /// clear the dictionary. 78 | /// 79 | public const int BLOCK_MODE_MASK = 0x80; 80 | 81 | /// 82 | /// LZW file header size (in bytes) 83 | /// 84 | public const int HDR_SIZE = 3; 85 | 86 | /// 87 | /// Initial number of bits per code 88 | /// 89 | public const int INIT_BITS = 9; 90 | 91 | LzwConstants() { 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/Lzw/LzwException.cs: -------------------------------------------------------------------------------- 1 | // LzwException.cs 2 | // 3 | // Copyright (C) 2009 Gabriel Burca 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | namespace ICSharpCode.SharpZipLib.LZW 43 | { 44 | 45 | /// 46 | /// LzwException represents a LZW specific exception 47 | /// 48 | #if !NETCF_1_0 && !NETCF_2_0 49 | [Serializable] 50 | #endif 51 | public class LzwException : SharpZipBaseException 52 | { 53 | 54 | #if !NETCF_1_0 && !NETCF_2_0 55 | /// 56 | /// Deserialization constructor 57 | /// 58 | /// for this constructor 59 | /// for this constructor 60 | protected LzwException(SerializationInfo info, StreamingContext context) 61 | : base(info, context) { 62 | } 63 | #endif 64 | 65 | /// 66 | /// Initialise a new instance of LzwException 67 | /// 68 | public LzwException() { 69 | } 70 | 71 | /// 72 | /// Initialise a new instance of LzwException with its message string. 73 | /// 74 | /// A that describes the error. 75 | public LzwException(string message) 76 | : base(message) { 77 | } 78 | 79 | /// 80 | /// Initialise a new instance of . 81 | /// 82 | /// A that describes the error. 83 | /// The that caused this exception. 84 | public LzwException(string message, Exception innerException) 85 | : base(message, innerException) { 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/Main.cs: -------------------------------------------------------------------------------- 1 | // Main.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | // 36 | 37 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/Tar/TarException.cs: -------------------------------------------------------------------------------- 1 | // TarException.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | namespace ICSharpCode.SharpZipLib.Tar { 43 | 44 | /// 45 | /// TarExceptions are used for exceptions specific to tar classes and code. 46 | /// 47 | #if !NETCF_1_0 && !NETCF_2_0 48 | [Serializable] 49 | #endif 50 | public class TarException : SharpZipBaseException 51 | { 52 | #if !NETCF_1_0 && !NETCF_2_0 53 | /// 54 | /// Deserialization constructor 55 | /// 56 | /// for this constructor 57 | /// for this constructor 58 | protected TarException(SerializationInfo info, StreamingContext context) 59 | : base(info, context) 60 | 61 | { 62 | } 63 | #endif 64 | 65 | /// 66 | /// Initialises a new instance of the TarException class. 67 | /// 68 | public TarException() 69 | { 70 | } 71 | 72 | /// 73 | /// Initialises a new instance of the TarException class with a specified message. 74 | /// 75 | /// The message that describes the error. 76 | public TarException(string message) 77 | : base(message) 78 | { 79 | } 80 | 81 | /// 82 | /// 83 | /// 84 | /// A message describing the error. 85 | /// The exception that is the cause of the current exception. 86 | public TarException(string message, Exception exception) 87 | : base(message, exception) 88 | { 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/Zip/Compression/DeflaterPending.cs: -------------------------------------------------------------------------------- 1 | // DeflaterPending.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // Copyright (C) 2004 John Reilly 5 | // 6 | // This file was translated from java, it was part of the GNU Classpath 7 | // Copyright (C) 2001 Free Software Foundation, Inc. 8 | // 9 | // This program is free software; you can redistribute it and/or 10 | // modify it under the terms of the GNU General Public License 11 | // as published by the Free Software Foundation; either version 2 12 | // of the License, or (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with this program; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | // 23 | // Linking this library statically or dynamically with other modules is 24 | // making a combined work based on this library. Thus, the terms and 25 | // conditions of the GNU General Public License cover the whole 26 | // combination. 27 | // 28 | // As a special exception, the copyright holders of this library give you 29 | // permission to link this library with independent modules to produce an 30 | // executable, regardless of the license terms of these independent 31 | // modules, and to copy and distribute the resulting executable under 32 | // terms of your choice, provided that you also meet, for each linked 33 | // independent module, the terms and conditions of the license of that 34 | // module. An independent module is a module which is not derived from 35 | // or based on this library. If you modify this library, you may extend 36 | // this exception to your version of the library, but you are not 37 | // obligated to do so. If you do not wish to do so, delete this 38 | // exception statement from your version. 39 | 40 | namespace ICSharpCode.SharpZipLib.Zip.Compression 41 | { 42 | 43 | /// 44 | /// This class stores the pending output of the Deflater. 45 | /// 46 | /// author of the original java version : Jochen Hoenicke 47 | /// 48 | public class DeflaterPending : PendingBuffer 49 | { 50 | /// 51 | /// Construct instance with default buffer size 52 | /// 53 | public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE) 54 | { 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ControlServer1.0/ICSharpCode.SharpZLib/Zip/ZipException.cs: -------------------------------------------------------------------------------- 1 | // ZipException.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // 5 | // This file was translated from java, it was part of the GNU Classpath 6 | // Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. 7 | // 8 | // This program is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU General Public License 10 | // as published by the Free Software Foundation; either version 2 11 | // of the License, or (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | // 22 | // Linking this library statically or dynamically with other modules is 23 | // making a combined work based on this library. Thus, the terms and 24 | // conditions of the GNU General Public License cover the whole 25 | // combination. 26 | // 27 | // As a special exception, the copyright holders of this library give you 28 | // permission to link this library with independent modules to produce an 29 | // executable, regardless of the license terms of these independent 30 | // modules, and to copy and distribute the resulting executable under 31 | // terms of your choice, provided that you also meet, for each linked 32 | // independent module, the terms and conditions of the license of that 33 | // module. An independent module is a module which is not derived from 34 | // or based on this library. If you modify this library, you may extend 35 | // this exception to your version of the library, but you are not 36 | // obligated to do so. If you do not wish to do so, delete this 37 | // exception statement from your version. 38 | 39 | using System; 40 | 41 | #if !NETCF_1_0 && !NETCF_2_0 42 | using System.Runtime.Serialization; 43 | #endif 44 | 45 | namespace ICSharpCode.SharpZipLib.Zip 46 | { 47 | 48 | /// 49 | /// Represents exception conditions specific to Zip archive handling 50 | /// 51 | #if !NETCF_1_0 && !NETCF_2_0 52 | [Serializable] 53 | #endif 54 | public class ZipException : SharpZipBaseException 55 | { 56 | #if !NETCF_1_0 && !NETCF_2_0 57 | /// 58 | /// Deserialization constructor 59 | /// 60 | /// for this constructor 61 | /// for this constructor 62 | protected ZipException(SerializationInfo info, StreamingContext context ) 63 | : base( info, context ) 64 | { 65 | } 66 | #endif 67 | 68 | /// 69 | /// Initializes a new instance of the ZipException class. 70 | /// 71 | public ZipException() 72 | { 73 | } 74 | 75 | /// 76 | /// Initializes a new instance of the ZipException class with a specified error message. 77 | /// 78 | /// The error message that explains the reason for the exception. 79 | public ZipException(string message) 80 | : base(message) 81 | { 82 | } 83 | 84 | /// 85 | /// Initialise a new instance of ZipException. 86 | /// 87 | /// A message describing the error. 88 | /// The exception that is the cause of the current exception. 89 | public ZipException(string message, Exception exception) 90 | : base(message, exception) 91 | { 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /ControlServer1.0/Images/App.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/Images/App.ico -------------------------------------------------------------------------------- /ControlServer1.0/Images/App.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/Images/App.jpg -------------------------------------------------------------------------------- /ControlServer1.0/OSInfos/OperatingSystemInfos.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ControlServer1._0.OSInfos 8 | { 9 | class OperatingSystemInfos 10 | { 11 | //获取系统信息 12 | private static System.OperatingSystem osInfo = System.Environment.OSVersion; 13 | 14 | public static PlatformID getOSPlatformID() 15 | { 16 | //获取操作系统ID 17 | System.PlatformID platformID = osInfo.Platform; 18 | return platformID; 19 | } 20 | public static int getOSMajorNum() 21 | { 22 | //获取主版本号 23 | int versionMajor = osInfo.Version.Major; 24 | return versionMajor; 25 | } 26 | 27 | public static int getOSMinorNum() 28 | { 29 | //获取副版本号 30 | int versionMinor = osInfo.Version.Minor; 31 | return versionMinor; 32 | } 33 | 34 | public static bool isWin8Above() 35 | { 36 | return (getOSPlatformID() >= PlatformID.Win32NT) && (getOSMajorNum()>6 ||(getOSMajorNum() == 6 && getOSMinorNum() >= 2)); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ControlServer1.0/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace ControlServer1._0 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// 应用程序的主入口点。 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new ServerForm()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ControlServer1.0/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过以下 6 | // 特性集控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("Remote Server")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ControlServer1.0")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 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("3d9baf86-3360-4dbc-9450-c86dc49b331e")] 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 | -------------------------------------------------------------------------------- /ControlServer1.0/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace RemoteControlSystem2._0.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("RemoteControlSystem2._0.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 | -------------------------------------------------------------------------------- /ControlServer1.0/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace RemoteControlSystem2._0.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 | -------------------------------------------------------------------------------- /ControlServer1.0/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ControlServer1.0/ScreenBitmap/BitmapWithCursor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Imaging; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | 9 | namespace ControlServer1._0.ScreenBitmap 10 | { 11 | class BitmapWithCursor 12 | { 13 | private ShortPoint cursorPoisiton = null; 14 | private Bitmap screenBitmap=null; 15 | public Rectangle[] dirtyRecs = null; 16 | 17 | public void setCursorPoint(ShortPoint point) 18 | { 19 | this.cursorPoisiton = point; 20 | } 21 | public ShortPoint getCursorPoint() 22 | { 23 | return this.cursorPoisiton; 24 | } 25 | public void setScreenBitmap(Bitmap btm) 26 | { 27 | this.screenBitmap = btm; 28 | } 29 | public Bitmap getScreenBitmap() 30 | { 31 | return this.screenBitmap; 32 | } 33 | 34 | 35 | 36 | public void releaseScreenBitmap() 37 | { 38 | this.screenBitmap.Dispose(); 39 | this.screenBitmap = null; 40 | 41 | } 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /ControlServer1.0/ScreenBitmap/DifferentBitmapWithCursor.cs: -------------------------------------------------------------------------------- 1 | using ControlServer1._0.DataPacket; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Drawing; 5 | using System.Linq; 6 | using System.Text; 7 | 8 | namespace ControlServer1._0.ScreenBitmap 9 | { 10 | class DifferentBitmapWithCursor 11 | { 12 | private Bitmap difBitmap; 13 | private ShortPoint cursorPoint; 14 | private List difPointsList; 15 | private SendPacket.BitmapType type; 16 | public Bitmap getDifBitmap() 17 | { 18 | return this.difBitmap; 19 | } 20 | public void setDifBitmap(Bitmap btm) 21 | { 22 | this.difBitmap = btm; 23 | } 24 | public ShortPoint getCursorPoint() 25 | { 26 | return this.cursorPoint; 27 | } 28 | public void setCursorPoint(ShortPoint cursorPoint) 29 | { 30 | this.cursorPoint = cursorPoint; 31 | } 32 | public List getDifPointsList() 33 | { 34 | return this.difPointsList; 35 | } 36 | public void setDifPointsList(List difPointsList) 37 | { 38 | this.difPointsList = difPointsList; 39 | } 40 | 41 | public void setBitmapType(SendPacket.BitmapType type) 42 | { 43 | this.type = type; 44 | } 45 | public SendPacket.BitmapType getBitmapType() 46 | { 47 | return this.type; 48 | } 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ControlServer1.0/ScreenBitmap/ShortPoint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace ControlServer1._0.ScreenBitmap 7 | { 8 | /**store the cursor points*/ 9 | class ShortPoint 10 | { 11 | private short xPoint; 12 | private short yPoint; 13 | 14 | public ShortPoint(int xPoint, int yPoint) 15 | { 16 | this.xPoint = (short)xPoint; 17 | this.yPoint = (short)yPoint; 18 | } 19 | public short getXPoint() 20 | { 21 | return this.xPoint; 22 | } 23 | public short getYPoint() 24 | { 25 | return this.yPoint; 26 | } 27 | public void setXPoint(short xPoint) 28 | { 29 | this.xPoint = xPoint; 30 | } 31 | public void setYPoint(short yPoint) 32 | { 33 | this.yPoint = yPoint; 34 | } 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ControlServer1.0/ScreenBitmap/ShortRec.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ControlServer1._0.ScreenBitmap 8 | { 9 | /**store the bitmap block size*/ 10 | class ShortRec 11 | { 12 | public short xPoint; 13 | public short yPoint; 14 | public short width; 15 | public short height; 16 | 17 | public ShortRec(int x, int y, int w, int h) 18 | { 19 | this.xPoint =(short) x; 20 | this.yPoint = (short)y; 21 | this.width = (short)w; 22 | this.height = (short)h; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ControlServer1.0/StreamLine/BlockingQueue.cs: -------------------------------------------------------------------------------- 1 | using ControlServer1._0.ErrorMessage; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading; 7 | 8 | namespace ControlServer1._0.StreamLine 9 | { 10 | /**a blocking queue */ 11 | class BlockingQueue 12 | { 13 | private readonly Queue queue = null; 14 | private readonly int maxSize=10; 15 | public BlockingQueue(int maxSize) { this.maxSize = maxSize; queue = new Queue(); } 16 | public int getQueueSize() 17 | { 18 | return queue.Count; 19 | } 20 | public void clearQueue() 21 | { 22 | lock(queue){ 23 | queue.Clear(); 24 | } 25 | } 26 | public void Enqueue(T item) 27 | { 28 | lock (queue) 29 | { 30 | while (queue.Count >= maxSize) 31 | { 32 | try 33 | { 34 | Monitor.Wait(queue); 35 | } 36 | catch (Exception ex) 37 | { 38 | ErrorInfo.getErrorWriter().writeErrorMassageToFile(ex.Message + ex.StackTrace); 39 | return; 40 | } 41 | } 42 | queue.Enqueue(item); 43 | if (queue.Count == 1) 44 | { 45 | // wake up any blocked dequeue 46 | Monitor.PulseAll(queue); 47 | } 48 | } 49 | } 50 | public T Dequeue() 51 | { 52 | lock (queue) 53 | { 54 | while (queue.Count == 0) 55 | { 56 | try 57 | { 58 | /**wait for add*/ 59 | Monitor.Wait(queue); 60 | } 61 | catch (Exception ex) 62 | { 63 | ErrorInfo.getErrorWriter().writeErrorMassageToFile(ex.Message + ex.StackTrace); 64 | return default(T); 65 | } 66 | } 67 | T item = queue.Dequeue(); 68 | if (queue.Count == maxSize - 1) 69 | { 70 | // wake up any blocked enqueue 71 | Monitor.PulseAll(queue); 72 | } 73 | return item; 74 | } 75 | } 76 | } 77 | 78 | 79 | } 80 | -------------------------------------------------------------------------------- /ControlServer1.0/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ControlServer1.0/libs/LZ4Sharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/libs/LZ4Sharp.dll -------------------------------------------------------------------------------- /ControlServer1.0/libs/LZOHelper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/libs/LZOHelper.dll -------------------------------------------------------------------------------- /ControlServer1.0/libs/Note.txt: -------------------------------------------------------------------------------- 1 | please copy these lib files into your running floder like release or debug floder. -------------------------------------------------------------------------------- /ControlServer1.0/libs/SharpDX.DXGI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/libs/SharpDX.DXGI.dll -------------------------------------------------------------------------------- /ControlServer1.0/libs/SharpDX.Direct3D11.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/libs/SharpDX.Direct3D11.dll -------------------------------------------------------------------------------- /ControlServer1.0/libs/SharpDX.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/libs/SharpDX.dll -------------------------------------------------------------------------------- /ControlServer1.0/libs/Simplicit.Net.Lzo.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/libs/Simplicit.Net.Lzo.dll -------------------------------------------------------------------------------- /ControlServer1.0/libs/lzo.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/libs/lzo.dll -------------------------------------------------------------------------------- /ControlServer1.0/libs/lzo2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/libs/lzo2.dll -------------------------------------------------------------------------------- /ControlServer1.0/server.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/ControlServer1.0/server.ico -------------------------------------------------------------------------------- /DXGI desktop duplication sample/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/DXGI desktop duplication sample/.DS_Store -------------------------------------------------------------------------------- /DXGI desktop duplication sample/C++/CommonTypes.h: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | #ifndef _COMMONTYPES_H_ 9 | #define _COMMONTYPES_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include "PixelShader.h" 20 | #include "VertexShader.h" 21 | 22 | #define NUMVERTICES 6 23 | #define BPP 4 24 | 25 | #define OCCLUSION_STATUS_MSG WM_USER 26 | 27 | extern HRESULT SystemTransitionsExpectedErrors[]; 28 | extern HRESULT CreateDuplicationExpectedErrors[]; 29 | extern HRESULT FrameInfoExpectedErrors[]; 30 | extern HRESULT AcquireFrameExpectedError[]; 31 | extern HRESULT EnumOutputsExpectedErrors[]; 32 | 33 | typedef _Return_type_success_(return == DUPL_RETURN_SUCCESS) enum 34 | { 35 | DUPL_RETURN_SUCCESS = 0, 36 | DUPL_RETURN_ERROR_EXPECTED = 1, 37 | DUPL_RETURN_ERROR_UNEXPECTED = 2 38 | }DUPL_RETURN; 39 | 40 | _Post_satisfies_(return != DUPL_RETURN_SUCCESS) 41 | DUPL_RETURN ProcessFailure(_In_opt_ ID3D11Device* Device, _In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr, _In_opt_z_ HRESULT* ExpectedErrors = nullptr); 42 | 43 | void DisplayMsg(_In_ LPCWSTR Str, _In_ LPCWSTR Title, HRESULT hr); 44 | 45 | // 46 | // Holds info about the pointer/cursor 47 | // 48 | typedef struct _PTR_INFO 49 | { 50 | _Field_size_bytes_(BufferSize) BYTE* PtrShapeBuffer; 51 | DXGI_OUTDUPL_POINTER_SHAPE_INFO ShapeInfo; 52 | POINT Position; 53 | bool Visible; 54 | UINT BufferSize; 55 | UINT WhoUpdatedPositionLast; 56 | LARGE_INTEGER LastTimeStamp; 57 | } PTR_INFO; 58 | 59 | // 60 | // Structure that holds D3D resources not directly tied to any one thread 61 | // 62 | typedef struct _DX_RESOURCES 63 | { 64 | ID3D11Device* Device; 65 | ID3D11DeviceContext* Context; 66 | ID3D11VertexShader* VertexShader; 67 | ID3D11PixelShader* PixelShader; 68 | ID3D11InputLayout* InputLayout; 69 | ID3D11SamplerState* SamplerLinear; 70 | } DX_RESOURCES; 71 | 72 | // 73 | // Structure to pass to a new thread 74 | // 75 | typedef struct _THREAD_DATA 76 | { 77 | // Used to indicate abnormal error condition 78 | HANDLE UnexpectedErrorEvent; 79 | 80 | // Used to indicate a transition event occurred e.g. PnpStop, PnpStart, mode change, TDR, desktop switch and the application needs to recreate the duplication interface 81 | HANDLE ExpectedErrorEvent; 82 | 83 | // Used by WinProc to signal to threads to exit 84 | HANDLE TerminateThreadsEvent; 85 | 86 | HANDLE TexSharedHandle; 87 | UINT Output; 88 | INT OffsetX; 89 | INT OffsetY; 90 | PTR_INFO* PtrInfo; 91 | DX_RESOURCES DxRes; 92 | } THREAD_DATA; 93 | 94 | // 95 | // FRAME_DATA holds information about an acquired frame 96 | // 97 | typedef struct _FRAME_DATA 98 | { 99 | ID3D11Texture2D* Frame; 100 | DXGI_OUTDUPL_FRAME_INFO FrameInfo; 101 | _Field_size_bytes_((MoveCount * sizeof(DXGI_OUTDUPL_MOVE_RECT)) + (DirtyCount * sizeof(RECT))) BYTE* MetaData; 102 | UINT DirtyCount; 103 | UINT MoveCount; 104 | } FRAME_DATA; 105 | 106 | // 107 | // A vertex with a position and texture coordinate 108 | // 109 | typedef struct _VERTEX 110 | { 111 | DirectX::XMFLOAT3 Pos; 112 | DirectX::XMFLOAT2 TexCoord; 113 | } VERTEX; 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /DXGI desktop duplication sample/C++/DesktopDuplication.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 11 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DesktopDuplication", "DesktopDuplication.vcxproj", "{05050918-71E9-AF87-0B3C-6F34D471A55A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Debug|x64 = Debug|x64 10 | Release|Win32 = Release|Win32 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {05050918-71E9-AF87-0B3C-6F34D471A55A}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {05050918-71E9-AF87-0B3C-6F34D471A55A}.Debug|Win32.Build.0 = Debug|Win32 16 | {05050918-71E9-AF87-0B3C-6F34D471A55A}.Debug|x64.ActiveCfg = Debug|x64 17 | {05050918-71E9-AF87-0B3C-6F34D471A55A}.Debug|x64.Build.0 = Debug|x64 18 | {05050918-71E9-AF87-0B3C-6F34D471A55A}.Release|Win32.ActiveCfg = Release|Win32 19 | {05050918-71E9-AF87-0B3C-6F34D471A55A}.Release|Win32.Build.0 = Release|Win32 20 | {05050918-71E9-AF87-0B3C-6F34D471A55A}.Release|x64.ActiveCfg = Release|x64 21 | {05050918-71E9-AF87-0B3C-6F34D471A55A}.Release|x64.Build.0 = Release|x64 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /DXGI desktop duplication sample/C++/DisplayManager.h: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | #ifndef _DISPLAYMANAGER_H_ 9 | #define _DISPLAYMANAGER_H_ 10 | 11 | #include "CommonTypes.h" 12 | 13 | // 14 | // Handles the task of processing frames 15 | // 16 | class DISPLAYMANAGER 17 | { 18 | public: 19 | DISPLAYMANAGER(); 20 | ~DISPLAYMANAGER(); 21 | void InitD3D(DX_RESOURCES* Data); 22 | ID3D11Device* GetDevice(); 23 | DUPL_RETURN ProcessFrame(_In_ FRAME_DATA* Data, _Inout_ ID3D11Texture2D* SharedSurf, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc); 24 | void CleanRefs(); 25 | 26 | private: 27 | // methods 28 | DUPL_RETURN CopyDirty(_In_ ID3D11Texture2D* SrcSurface, _Inout_ ID3D11Texture2D* SharedSurf, _In_reads_(DirtyCount) RECT* DirtyBuffer, UINT DirtyCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc); 29 | DUPL_RETURN CopyMove(_Inout_ ID3D11Texture2D* SharedSurf, _In_reads_(MoveCount) DXGI_OUTDUPL_MOVE_RECT* MoveBuffer, UINT MoveCount, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, INT TexWidth, INT TexHeight); 30 | void SetDirtyVert(_Out_writes_(NUMVERTICES) VERTEX* Vertices, _In_ RECT* Dirty, INT OffsetX, INT OffsetY, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ D3D11_TEXTURE2D_DESC* FullDesc, _In_ D3D11_TEXTURE2D_DESC* ThisDesc); 31 | void SetMoveRect(_Out_ RECT* SrcRect, _Out_ RECT* DestRect, _In_ DXGI_OUTPUT_DESC* DeskDesc, _In_ DXGI_OUTDUPL_MOVE_RECT* MoveRect, INT TexWidth, INT TexHeight); 32 | 33 | // variables 34 | ID3D11Device* m_Device; 35 | ID3D11DeviceContext* m_DeviceContext; 36 | ID3D11Texture2D* m_MoveSurf; 37 | ID3D11VertexShader* m_VertexShader; 38 | ID3D11PixelShader* m_PixelShader; 39 | ID3D11InputLayout* m_InputLayout; 40 | ID3D11RenderTargetView* m_RTV; 41 | ID3D11SamplerState* m_SamplerLinear; 42 | BYTE* m_DirtyVertexBufferAlloc; 43 | UINT m_DirtyVertexBufferAllocSize; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /DXGI desktop duplication sample/C++/DuplicationManager.h: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | #ifndef _DUPLICATIONMANAGER_H_ 9 | #define _DUPLICATIONMANAGER_H_ 10 | 11 | #include "CommonTypes.h" 12 | 13 | // 14 | // Handles the task of duplicating an output. 15 | // 16 | class DUPLICATIONMANAGER 17 | { 18 | public: 19 | DUPLICATIONMANAGER(); 20 | ~DUPLICATIONMANAGER(); 21 | _Success_(*Timeout == false && return == DUPL_RETURN_SUCCESS) DUPL_RETURN GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Timeout); 22 | DUPL_RETURN DoneWithFrame(); 23 | DUPL_RETURN InitDupl(_In_ ID3D11Device* Device, UINT Output); 24 | DUPL_RETURN GetMouse(_Inout_ PTR_INFO* PtrInfo, _In_ DXGI_OUTDUPL_FRAME_INFO* FrameInfo, INT OffsetX, INT OffsetY); 25 | void GetOutputDesc(_Out_ DXGI_OUTPUT_DESC* DescPtr); 26 | 27 | private: 28 | 29 | // vars 30 | IDXGIOutputDuplication* m_DeskDupl; 31 | ID3D11Texture2D* m_AcquiredDesktopImage; 32 | _Field_size_bytes_(m_MetaDataSize) BYTE* m_MetaDataBuffer; 33 | UINT m_MetaDataSize; 34 | UINT m_OutputNumber; 35 | DXGI_OUTPUT_DESC m_OutputDesc; 36 | ID3D11Device* m_Device; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /DXGI desktop duplication sample/C++/OutputManager.h: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | #ifndef _OUTPUTMANAGER_H_ 9 | #define _OUTPUTMANAGER_H_ 10 | 11 | #include 12 | 13 | #include "CommonTypes.h" 14 | #include "warning.h" 15 | 16 | // 17 | // Handles the task of drawing into a window. 18 | // Has the functionality to draw the mouse given a mouse shape buffer and position 19 | // 20 | class OUTPUTMANAGER 21 | { 22 | public: 23 | OUTPUTMANAGER(); 24 | ~OUTPUTMANAGER(); 25 | DUPL_RETURN InitOutput(HWND Window, INT SingleOutput, _Out_ UINT* OutCount, _Out_ RECT* DeskBounds); 26 | DUPL_RETURN UpdateApplicationWindow(_In_ PTR_INFO* PointerInfo, _Inout_ bool* Occluded); 27 | void CleanRefs(); 28 | HANDLE GetSharedHandle(); 29 | void WindowResize(); 30 | 31 | private: 32 | // Methods 33 | DUPL_RETURN ProcessMonoMask(bool IsMono, _Inout_ PTR_INFO* PtrInfo, _Out_ INT* PtrWidth, _Out_ INT* PtrHeight, _Out_ INT* PtrLeft, _Out_ INT* PtrTop, _Outptr_result_bytebuffer_(*PtrHeight * *PtrWidth * BPP) BYTE** InitBuffer, _Out_ D3D11_BOX* Box); 34 | DUPL_RETURN MakeRTV(); 35 | void SetViewPort(UINT Width, UINT Height); 36 | DUPL_RETURN InitShaders(); 37 | DUPL_RETURN InitGeometry(); 38 | DUPL_RETURN CreateSharedSurf(INT SingleOutput, _Out_ UINT* OutCount, _Out_ RECT* DeskBounds); 39 | DUPL_RETURN DrawFrame(); 40 | DUPL_RETURN DrawMouse(_In_ PTR_INFO* PtrInfo); 41 | DUPL_RETURN ResizeSwapChain(); 42 | 43 | // Vars 44 | IDXGISwapChain1* m_SwapChain; 45 | ID3D11Device* m_Device; 46 | IDXGIFactory2* m_Factory; 47 | ID3D11DeviceContext* m_DeviceContext; 48 | ID3D11RenderTargetView* m_RTV; 49 | ID3D11SamplerState* m_SamplerLinear; 50 | ID3D11BlendState* m_BlendState; 51 | ID3D11VertexShader* m_VertexShader; 52 | ID3D11PixelShader* m_PixelShader; 53 | ID3D11InputLayout* m_InputLayout; 54 | ID3D11Texture2D* m_SharedSurf; 55 | IDXGIKeyedMutex* m_KeyMutex; 56 | HWND m_WindowHandle; 57 | bool m_NeedsResize; 58 | DWORD m_OcclusionCookie; 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /DXGI desktop duplication sample/C++/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | //---------------------------------------------------------------------- 8 | 9 | Texture2D tx : register( t0 ); 10 | SamplerState samLinear : register( s0 ); 11 | 12 | struct PS_INPUT 13 | { 14 | float4 Pos : SV_POSITION; 15 | float2 Tex : TEXCOORD; 16 | }; 17 | 18 | //-------------------------------------------------------------------------------------- 19 | // Pixel Shader 20 | //-------------------------------------------------------------------------------------- 21 | float4 PS(PS_INPUT input) : SV_Target 22 | { 23 | return tx.Sample( samLinear, input.Tex ); 24 | } -------------------------------------------------------------------------------- /DXGI desktop duplication sample/C++/ThreadManager.h: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | 8 | #ifndef _THREADMANAGER_H_ 9 | #define _THREADMANAGER_H_ 10 | 11 | #include "CommonTypes.h" 12 | 13 | class THREADMANAGER 14 | { 15 | public: 16 | THREADMANAGER(); 17 | ~THREADMANAGER(); 18 | void Clean(); 19 | DUPL_RETURN Initialize(INT SingleOutput, UINT OutputCount, HANDLE UnexpectedErrorEvent, HANDLE ExpectedErrorEvent, HANDLE TerminateThreadsEvent, HANDLE SharedHandle, _In_ RECT* DesktopDim); 20 | PTR_INFO* GetPointerInfo(); 21 | void WaitForThreadTermination(); 22 | 23 | private: 24 | DUPL_RETURN InitializeDx(_Out_ DX_RESOURCES* Data); 25 | void CleanDx(_Inout_ DX_RESOURCES* Data); 26 | 27 | PTR_INFO m_PtrInfo; 28 | UINT m_ThreadCount; 29 | _Field_size_(m_ThreadCount) HANDLE* m_ThreadHandles; 30 | _Field_size_(m_ThreadCount) THREAD_DATA* m_ThreadData; 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /DXGI desktop duplication sample/C++/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 2 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 3 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 4 | // PARTICULAR PURPOSE. 5 | // 6 | // Copyright (c) Microsoft Corporation. All rights reserved 7 | //---------------------------------------------------------------------- 8 | 9 | struct VS_INPUT 10 | { 11 | float4 Pos : POSITION; 12 | float2 Tex : TEXCOORD; 13 | }; 14 | 15 | struct VS_OUTPUT 16 | { 17 | float4 Pos : SV_POSITION; 18 | float2 Tex : TEXCOORD; 19 | }; 20 | 21 | 22 | //-------------------------------------------------------------------------------------- 23 | // Vertex Shader 24 | //-------------------------------------------------------------------------------------- 25 | VS_OUTPUT VS(VS_INPUT input) 26 | { 27 | return input; 28 | } -------------------------------------------------------------------------------- /DXGI desktop duplication sample/description/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/DXGI desktop duplication sample/description/.DS_Store -------------------------------------------------------------------------------- /DXGI desktop duplication sample/description/Combined.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/DXGI desktop duplication sample/description/Combined.css -------------------------------------------------------------------------------- /DXGI desktop duplication sample/description/Layout.css: -------------------------------------------------------------------------------- 1 | #container { 2 | min-height: 768px; 3 | } 4 | 5 | #leftSubHeaderContainer 6 | { 7 | margin-top:20px; 8 | } 9 | 10 | #title h1 11 | { 12 | font-size:25px; 13 | } 14 | 15 | #subtitle h2 16 | { 17 | font-size:15px; 18 | } 19 | 20 | #subtitle 21 | { 22 | margin-left:10px; 23 | } 24 | 25 | 26 | #formContainer 27 | { 28 | margin-left:10px; 29 | margin-top:30px; 30 | } 31 | 32 | .formLabel 33 | { 34 | float:left; 35 | width: 250px; 36 | } 37 | 38 | .formRow 39 | { 40 | clear:both; 41 | padding: 10px 0 10px 10px; 42 | } 43 | 44 | 45 | .formRecaptchaRow 46 | { 47 | clear:both; 48 | float:left; 49 | margin-top:20px; 50 | margin-left:10px; 51 | margin-bottom:20px; 52 | } 53 | 54 | .formSubmitRow 55 | { 56 | clear:both; 57 | margin-top:20px; 58 | margin-left:300px; 59 | margin-bottom:20px; 60 | } 61 | 62 | .formControl { 63 | width:300px; 64 | float:left; 65 | } 66 | .formControl .textInput 67 | { 68 | width:300px; 69 | } 70 | 71 | .formControl textarea 72 | { 73 | width:425px; 74 | height:100px; 75 | } 76 | 77 | .formControl .tag 78 | { 79 | width:425px; 80 | } 81 | 82 | .formControl .richText 83 | { 84 | margin-top:10px; 85 | width:500px; 86 | height:440px; 87 | } 88 | 89 | .formWideLabel 90 | { 91 | width:500px; 92 | } 93 | 94 | .formBigLabel 95 | { 96 | margin-top:20px; 97 | font-size:20px; 98 | } 99 | 100 | .formControlBelow 101 | { 102 | clear:both; 103 | margin-top:10px; 104 | width:500px; 105 | } 106 | 107 | .required 108 | { 109 | color: Red; 110 | } 111 | .helpText 112 | { 113 | color: #9D9D9D; 114 | font-style: italic; 115 | } 116 | 117 | #agreementSummary 118 | { 119 | clear:both; 120 | margin-top:10px; 121 | width:800px; 122 | } 123 | 124 | .field-validation-error, .validation-summary-errors 125 | { 126 | color: #FF0000; 127 | font-weight: bold; 128 | } 129 | 130 | .tinyMCETemplate { 131 | position: relative; 132 | left: 400px; 133 | width: 300px; 134 | max-height: 300px; 135 | overflow: auto; 136 | } 137 | 138 | .IE6 .tinyMCETemplate { 139 | left: 25px; 140 | } 141 | 142 | .ownerBar { 143 | padding: 5px; 144 | } 145 | .ownerBar .ownerBarOptions { 146 | float: right; 147 | } 148 | -------------------------------------------------------------------------------- /DXGI desktop duplication sample/description/a7d1e078-8570-47da-a87b-ff462dfc958dCombined.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/DXGI desktop duplication sample/description/a7d1e078-8570-47da-a87b-ff462dfc958dCombined.css -------------------------------------------------------------------------------- /DXGI desktop duplication sample/description/offline.js: -------------------------------------------------------------------------------- 1 | var Galleries = Galleries || { }; 2 | 3 | (function() { 4 | 5 | function findElem(parent, tagName, className) { 6 | var elemToSearch = (parent) ? parent : document.body; 7 | var tagMatch = elemToSearch.getElementsByTagName(tagName); 8 | var evaluator = function(elem) { 9 | return (className) ? (elem.className.indexOf(className) > -1) : true; 10 | }; 11 | 12 | return findArrayElem(tagMatch, evaluator); 13 | } 14 | 15 | function findArrayElem(array, evaluator) { 16 | var newArray = new Array(); 17 | for (var count = 0; count < array.length; count++) { 18 | if (evaluator(array[count])) { 19 | newArray.push(array[count]); 20 | } 21 | } 22 | return newArray; 23 | } 24 | 25 | function iterateElem(elems, delegate) { 26 | for(var count = 0; count < elems.length; count++) { 27 | delegate(count, elems[count]); 28 | } 29 | } 30 | 31 | function isHidden(elem) { 32 | return (elem.offsetHeight === 0 && elem.offsetWidth === 0) || elem.style && elem.style.display === "none"; 33 | } 34 | 35 | function onWindowLoad(callback) { 36 | attachEventHandler(null, 'load', callback); 37 | } 38 | 39 | function attachEventHandler(elem, event, callback) { 40 | var elemToAttach = (elem) ? elem : window; 41 | if (document.addEventListener) { 42 | elemToAttach.addEventListener(event, callback, false); 43 | } else if ( document.attachEvent ) { 44 | elemToAttach.attachEvent('on' + event, callback); 45 | } 46 | } 47 | 48 | Galleries.findElem = findElem; 49 | Galleries.iterateElem = iterateElem; 50 | Galleries.attachEventHandler = attachEventHandler; 51 | Galleries.onWindowLoad = onWindowLoad; 52 | })(); -------------------------------------------------------------------------------- /Great reference projects/AForge.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/Great reference projects/AForge.zip -------------------------------------------------------------------------------- /Great reference projects/LinXSplit.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/Great reference projects/LinXSplit.rar -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CSharpDesktopDuplication 2 | graduation project, write in C#, with sharpDX, win8 desktop duplicaion API,more efficient than VNC, start at 2015-12-16 3 | this project will not update,transfer to "RemoteControlSystem2.0" project 4 | this project contains a server and a client,is a complete remote control system ,so you can control other computer in you pc desktop,you can see the desktop image ,control it's mouse , keyboard, etc ...... 5 | -------------------------------------------------------------------------------- /RemoteControl_PC.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}") = "ControlServer1.0", "ControlServer1.0\ControlServer1.0.csproj", "{0C15305D-6CA6-42CD-AB10-90CC959CE2A6}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlClient1.0", "ControlClient1.0\ControlClient1.0.csproj", "{CCB290E2-F44E-47F3-B431-8C9F1158A7C1}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|x86 = Debug|x86 14 | Release|Any CPU = Release|Any CPU 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {0C15305D-6CA6-42CD-AB10-90CC959CE2A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {0C15305D-6CA6-42CD-AB10-90CC959CE2A6}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {0C15305D-6CA6-42CD-AB10-90CC959CE2A6}.Debug|x86.ActiveCfg = Debug|x86 21 | {0C15305D-6CA6-42CD-AB10-90CC959CE2A6}.Debug|x86.Build.0 = Debug|x86 22 | {0C15305D-6CA6-42CD-AB10-90CC959CE2A6}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {0C15305D-6CA6-42CD-AB10-90CC959CE2A6}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {0C15305D-6CA6-42CD-AB10-90CC959CE2A6}.Release|x86.ActiveCfg = Release|Any CPU 25 | {0C15305D-6CA6-42CD-AB10-90CC959CE2A6}.Release|x86.Build.0 = Release|Any CPU 26 | {CCB290E2-F44E-47F3-B431-8C9F1158A7C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {CCB290E2-F44E-47F3-B431-8C9F1158A7C1}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {CCB290E2-F44E-47F3-B431-8C9F1158A7C1}.Debug|x86.ActiveCfg = Debug|Any CPU 29 | {CCB290E2-F44E-47F3-B431-8C9F1158A7C1}.Release|Any CPU.ActiveCfg = Release|Any CPU 30 | {CCB290E2-F44E-47F3-B431-8C9F1158A7C1}.Release|Any CPU.Build.0 = Release|Any CPU 31 | {CCB290E2-F44E-47F3-B431-8C9F1158A7C1}.Release|x86.ActiveCfg = Release|Any CPU 32 | {CCB290E2-F44E-47F3-B431-8C9F1158A7C1}.Release|x86.Build.0 = Release|Any CPU 33 | EndGlobalSection 34 | GlobalSection(SolutionProperties) = preSolution 35 | HideSolutionNode = FALSE 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /TestProject/BitmapTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Imaging; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | 9 | namespace ImageComparer 10 | { 11 | class BitmapTool 12 | { 13 | private static EncoderParameter p; 14 | private static EncoderParameters ps; 15 | private static ImageCodecInfo[] CodecInfo; 16 | private static ImageCodecInfo result; 17 | static BitmapTool() 18 | { 19 | 20 | CodecInfo = ImageCodecInfo.GetImageEncoders(); 21 | result = getcodecinfo("image/jpeg"); 22 | } 23 | /** 24 | * 25 | * 经过试验验证,同一幅图片只要是采用相同的压缩算法, 26 | * 最后得到的数据是完全一致的,所以完全可以先压缩在判断出图像的差异值, 27 | * 速度更快 28 | * 29 | */ 30 | 31 | private static ImageCodecInfo getcodecinfo(string codestr) 32 | { 33 | ImageCodecInfo result2 = ImageCodecInfo.GetImageEncoders()[0]; 34 | foreach (ImageCodecInfo ici in CodecInfo) //定义一个编码器型参数ici,并建立循环             35 | { 36 | if (ici.MimeType == codestr)//返回传递进来的格式的编码   37 | { 38 | result2 = ici; 39 | } 40 | } 41 | return result2; 42 | } 43 | /**jpeg压缩代码*/ 44 | //指定的数值越低,压缩越高,因此图像的质量越低。值为0 时,图像的质量最差;值为100 时,图像的质量最佳  45 | //得到图片的编码格式 46 | 47 | public static byte[] compressPictureToJpegBytesWithNewSize(Bitmap btm, int width, int height, int BitmapQty) 48 | { 49 | p = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, BitmapQty); 50 | ps = new EncoderParameters(1);             //EncoderParameters是EncoderParameter类的集合数组  51 | ps.Param[0] = p;   //将EncoderParameter中的值传递给EncoderParameters   52 | MemoryStream ret = new MemoryStream(); 53 | Bitmap bmb = new Bitmap(width, height);  //创建一个宽w长h的位图(画布)  54 | Graphics grap = Graphics.FromImage(bmb); //将要绘制的位图定义为grap。grap继承bmb              55 | grap.DrawImage(btm, new Rectangle(0, 0, width,height)); //用Rectangle指定一个区域,将img内Rectangle所指定的区域绘制到bmb  56 | grap.Dispose(); 57 | bmb.Save(ret, result, ps); 58 | bmb.Dispose(); 59 | ret.Close(); 60 | return ret.ToArray(); 61 | } 62 | 63 | public static Bitmap compressPictureToJpegWithNewSize(Bitmap btm, int width, int height, int BitmapQty) 64 | { 65 | p = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, BitmapQty); 66 | ps = new EncoderParameters(1);             //EncoderParameters是EncoderParameter类的集合数组  67 | ps.Param[0] = p;   //将EncoderParameter中的值传递给EncoderParameters   68 | MemoryStream ret = new MemoryStream(); 69 | Bitmap bmb = new Bitmap(width, height);  //创建一个宽w长h的位图(画布)  70 | Graphics grap = Graphics.FromImage(bmb); //将要绘制的位图定义为grap。grap继承bmb              71 | grap.DrawImage(btm, new Rectangle(0, 0, width, height)); //用Rectangle指定一个区域,将img内Rectangle所指定的区域绘制到bmb  72 | grap.Dispose(); 73 | bmb.Save(ret, result, ps); 74 | bmb.Dispose(); 75 | return new Bitmap(ret); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /TestProject/BlockQueue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Threading; 5 | 6 | namespace ImageComparer 7 | { 8 | class BlockQueue 9 | { 10 | 11 | 12 | public readonly Queue queue = null; 13 | private readonly int maxSize = 10; 14 | public BlockQueue(int maxSize) { this.maxSize = maxSize; queue = new Queue(); } 15 | 16 | public void Enqueue(T item) 17 | { 18 | lock (queue) 19 | { 20 | while (queue.Count >= maxSize) 21 | { 22 | try 23 | { 24 | Monitor.Wait(queue); 25 | } 26 | catch (ThreadInterruptedException ex) 27 | { 28 | // ErrorInfo.getErrorWriter().writeErrorMassageToFile(ex.Message + ex.StackTrace); 29 | goto END; 30 | } 31 | } 32 | queue.Enqueue(item); 33 | if (queue.Count == 1) 34 | { 35 | // wake up any blocked dequeue 36 | Monitor.PulseAll(queue); 37 | } 38 | } 39 | END: 40 | return; 41 | } 42 | public T Dequeue() 43 | { 44 | lock (queue) 45 | { 46 | while (queue.Count == 0) 47 | { 48 | try 49 | { 50 | Monitor.Wait(queue); 51 | } 52 | catch (ThreadInterruptedException ex) 53 | { 54 | //ErrorInfo.getErrorWriter().writeErrorMassageToFile(ex.Message + ex.StackTrace); 55 | goto END; 56 | } 57 | } 58 | T item = queue.Dequeue(); 59 | if (queue.Count == maxSize - 1) 60 | { 61 | // wake up any blocked enqueue 62 | Monitor.PulseAll(queue); 63 | } 64 | return item; 65 | } 66 | END: 67 | return default(T); 68 | } 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/BZip2/BZip2Exception.cs: -------------------------------------------------------------------------------- 1 | // BZip2.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | using ICSharpCode.SharpZipLib; 43 | 44 | namespace ICSharpCode.SharpZipLib.BZip2 45 | { 46 | /// 47 | /// BZip2Exception represents exceptions specific to Bzip2 algorithm 48 | /// 49 | #if !NETCF_1_0 && !NETCF_2_0 50 | [Serializable] 51 | #endif 52 | public class BZip2Exception : SharpZipBaseException 53 | { 54 | 55 | #if !NETCF_1_0 && !NETCF_2_0 56 | /// 57 | /// Deserialization constructor 58 | /// 59 | /// for this constructor 60 | /// for this constructor 61 | protected BZip2Exception(SerializationInfo info, StreamingContext context) 62 | : base(info, context) 63 | 64 | { 65 | } 66 | #endif 67 | /// 68 | /// Initialise a new instance of BZip2Exception. 69 | /// 70 | public BZip2Exception() 71 | { 72 | } 73 | 74 | /// 75 | /// Initialise a new instance of BZip2Exception with its message set to message. 76 | /// 77 | /// The message describing the error. 78 | public BZip2Exception(string message) : base(message) 79 | { 80 | } 81 | 82 | /// 83 | /// Initialise an instance of BZip2Exception 84 | /// 85 | /// A message describing the error. 86 | /// The exception that is the cause of the current exception. 87 | public BZip2Exception(string message, Exception exception) 88 | : base(message, exception) 89 | { 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/Checksums/IChecksum.cs: -------------------------------------------------------------------------------- 1 | // IChecksum.cs - Interface to compute a data checksum 2 | // Copyright (C) 2001 Mike Krueger 3 | // 4 | // This file was translated from java, it was part of the GNU Classpath 5 | // Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 6 | // 7 | // This program is free software; you can redistribute it and/or 8 | // modify it under the terms of the GNU General Public License 9 | // as published by the Free Software Foundation; either version 2 10 | // of the License, or (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program; if not, write to the Free Software 19 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | // 21 | // Linking this library statically or dynamically with other modules is 22 | // making a combined work based on this library. Thus, the terms and 23 | // conditions of the GNU General Public License cover the whole 24 | // combination. 25 | // 26 | // As a special exception, the copyright holders of this library give you 27 | // permission to link this library with independent modules to produce an 28 | // executable, regardless of the license terms of these independent 29 | // modules, and to copy and distribute the resulting executable under 30 | // terms of your choice, provided that you also meet, for each linked 31 | // independent module, the terms and conditions of the license of that 32 | // module. An independent module is a module which is not derived from 33 | // or based on this library. If you modify this library, you may extend 34 | // this exception to your version of the library, but you are not 35 | // obligated to do so. If you do not wish to do so, delete this 36 | // exception statement from your version. 37 | 38 | namespace ICSharpCode.SharpZipLib.Checksums 39 | { 40 | 41 | /// 42 | /// Interface to compute a data checksum used by checked input/output streams. 43 | /// A data checksum can be updated by one byte or with a byte array. After each 44 | /// update the value of the current checksum can be returned by calling 45 | /// getValue. The complete checksum object can also be reset 46 | /// so it can be used again with new data. 47 | /// 48 | public interface IChecksum 49 | { 50 | /// 51 | /// Returns the data checksum computed so far. 52 | /// 53 | long Value 54 | { 55 | get; 56 | } 57 | 58 | /// 59 | /// Resets the data checksum as if no update was ever called. 60 | /// 61 | void Reset(); 62 | 63 | /// 64 | /// Adds one byte to the data checksum. 65 | /// 66 | /// 67 | /// the data value to add. The high byte of the int is ignored. 68 | /// 69 | void Update(int value); 70 | 71 | /// 72 | /// Updates the data checksum with the bytes taken from the array. 73 | /// 74 | /// 75 | /// buffer an array of bytes 76 | /// 77 | void Update(byte[] buffer); 78 | 79 | /// 80 | /// Adds the byte array to the data checksum. 81 | /// 82 | /// 83 | /// The buffer which contains the data 84 | /// 85 | /// 86 | /// The offset in the buffer where the data starts 87 | /// 88 | /// 89 | /// the number of data bytes to add. 90 | /// 91 | void Update(byte[] buffer, int offset, int count); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/Core/INameTransform.cs: -------------------------------------------------------------------------------- 1 | // INameTransform.cs 2 | // 3 | // Copyright 2005 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | namespace ICSharpCode.SharpZipLib.Core 37 | { 38 | /// 39 | /// INameTransform defines how file system names are transformed for use with archives, or vice versa. 40 | /// 41 | public interface INameTransform 42 | { 43 | /// 44 | /// Given a file name determine the transformed value. 45 | /// 46 | /// The name to transform. 47 | /// The transformed file name. 48 | string TransformFile(string name); 49 | 50 | /// 51 | /// Given a directory name determine the transformed value. 52 | /// 53 | /// The name to transform. 54 | /// The transformed directory name 55 | string TransformDirectory(string name); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/Core/IScanFilter.cs: -------------------------------------------------------------------------------- 1 | // IScanFilter.cs 2 | // 3 | // Copyright 2006 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | namespace ICSharpCode.SharpZipLib.Core 39 | { 40 | /// 41 | /// Scanning filters support filtering of names. 42 | /// 43 | public interface IScanFilter 44 | { 45 | /// 46 | /// Test a name to see if it 'matches' the filter. 47 | /// 48 | /// The name to test. 49 | /// Returns true if the name matches the filter, false if it does not match. 50 | bool IsMatch(string name); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/Core/WindowsPathUtils.cs: -------------------------------------------------------------------------------- 1 | // WindowsPathUtils.cs 2 | // 3 | // Copyright 2007 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | namespace ICSharpCode.SharpZipLib.Core 39 | { 40 | /// 41 | /// WindowsPathUtils provides simple utilities for handling windows paths. 42 | /// 43 | public abstract class WindowsPathUtils 44 | { 45 | /// 46 | /// Initializes a new instance of the class. 47 | /// 48 | internal WindowsPathUtils() 49 | { 50 | } 51 | 52 | /// 53 | /// Remove any path root present in the path 54 | /// 55 | /// A containing path information. 56 | /// The path with the root removed if it was present; path otherwise. 57 | /// Unlike the class the path isnt otherwise checked for validity. 58 | public static string DropPathRoot(string path) 59 | { 60 | string result = path; 61 | 62 | if ( (path != null) && (path.Length > 0) ) { 63 | if ((path[0] == '\\') || (path[0] == '/')) { 64 | // UNC name ? 65 | if ((path.Length > 1) && ((path[1] == '\\') || (path[1] == '/'))) { 66 | int index = 2; 67 | int elements = 2; 68 | 69 | // Scan for two separate elements \\machine\share\restofpath 70 | while ((index <= path.Length) && 71 | (((path[index] != '\\') && (path[index] != '/')) || (--elements > 0))) { 72 | index++; 73 | } 74 | 75 | index++; 76 | 77 | if (index < path.Length) { 78 | result = path.Substring(index); 79 | } 80 | else { 81 | result = ""; 82 | } 83 | } 84 | } 85 | else if ((path.Length > 1) && (path[1] == ':')) { 86 | int dropCount = 2; 87 | if ((path.Length > 2) && ((path[2] == '\\') || (path[2] == '/'))) { 88 | dropCount = 3; 89 | } 90 | result = result.Remove(0, dropCount); 91 | } 92 | } 93 | return result; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/GZip/GZIPConstants.cs: -------------------------------------------------------------------------------- 1 | // GZipConstants.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // 5 | // This file was translated from java, it was part of the GNU Classpath 6 | // Copyright (C) 2001 Free Software Foundation, Inc. 7 | // 8 | // This program is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU General Public License 10 | // as published by the Free Software Foundation; either version 2 11 | // of the License, or (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | // 22 | // Linking this library statically or dynamically with other modules is 23 | // making a combined work based on this library. Thus, the terms and 24 | // conditions of the GNU General Public License cover the whole 25 | // combination. 26 | // 27 | // As a special exception, the copyright holders of this library give you 28 | // permission to link this library with independent modules to produce an 29 | // executable, regardless of the license terms of these independent 30 | // modules, and to copy and distribute the resulting executable under 31 | // terms of your choice, provided that you also meet, for each linked 32 | // independent module, the terms and conditions of the license of that 33 | // module. An independent module is a module which is not derived from 34 | // or based on this library. If you modify this library, you may extend 35 | // this exception to your version of the library, but you are not 36 | // obligated to do so. If you do not wish to do so, delete this 37 | // exception statement from your version. 38 | 39 | namespace ICSharpCode.SharpZipLib.GZip 40 | { 41 | 42 | /// 43 | /// This class contains constants used for gzip. 44 | /// 45 | sealed public class GZipConstants 46 | { 47 | /// 48 | /// Magic number found at start of GZIP header 49 | /// 50 | public const int GZIP_MAGIC = 0x1F8B; 51 | 52 | /* The flag byte is divided into individual bits as follows: 53 | 54 | bit 0 FTEXT 55 | bit 1 FHCRC 56 | bit 2 FEXTRA 57 | bit 3 FNAME 58 | bit 4 FCOMMENT 59 | bit 5 reserved 60 | bit 6 reserved 61 | bit 7 reserved 62 | */ 63 | 64 | /// 65 | /// Flag bit mask for text 66 | /// 67 | public const int FTEXT = 0x1; 68 | 69 | /// 70 | /// Flag bitmask for Crc 71 | /// 72 | public const int FHCRC = 0x2; 73 | 74 | /// 75 | /// Flag bit mask for extra 76 | /// 77 | public const int FEXTRA = 0x4; 78 | 79 | /// 80 | /// flag bitmask for name 81 | /// 82 | public const int FNAME = 0x8; 83 | 84 | /// 85 | /// flag bit mask indicating comment is present 86 | /// 87 | public const int FCOMMENT = 0x10; 88 | 89 | /// 90 | /// Initialise default instance. 91 | /// 92 | /// Constructor is private to prevent instances being created. 93 | GZipConstants() 94 | { 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/GZip/GZipException.cs: -------------------------------------------------------------------------------- 1 | // GZipException.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | using ICSharpCode.SharpZipLib; 43 | 44 | namespace ICSharpCode.SharpZipLib.GZip 45 | { 46 | /// 47 | /// GZipException represents a Gzip specific exception 48 | /// 49 | #if !NETCF_1_0 && !NETCF_2_0 50 | [Serializable] 51 | #endif 52 | public class GZipException : SharpZipBaseException 53 | { 54 | #if !NETCF_1_0 && !NETCF_2_0 55 | /// 56 | /// Deserialization constructor 57 | /// 58 | /// for this constructor 59 | /// for this constructor 60 | protected GZipException(SerializationInfo info, StreamingContext context) 61 | : base(info, context) 62 | 63 | { 64 | } 65 | #endif 66 | 67 | /// 68 | /// Initialise a new instance of GZipException 69 | /// 70 | public GZipException() 71 | { 72 | } 73 | 74 | /// 75 | /// Initialise a new instance of GZipException with its message string. 76 | /// 77 | /// A that describes the error. 78 | public GZipException(string message) 79 | : base(message) 80 | { 81 | } 82 | 83 | /// 84 | /// Initialise a new instance of . 85 | /// 86 | /// A that describes the error. 87 | /// The that caused this exception. 88 | public GZipException(string message, Exception innerException) 89 | : base (message, innerException) 90 | { 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/Main.cs: -------------------------------------------------------------------------------- 1 | // Main.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | // 36 | 37 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/SharpZipBaseException.cs: -------------------------------------------------------------------------------- 1 | // SharpZipBaseException.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | namespace ICSharpCode.SharpZipLib 43 | { 44 | /// 45 | /// SharpZipBaseException is the base exception class for the SharpZipLibrary. 46 | /// All library exceptions are derived from this. 47 | /// 48 | /// NOTE: Not all exceptions thrown will be derived from this class. 49 | /// A variety of other exceptions are possible for example 50 | #if !NETCF_1_0 && !NETCF_2_0 51 | [Serializable] 52 | #endif 53 | public class SharpZipBaseException : ApplicationException 54 | { 55 | #if !NETCF_1_0 && !NETCF_2_0 56 | /// 57 | /// Deserialization constructor 58 | /// 59 | /// for this constructor 60 | /// for this constructor 61 | protected SharpZipBaseException(SerializationInfo info, StreamingContext context ) 62 | : base( info, context ) 63 | { 64 | } 65 | #endif 66 | 67 | /// 68 | /// Initializes a new instance of the SharpZipBaseException class. 69 | /// 70 | public SharpZipBaseException() 71 | { 72 | } 73 | 74 | /// 75 | /// Initializes a new instance of the SharpZipBaseException class with a specified error message. 76 | /// 77 | /// A message describing the exception. 78 | public SharpZipBaseException(string message) 79 | : base(message) 80 | { 81 | } 82 | 83 | /// 84 | /// Initializes a new instance of the SharpZipBaseException class with a specified 85 | /// error message and a reference to the inner exception that is the cause of this exception. 86 | /// 87 | /// A message describing the exception. 88 | /// The inner exception 89 | public SharpZipBaseException(string message, Exception innerException) 90 | : base(message, innerException) 91 | { 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/Tar/TarException.cs: -------------------------------------------------------------------------------- 1 | // TarException.cs 2 | // 3 | // Copyright 2004 John Reilly 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with this program; if not, write to the Free Software 17 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | // 19 | // Linking this library statically or dynamically with other modules is 20 | // making a combined work based on this library. Thus, the terms and 21 | // conditions of the GNU General Public License cover the whole 22 | // combination. 23 | // 24 | // As a special exception, the copyright holders of this library give you 25 | // permission to link this library with independent modules to produce an 26 | // executable, regardless of the license terms of these independent 27 | // modules, and to copy and distribute the resulting executable under 28 | // terms of your choice, provided that you also meet, for each linked 29 | // independent module, the terms and conditions of the license of that 30 | // module. An independent module is a module which is not derived from 31 | // or based on this library. If you modify this library, you may extend 32 | // this exception to your version of the library, but you are not 33 | // obligated to do so. If you do not wish to do so, delete this 34 | // exception statement from your version. 35 | 36 | using System; 37 | 38 | #if !NETCF_1_0 && !NETCF_2_0 39 | using System.Runtime.Serialization; 40 | #endif 41 | 42 | using ICSharpCode.SharpZipLib; 43 | 44 | namespace ICSharpCode.SharpZipLib.Tar { 45 | 46 | /// 47 | /// TarExceptions are used for exceptions specific to tar classes and code. 48 | /// 49 | #if !NETCF_1_0 && !NETCF_2_0 50 | [Serializable] 51 | #endif 52 | public class TarException : SharpZipBaseException 53 | { 54 | #if !NETCF_1_0 && !NETCF_2_0 55 | /// 56 | /// Deserialization constructor 57 | /// 58 | /// for this constructor 59 | /// for this constructor 60 | protected TarException(SerializationInfo info, StreamingContext context) 61 | : base(info, context) 62 | 63 | { 64 | } 65 | #endif 66 | 67 | /// 68 | /// Initialises a new instance of the TarException class. 69 | /// 70 | public TarException() 71 | { 72 | } 73 | 74 | /// 75 | /// Initialises a new instance of the TarException class with a specified message. 76 | /// 77 | /// The message that describes the error. 78 | public TarException(string message) 79 | : base(message) 80 | { 81 | } 82 | 83 | /// 84 | /// 85 | /// 86 | /// A message describing the error. 87 | /// The exception that is the cause of the current exception. 88 | public TarException(string message, Exception exception) 89 | : base(message, exception) 90 | { 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/Zip/Compression/DeflaterPending.cs: -------------------------------------------------------------------------------- 1 | // DeflaterPending.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // Copyright (C) 2004 John Reilly 5 | // 6 | // This file was translated from java, it was part of the GNU Classpath 7 | // Copyright (C) 2001 Free Software Foundation, Inc. 8 | // 9 | // This program is free software; you can redistribute it and/or 10 | // modify it under the terms of the GNU General Public License 11 | // as published by the Free Software Foundation; either version 2 12 | // of the License, or (at your option) any later version. 13 | // 14 | // This program is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | // GNU General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU General Public License 20 | // along with this program; if not, write to the Free Software 21 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | // 23 | // Linking this library statically or dynamically with other modules is 24 | // making a combined work based on this library. Thus, the terms and 25 | // conditions of the GNU General Public License cover the whole 26 | // combination. 27 | // 28 | // As a special exception, the copyright holders of this library give you 29 | // permission to link this library with independent modules to produce an 30 | // executable, regardless of the license terms of these independent 31 | // modules, and to copy and distribute the resulting executable under 32 | // terms of your choice, provided that you also meet, for each linked 33 | // independent module, the terms and conditions of the license of that 34 | // module. An independent module is a module which is not derived from 35 | // or based on this library. If you modify this library, you may extend 36 | // this exception to your version of the library, but you are not 37 | // obligated to do so. If you do not wish to do so, delete this 38 | // exception statement from your version. 39 | 40 | namespace ICSharpCode.SharpZipLib.Zip.Compression 41 | { 42 | 43 | /// 44 | /// This class stores the pending output of the Deflater. 45 | /// 46 | /// author of the original java version : Jochen Hoenicke 47 | /// 48 | public class DeflaterPending : PendingBuffer 49 | { 50 | /// 51 | /// Construct instance with default buffer size 52 | /// 53 | public DeflaterPending() : base(DeflaterConstants.PENDING_BUF_SIZE) 54 | { 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /TestProject/ICSharpCode.SharpZLib/Zip/ZipException.cs: -------------------------------------------------------------------------------- 1 | // ZipException.cs 2 | // 3 | // Copyright (C) 2001 Mike Krueger 4 | // 5 | // This file was translated from java, it was part of the GNU Classpath 6 | // Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. 7 | // 8 | // This program is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU General Public License 10 | // as published by the Free Software Foundation; either version 2 11 | // of the License, or (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program; if not, write to the Free Software 20 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | // 22 | // Linking this library statically or dynamically with other modules is 23 | // making a combined work based on this library. Thus, the terms and 24 | // conditions of the GNU General Public License cover the whole 25 | // combination. 26 | // 27 | // As a special exception, the copyright holders of this library give you 28 | // permission to link this library with independent modules to produce an 29 | // executable, regardless of the license terms of these independent 30 | // modules, and to copy and distribute the resulting executable under 31 | // terms of your choice, provided that you also meet, for each linked 32 | // independent module, the terms and conditions of the license of that 33 | // module. An independent module is a module which is not derived from 34 | // or based on this library. If you modify this library, you may extend 35 | // this exception to your version of the library, but you are not 36 | // obligated to do so. If you do not wish to do so, delete this 37 | // exception statement from your version. 38 | 39 | using System; 40 | 41 | #if !NETCF_1_0 && !NETCF_2_0 42 | using System.Runtime.Serialization; 43 | #endif 44 | 45 | namespace ICSharpCode.SharpZipLib.Zip 46 | { 47 | 48 | /// 49 | /// Represents exception conditions specific to Zip archive handling 50 | /// 51 | #if !NETCF_1_0 && !NETCF_2_0 52 | [Serializable] 53 | #endif 54 | public class ZipException : SharpZipBaseException 55 | { 56 | #if !NETCF_1_0 && !NETCF_2_0 57 | /// 58 | /// Deserialization constructor 59 | /// 60 | /// for this constructor 61 | /// for this constructor 62 | protected ZipException(SerializationInfo info, StreamingContext context ) 63 | : base( info, context ) 64 | { 65 | } 66 | #endif 67 | 68 | /// 69 | /// Initializes a new instance of the ZipException class. 70 | /// 71 | public ZipException() 72 | { 73 | } 74 | 75 | /// 76 | /// Initializes a new instance of the ZipException class with a specified error message. 77 | /// 78 | /// The error message that explains the reason for the exception. 79 | public ZipException(string message) 80 | : base(message) 81 | { 82 | } 83 | 84 | /// 85 | /// Initialise a new instance of ZipException. 86 | /// 87 | /// A message describing the error. 88 | /// The exception that is the cause of the current exception. 89 | public ZipException(string message, Exception exception) 90 | : base(message, exception) 91 | { 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /TestProject/ImageComparer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComparerTest", "ComparerTest.csproj", "{EDA2817F-F7FB-4535-8E12-89300E6EAA6C}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {EDA2817F-F7FB-4535-8E12-89300E6EAA6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {EDA2817F-F7FB-4535-8E12-89300E6EAA6C}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {EDA2817F-F7FB-4535-8E12-89300E6EAA6C}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {EDA2817F-F7FB-4535-8E12-89300E6EAA6C}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /TestProject/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace ComparerTest 6 | { 7 | static class Program 8 | { 9 | /// 10 | /// 应用程序的主入口点。 11 | /// 12 | [STAThread] 13 | static void Main() 14 | { 15 | Application.EnableVisualStyles(); 16 | Application.SetCompatibleTextRenderingDefault(false); 17 | Application.Run(new Form1()); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /TestProject/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的常规信息通过下列属性集 6 | // 控制。更改这些属性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("ImageComparer")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Kingthy.com")] 12 | [assembly: AssemblyProduct("ImageComparer")] 13 | [assembly: AssemblyCopyright("Copyright © Kingthy.com 2009")] 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("c96416c1-cad6-4180-a652-e5b05fae0569")] 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 | -------------------------------------------------------------------------------- /TestProject/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ImageComparer.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("ImageComparer.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 win10 { 67 | get { 68 | object obj = ResourceManager.GetObject("win10", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /TestProject/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.34209 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ImageComparer.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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 | -------------------------------------------------------------------------------- /TestProject/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TestProject/Resources/win10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/TestProject/Resources/win10.jpg -------------------------------------------------------------------------------- /TestProject/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TestProject/libs/LZ4Sharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/TestProject/libs/LZ4Sharp.dll -------------------------------------------------------------------------------- /TestProject/libs/Simplicit.Net.Lzo.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/TestProject/libs/Simplicit.Net.Lzo.dll -------------------------------------------------------------------------------- /TestProject/libs/lzo.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/TestProject/libs/lzo.dll -------------------------------------------------------------------------------- /TestProject/libs/lzo2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/TestProject/libs/lzo2.dll -------------------------------------------------------------------------------- /TestProject/sshot-1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/TestProject/sshot-1.bmp -------------------------------------------------------------------------------- /TestProject/sshot-2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MichaelChansn/CSharpDesktopDuplication/12f387bcac27c1e4bf456d4f0beaccffa3794ec3/TestProject/sshot-2.bmp --------------------------------------------------------------------------------