diff options
author | Marc-André Moreau <marcandre.moreau@gmail.com> | 2012-04-03 06:02:11 +0400 |
---|---|---|
committer | Marc-André Moreau <marcandre.moreau@gmail.com> | 2012-04-03 06:02:11 +0400 |
commit | 11ecae62117dd5710e1979002c6f375d3657e2d0 (patch) | |
tree | b7c431f32b7d5906d1e1adf202e6f052baec62b0 | |
parent | 21be5931871ef18b95e898ea5638f1646c3b2e6e (diff) |
NFreeRDP: initial commit
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | FreeRDP.sln | 16 | ||||
-rw-r--r-- | NFreeRDP/MainWindow.Designer.cs | 94 | ||||
-rw-r--r-- | NFreeRDP/MainWindow.cs | 41 | ||||
-rw-r--r-- | NFreeRDP/MainWindow.resx | 123 | ||||
-rw-r--r-- | NFreeRDP/NFreeRDP.csproj | 158 | ||||
-rw-r--r-- | NFreeRDP/Program.cs | 21 | ||||
-rw-r--r-- | NFreeRDP/Properties/AssemblyInfo.cs | 36 | ||||
-rw-r--r-- | NFreeRDP/Properties/Resources.Designer.cs | 71 | ||||
-rw-r--r-- | NFreeRDP/Properties/Resources.resx | 117 | ||||
-rw-r--r-- | NFreeRDP/Properties/Settings.Designer.cs | 30 | ||||
-rw-r--r-- | NFreeRDP/Properties/Settings.settings | 7 | ||||
-rw-r--r-- | NFreeRDP/RdpClient.cs | 143 |
13 files changed, 858 insertions, 0 deletions
@@ -1,5 +1,6 @@ bin +*.user *.userprefs *.pidb obj diff --git a/FreeRDP.sln b/FreeRDP.sln index ae11ce3..2265018 100644 --- a/FreeRDP.sln +++ b/FreeRDP.sln @@ -3,16 +3,32 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeRDP", "FreeRDP\FreeRDP.csproj", "{C5E8D831-864B-4BE7-8027-77727D5A6D80}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NFreeRDP", "NFreeRDP\NFreeRDP.csproj", "{DDCCC18C-7B29-431D-8F48-F6DCD579D272}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Mixed Platforms = Debug|Mixed Platforms Debug|x86 = Debug|x86 + Release|Mixed Platforms = Release|Mixed Platforms Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C5E8D831-864B-4BE7-8027-77727D5A6D80}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C5E8D831-864B-4BE7-8027-77727D5A6D80}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {C5E8D831-864B-4BE7-8027-77727D5A6D80}.Debug|x86.ActiveCfg = Debug|Any CPU {C5E8D831-864B-4BE7-8027-77727D5A6D80}.Debug|x86.Build.0 = Debug|Any CPU + {C5E8D831-864B-4BE7-8027-77727D5A6D80}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C5E8D831-864B-4BE7-8027-77727D5A6D80}.Release|Mixed Platforms.Build.0 = Release|Any CPU {C5E8D831-864B-4BE7-8027-77727D5A6D80}.Release|x86.ActiveCfg = Release|Any CPU {C5E8D831-864B-4BE7-8027-77727D5A6D80}.Release|x86.Build.0 = Release|Any CPU + {DDCCC18C-7B29-431D-8F48-F6DCD579D272}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {DDCCC18C-7B29-431D-8F48-F6DCD579D272}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {DDCCC18C-7B29-431D-8F48-F6DCD579D272}.Debug|x86.ActiveCfg = Debug|x86 + {DDCCC18C-7B29-431D-8F48-F6DCD579D272}.Debug|x86.Build.0 = Debug|x86 + {DDCCC18C-7B29-431D-8F48-F6DCD579D272}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {DDCCC18C-7B29-431D-8F48-F6DCD579D272}.Release|Mixed Platforms.Build.0 = Release|x86 + {DDCCC18C-7B29-431D-8F48-F6DCD579D272}.Release|x86.ActiveCfg = Release|x86 + {DDCCC18C-7B29-431D-8F48-F6DCD579D272}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/NFreeRDP/MainWindow.Designer.cs b/NFreeRDP/MainWindow.Designer.cs new file mode 100644 index 0000000..bb652d1 --- /dev/null +++ b/NFreeRDP/MainWindow.Designer.cs @@ -0,0 +1,94 @@ +namespace NFreeRDP +{ + partial class MainWindow + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newConnectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(780, 24); + this.menuStrip1.TabIndex = 0; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newConnectionToolStripMenuItem, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // newConnectionToolStripMenuItem + // + this.newConnectionToolStripMenuItem.Name = "newConnectionToolStripMenuItem"; + this.newConnectionToolStripMenuItem.Size = new System.Drawing.Size(163, 22); + this.newConnectionToolStripMenuItem.Text = "New Connection"; + this.newConnectionToolStripMenuItem.Click += new System.EventHandler(this.newConnectionToolStripMenuItem_Click); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(163, 22); + this.exitToolStripMenuItem.Text = "Exit"; + // + // MainWindow + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(780, 442); + this.Controls.Add(this.menuStrip1); + this.MainMenuStrip = this.menuStrip1; + this.Name = "MainWindow"; + this.Text = "FreeRDP"; + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newConnectionToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + } +} + diff --git a/NFreeRDP/MainWindow.cs b/NFreeRDP/MainWindow.cs new file mode 100644 index 0000000..4964a89 --- /dev/null +++ b/NFreeRDP/MainWindow.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using FreeRDP; + +namespace NFreeRDP +{ + public partial class MainWindow : Form + { + int port; + string hostname; + string username; + string domain; + string password; + + RdpClient rdpClient; + + public MainWindow() + { + InitializeComponent(); + } + + private void newConnectionToolStripMenuItem_Click(object sender, EventArgs e) + { + rdpClient = new RdpClient(); + + port = 3389; + hostname = "localhost"; + username = "Administrator"; + domain = ""; + password = "Password123!"; + + rdpClient.Connect(hostname, port, username, domain, password); + } + } +} diff --git a/NFreeRDP/MainWindow.resx b/NFreeRDP/MainWindow.resx new file mode 100644 index 0000000..d5494e3 --- /dev/null +++ b/NFreeRDP/MainWindow.resx @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root>
\ No newline at end of file diff --git a/NFreeRDP/NFreeRDP.csproj b/NFreeRDP/NFreeRDP.csproj new file mode 100644 index 0000000..a2697a6 --- /dev/null +++ b/NFreeRDP/NFreeRDP.csproj @@ -0,0 +1,158 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">x86</Platform> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{DDCCC18C-7B29-431D-8F48-F6DCD579D272}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>NFreeRDP</RootNamespace> + <AssemblyName>NFreeRDP</AssemblyName> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <TargetFrameworkProfile>Client</TargetFrameworkProfile> + <FileAlignment>512</FileAlignment> + <PublishUrl>publish\</PublishUrl> + <Install>true</Install> + <InstallFrom>Disk</InstallFrom> + <UpdateEnabled>false</UpdateEnabled> + <UpdateMode>Foreground</UpdateMode> + <UpdateInterval>7</UpdateInterval> + <UpdateIntervalUnits>Days</UpdateIntervalUnits> + <UpdatePeriodically>false</UpdatePeriodically> + <UpdateRequired>false</UpdateRequired> + <MapFileExtensions>true</MapFileExtensions> + <ApplicationRevision>0</ApplicationRevision> + <ApplicationVersion>1.0.0.%2a</ApplicationVersion> + <IsWebBootstrapper>false</IsWebBootstrapper> + <UseApplicationTrust>false</UseApplicationTrust> + <BootstrapperEnabled>true</BootstrapperEnabled> + <CodeContractsAssemblyMode>0</CodeContractsAssemblyMode> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <CodeContractsEnableRuntimeChecking>False</CodeContractsEnableRuntimeChecking> + <CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface> + <CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure> + <CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires> + <CodeContractsRuntimeSkipQuantifiers>False</CodeContractsRuntimeSkipQuantifiers> + <CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis> + <CodeContractsNonNullObligations>False</CodeContractsNonNullObligations> + <CodeContractsBoundsObligations>False</CodeContractsBoundsObligations> + <CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations> + <CodeContractsEnumObligations>False</CodeContractsEnumObligations> + <CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions> + <CodeContractsRunInBackground>True</CodeContractsRunInBackground> + <CodeContractsShowSquigglies>False</CodeContractsShowSquigglies> + <CodeContractsUseBaseLine>False</CodeContractsUseBaseLine> + <CodeContractsEmitXMLDocs>False</CodeContractsEmitXMLDocs> + <CodeContractsCustomRewriterAssembly /> + <CodeContractsCustomRewriterClass /> + <CodeContractsLibPaths /> + <CodeContractsExtraRewriteOptions /> + <CodeContractsExtraAnalysisOptions /> + <CodeContractsBaseLineFile /> + <CodeContractsCacheAnalysisResults>False</CodeContractsCacheAnalysisResults> + <CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel> + <CodeContractsReferenceAssembly>%28none%29</CodeContractsReferenceAssembly> + <CodeContractsAnalysisWarningLevel>0</CodeContractsAnalysisWarningLevel> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <PlatformTarget>x86</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Data" /> + <Reference Include="System.Deployment" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="MainWindow.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="MainWindow.Designer.cs"> + <DependentUpon>MainWindow.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="RdpClient.cs" /> + <EmbeddedResource Include="MainWindow.resx"> + <DependentUpon>MainWindow.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + <SubType>Designer</SubType> + </EmbeddedResource> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\FreeRDP\FreeRDP.csproj"> + <Project>{C5E8D831-864B-4BE7-8027-77727D5A6D80}</Project> + <Name>FreeRDP</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client"> + <Visible>False</Visible> + <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName> + <Install>true</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5 SP1</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> + <Visible>False</Visible> + <ProductName>Windows Installer 3.1</ProductName> + <Install>true</Install> + </BootstrapperPackage> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project>
\ No newline at end of file diff --git a/NFreeRDP/Program.cs b/NFreeRDP/Program.cs new file mode 100644 index 0000000..4abf3fb --- /dev/null +++ b/NFreeRDP/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace NFreeRDP +{ + static class Program + { + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainWindow()); + } + } +} diff --git a/NFreeRDP/Properties/AssemblyInfo.cs b/NFreeRDP/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ed585e2 --- /dev/null +++ b/NFreeRDP/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NFreeRDP")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NFreeRDP")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("160da08e-da2f-4958-9965-3364ecbc32bb")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NFreeRDP/Properties/Resources.Designer.cs b/NFreeRDP/Properties/Resources.Designer.cs new file mode 100644 index 0000000..b02bca2 --- /dev/null +++ b/NFreeRDP/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.261 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace NFreeRDP.Properties +{ + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NFreeRDP.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/NFreeRDP/Properties/Resources.resx b/NFreeRDP/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/NFreeRDP/Properties/Resources.resx @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file diff --git a/NFreeRDP/Properties/Settings.Designer.cs b/NFreeRDP/Properties/Settings.Designer.cs new file mode 100644 index 0000000..7d0863f --- /dev/null +++ b/NFreeRDP/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.261 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace NFreeRDP.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/NFreeRDP/Properties/Settings.settings b/NFreeRDP/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/NFreeRDP/Properties/Settings.settings @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile> diff --git a/NFreeRDP/RdpClient.cs b/NFreeRDP/RdpClient.cs new file mode 100644 index 0000000..08e9cdc --- /dev/null +++ b/NFreeRDP/RdpClient.cs @@ -0,0 +1,143 @@ +/** + * FreeRDP: A Remote Desktop Protocol Implementation + * RDP Connector + * + * Copyright 2011-2012 Marc-Andre Moreau <marcandre.moreau@gmail.com> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using FreeRDP; +using System.Threading; + +namespace NFreeRDP +{ + public unsafe class RdpClient : IUpdate, IPrimaryUpdate + { + private RDP rdp; + private int port; + private string hostname; + private string username; + private string domain; + private string password; + + private Thread thread; + private static bool procRunning = true; + + /** + * Instantiate RDP and Thread + */ + public RdpClient() + { + port = 3389; + hostname = "localhost"; + username = "Administrator"; + domain = ""; + password = ""; + rdp = new RDP(); + thread = new Thread(() => ThreadProc(rdp)); + } + + /** + * Connect to FreeRDP server, start thread + */ + public void Connect(string hostname, int port, string username, string domain, string password) + { + rdp.SetUpdateInterface(this); + rdp.SetPrimaryUpdateInterface(this); + rdp.Connect(hostname, port, username, domain, password); + procRunning = true; + thread.Start(); + } + + /** + * Disconnect from FreeRDP server, stop thread + */ + public void Disconnect() + { + rdp.Disconnect(); + procRunning = false; + thread = new Thread(() => ThreadProc(rdp)); + } + + public void OnMouseEvent(UInt16 pointerFlags, UInt16 x, UInt16 y) + { + rdp.SendInputMouseEvent(pointerFlags, x, y); + } + + public void OnKeyboardEvent(UInt16 keyboardFlags, UInt16 keyCode) + { + rdp.SendInputKeyboardEvent(keyboardFlags, keyCode); + } + + public void BeginPaint(rdpContext* context) { } + public void EndPaint(rdpContext* context) { } + public void SetBounds(rdpContext* context, rdpBounds* bounds) { } + public void Synchronize(rdpContext* context) { } + public void DesktopResize(rdpContext* context) { } + + public void BitmapUpdate(rdpContext* context, BitmapUpdate* bitmap) + { + Console.WriteLine("BitmapUpdate"); + } + + public void Palette(rdpContext* context, PaletteUpdate* palette) { } + public void PlaySound(rdpContext* context, PlaySoundUpdate* playSound) { } + + public void SurfaceBits(rdpContext* context, SurfaceBits* surfaceBits) + { + Console.WriteLine("SurfaceBits"); + SurfaceBitsCommand cmd = new SurfaceBitsCommand(); + cmd.Read(surfaceBits); + } + + public void DstBlt(rdpContext* context, DstBltOrder* dstblt) { } + public void PatBlt(rdpContext* context, PatBltOrder* patblt) { } + public void ScrBlt(rdpContext* context, ScrBltOrder* scrblt) { } + + public void OpaqueRect(rdpContext* context, OpaqueRectOrder* opaqueRect) + { + Console.WriteLine("OpaqueRect"); + } + + public void DrawNineGrid(rdpContext* context, DrawNineGridOrder* drawNineGrid) { } + public void MultiDstBlt(rdpContext* context, MultiDstBltOrder* multi_dstblt) { } + public void MultiPatBlt(rdpContext* context, MultiPatBltOrder* multi_patblt) { } + public void MultiScrBlt(rdpContext* context, MultiScrBltOrder* multi_scrblt) { } + public void MultiOpaqueRect(rdpContext* context, MultiOpaqueRectOrder* multi_opaque_rect) { } + public void MultiDrawNineGrid(rdpContext* context, MultiDrawNineGridOrder* multi_draw_nine_grid) { } + public void LineTo(rdpContext* context, LineToOrder* line_to) { } + public void Polyline(rdpContext* context, PolylineOrder* polyline) { } + public void MemBlt(rdpContext* context, MemBltOrder* memblt) { } + public void Mem3Blt(rdpContext* context, Mem3BltOrder* mem3blt) { } + public void SaveBitmap(rdpContext* context, SaveBitmapOrder* save_bitmap) { } + public void GlyphIndex(rdpContext* context, GlyphIndexOrder* glyph_index) { } + public void FastIndex(rdpContext* context, FastIndexOrder* fast_index) { } + public void FastGlyph(rdpContext* context, FastGlyphOrder* fast_glyph) { } + public void PolygonSC(rdpContext* context, PolygonSCOrder* polygon_sc) { } + public void PolygonCB(rdpContext* context, PolygonCBOrder* polygon_cb) { } + public void EllipseSC(rdpContext* context, EllipseSCOrder* ellipse_sc) { } + public void EllipseCB(rdpContext* context, EllipseCBOrder* ellipse_cb) { } + + static void ThreadProc(RDP rdp) + { + while (procRunning) + { + rdp.CheckFileDescriptor(); + Thread.Sleep(10); + } + } + } +} + |