mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Added option to det enhanced mode as requested in #1564
This commit is contained in:
@@ -164,6 +164,13 @@ namespace mRemoteNG.Config.Serializers.Csv
|
||||
connectionRecord.UseVmId = value;
|
||||
}
|
||||
|
||||
if (headers.Contains("UseEnhancedMode"))
|
||||
{
|
||||
bool value;
|
||||
if (bool.TryParse(connectionCsv[headers.IndexOf("UseEnhancedMode")], out value))
|
||||
connectionRecord.UseEnhancedMode = value;
|
||||
}
|
||||
|
||||
if (headers.Contains("RenderingEngine"))
|
||||
{
|
||||
HTTPBase.RenderingEngine value;
|
||||
@@ -564,6 +571,13 @@ namespace mRemoteNG.Config.Serializers.Csv
|
||||
connectionRecord.Inheritance.UseVmId = value;
|
||||
}
|
||||
|
||||
if (headers.Contains("InheritUseEnhancedMode"))
|
||||
{
|
||||
bool value;
|
||||
if (bool.TryParse(connectionCsv[headers.IndexOf("InheritUseEnhancedMode")], out value))
|
||||
connectionRecord.Inheritance.UseEnhancedMode = value;
|
||||
}
|
||||
|
||||
if (headers.Contains("InheritRenderingEngine"))
|
||||
{
|
||||
bool value;
|
||||
|
||||
@@ -117,6 +117,7 @@ namespace mRemoteNG.Config.Serializers.Csv
|
||||
|
||||
sb.Append(FormatForCsv(con.Hostname))
|
||||
.Append(FormatForCsv(con.VmId))
|
||||
.Append(FormatForCsv(con.UseEnhancedMode))
|
||||
.Append(FormatForCsv(con.Protocol))
|
||||
.Append(FormatForCsv(con.PuttySession))
|
||||
.Append(FormatForCsv(con.Port))
|
||||
@@ -199,6 +200,7 @@ namespace mRemoteNG.Config.Serializers.Csv
|
||||
.Append(FormatForCsv(con.Inheritance.UseCredSsp))
|
||||
.Append(FormatForCsv(con.Inheritance.UseVmId))
|
||||
.Append(FormatForCsv(con.Inheritance.VmId))
|
||||
.Append(FormatForCsv(con.Inheritance.UseEnhancedMode))
|
||||
.Append(FormatForCsv(con.Inheritance.RenderingEngine))
|
||||
.Append(FormatForCsv(con.Inheritance.Username))
|
||||
.Append(FormatForCsv(con.Inheritance.ICAEncryptionStrength))
|
||||
|
||||
@@ -90,6 +90,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
|
||||
connectionInfo.Password = DecryptValue((string)dataRow["Password"]);
|
||||
connectionInfo.Hostname = (string)dataRow["Hostname"];
|
||||
connectionInfo.VmId = (string)dataRow["VmId"];
|
||||
connectionInfo.UseEnhancedMode = (bool)dataRow["UseEnhancedMode"];
|
||||
connectionInfo.Protocol = (ProtocolType)Enum.Parse(typeof(ProtocolType), (string)dataRow["Protocol"]);
|
||||
connectionInfo.PuttySession = (string)dataRow["PuttySession"];
|
||||
connectionInfo.Port = (int)dataRow["Port"];
|
||||
@@ -196,6 +197,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
|
||||
connectionInfo.Inheritance.UseConsoleSession = (bool)dataRow["InheritUseConsoleSession"];
|
||||
connectionInfo.Inheritance.UseCredSsp = (bool)dataRow["InheritUseCredSsp"];
|
||||
connectionInfo.Inheritance.UseVmId = (bool)dataRow["InheritUseVmId"];
|
||||
connectionInfo.Inheritance.UseEnhancedMode = (bool)dataRow["InheritUseEnhancedMode"];
|
||||
connectionInfo.Inheritance.VmId = (bool)dataRow["InheritVmId"];
|
||||
connectionInfo.Inheritance.RenderingEngine = (bool)dataRow["InheritRenderingEngine"];
|
||||
connectionInfo.Inheritance.Username = (bool)dataRow["InheritUsername"];
|
||||
|
||||
@@ -195,6 +195,8 @@ namespace mRemoteNG.Config.Serializers.MsSql
|
||||
dataTable.Columns.Add("InheritUseVmId", typeof(bool));
|
||||
dataTable.Columns.Add("RdpVersion", typeof(string));
|
||||
dataTable.Columns.Add("InheritRdpVersion", typeof(bool));
|
||||
dataTable.Columns.Add("EnhancedMode", typeof(bool));
|
||||
dataTable.Columns.Add("InheritEnhancedMode", typeof(bool));
|
||||
}
|
||||
|
||||
private void SetPrimaryKey(DataTable dataTable)
|
||||
@@ -241,6 +243,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
|
||||
dataRow["ConnectToConsole"] = connectionInfo.UseConsoleSession;
|
||||
dataRow["UseCredSsp"] = connectionInfo.UseCredSsp;
|
||||
dataRow["UseVmId"] = connectionInfo.UseVmId;
|
||||
dataRow["UseEnhancedMode"] = connectionInfo.UseEnhancedMode;
|
||||
dataRow["RenderingEngine"] = connectionInfo.RenderingEngine;
|
||||
dataRow["ICAEncryptionStrength"] = connectionInfo.ICAEncryptionStrength;
|
||||
dataRow["RDPAuthenticationLevel"] = connectionInfo.RDPAuthenticationLevel;
|
||||
@@ -324,6 +327,7 @@ namespace mRemoteNG.Config.Serializers.MsSql
|
||||
dataRow["InheritUsername"] = connectionInfo.Inheritance.Username;
|
||||
dataRow["InheritVmId"] = connectionInfo.Inheritance.VmId;
|
||||
dataRow["InheritUseVmId"] = connectionInfo.Inheritance.UseVmId;
|
||||
dataRow["InheritUseEnhancedMode"] = connectionInfo.Inheritance.UseEnhancedMode;
|
||||
dataRow["InheritICAEncryptionStrength"] = connectionInfo.Inheritance.ICAEncryptionStrength;
|
||||
dataRow["InheritRDPAuthenticationLevel"] = connectionInfo.Inheritance.RDPAuthenticationLevel;
|
||||
dataRow["InheritRDPMinutesToIdleTimeout"] = connectionInfo.Inheritance.RDPMinutesToIdleTimeout;
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace mRemoteNG.Config.Serializers.Xml
|
||||
element.Add(new XAttribute("Name", connectionInfo.Name));
|
||||
element.Add(new XAttribute("VmId", connectionInfo.VmId));
|
||||
element.Add(new XAttribute("UseVmId", connectionInfo.UseVmId));
|
||||
element.Add(new XAttribute("UseEnhancedMode", connectionInfo.UseVmId));
|
||||
element.Add(new XAttribute("Type", connectionInfo.GetTreeNodeType().ToString()));
|
||||
if (nodeAsContainer != null)
|
||||
element.Add(new XAttribute("Expanded", nodeAsContainer.IsExpanded.ToString().ToLowerInvariant()));
|
||||
@@ -296,6 +297,8 @@ namespace mRemoteNG.Config.Serializers.Xml
|
||||
connectionInfo.Inheritance.VmId.ToString().ToLowerInvariant()));
|
||||
element.Add(new XAttribute("InheritUseVmId",
|
||||
connectionInfo.Inheritance.UseVmId.ToString().ToLowerInvariant()));
|
||||
element.Add(new XAttribute("InheritUseEnhancedMode",
|
||||
connectionInfo.Inheritance.UseEnhancedMode.ToString().ToLowerInvariant()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -542,12 +542,14 @@ namespace mRemoteNG.Config.Serializers.Xml
|
||||
connectionInfo.Favorite = xmlnode.GetAttributeAsBool("Favorite");
|
||||
connectionInfo.UseVmId = xmlnode.GetAttributeAsBool("UseVmId");
|
||||
connectionInfo.VmId = xmlnode.GetAttributeAsString("VmId");
|
||||
connectionInfo.UseEnhancedMode = xmlnode.GetAttributeAsBool("UseEnhancedMode");
|
||||
connectionInfo.Inheritance.RedirectClipboard = xmlnode.GetAttributeAsBool("InheritRedirectClipboard");
|
||||
connectionInfo.Inheritance.Favorite = xmlnode.GetAttributeAsBool("InheritFavorite");
|
||||
connectionInfo.RdpVersion = xmlnode.GetAttributeAsEnum("RdpVersion", RdpVersion.Highest);
|
||||
connectionInfo.Inheritance.RdpVersion = xmlnode.GetAttributeAsBool("InheritRdpVersion");
|
||||
connectionInfo.Inheritance.UseVmId = xmlnode.GetAttributeAsBool("InheritUseVmId");
|
||||
connectionInfo.Inheritance.VmId = xmlnode.GetAttributeAsBool("InheritVmId");
|
||||
connectionInfo.Inheritance.UseEnhancedMode = xmlnode.GetAttributeAsBool("InheritUseEnhancedMode");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -29,8 +29,10 @@ ADD RedirectClipboard bit NOT NULL DEFAULT 0,
|
||||
InheritRedirectClipboard bit NOT NULL DEFAULT 0,
|
||||
VmId varchar NOT NULL DEFAULT 0,
|
||||
UseVmId bit NOT NULL DEFAULT 0,
|
||||
UseEnhancedMode bit NOT NULL DEFAULT 0,
|
||||
InheritVmId bit NOT NULL DEFAULT 0,
|
||||
InheritUseVmId bit NOT NULL DEFAULT 0;
|
||||
InheritUseVmId bit NOT NULL DEFAULT 0,
|
||||
InheritUseEnhancedMode bit NOT NULL DEFAULT 0;
|
||||
UPDATE tblRoot
|
||||
SET ConfVersion='2.7'";
|
||||
var dbCommand = _databaseConnector.DbCommand(sqlText);
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace mRemoteNG.Connection
|
||||
private string _password = "";
|
||||
private string _domain = "";
|
||||
private string _vmId = "";
|
||||
private bool _enhancedMode;
|
||||
|
||||
private ProtocolType _protocol;
|
||||
private RdpVersion _rdpProtocolVersion;
|
||||
@@ -193,6 +194,16 @@ namespace mRemoteNG.Connection
|
||||
set => SetField(ref _vmId, value?.Trim(), "VmId");
|
||||
}
|
||||
|
||||
[LocalizedAttributes.LocalizedCategory("strCategoryConnection", 2),
|
||||
LocalizedAttributes.LocalizedDisplayName("strPropertyNameUseEnhancedMode"),
|
||||
LocalizedAttributes.LocalizedDescription("strPropertyDescriptionUseEnhancedMode"),
|
||||
UsedInProtocol(ProtocolType.RDP)]
|
||||
public bool UseEnhancedMode
|
||||
{
|
||||
get => GetPropertyValue("EnhancedMode", _enhancedMode);
|
||||
set => SetField(ref _enhancedMode, value, "EnhancedMode");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protocol
|
||||
|
||||
@@ -166,6 +166,12 @@ namespace mRemoteNG.Connection
|
||||
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
|
||||
public bool UseVmId { get; set; }
|
||||
|
||||
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 4),
|
||||
LocalizedAttributes.LocalizedDisplayNameInherit("strPropertyNameUseEnhancedMode"),
|
||||
LocalizedAttributes.LocalizedDescriptionInherit("strPropertyDescriptionUseEnhancedMode"),
|
||||
TypeConverter(typeof(MiscTools.YesNoTypeConverter))]
|
||||
public bool UseEnhancedMode { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region RD Gateway
|
||||
|
||||
@@ -29,6 +29,8 @@ namespace mRemoteNG.Connection.Protocol.RDP
|
||||
rdpClient7.AdvancedSettings8.EnableCredSspSupport = true;
|
||||
rdpClient7.AdvancedSettings8.NegotiateSecurityLayer = false;
|
||||
rdpClient7.AdvancedSettings7.PCB = $"{connectionInfo.VmId};EnhancedMode=1";
|
||||
if (connectionInfo.UseEnhancedMode)
|
||||
rdpClient7.AdvancedSettings7.PCB += ";EnhancedMode=1";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -140,8 +140,10 @@ CREATE TABLE [dbo].[tblCons] (
|
||||
InheritRdpVersion bit DEFAULT ((0)) NOT NULL,
|
||||
VmId varchar(100),
|
||||
UseVmId bit,
|
||||
UseEnhancedMode bit,
|
||||
InheritVmId bit,
|
||||
InheritUseVmId bit
|
||||
InheritUseVmId bit,
|
||||
InheritUseEnhancedMode bit
|
||||
) GO
|
||||
|
||||
CREATE TABLE [dbo].[tblRoot] (
|
||||
|
||||
@@ -143,8 +143,10 @@ CREATE TABLE `tblCons` (
|
||||
`InheritRdpVersion` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`VmId` varchar(512) DEFAULT NULL,
|
||||
`UseVmId` tinyint(1) DEFAULT NULL,
|
||||
`UseEnhancedMode` tinyint(1) DEFAULT NULL,
|
||||
`InheritVmId` tinyint(1) DEFAULT NULL,
|
||||
`InheritUseVmId` tinyint(1) DEFAULT NULL,
|
||||
`InheritUseEnhancedMode` tinyint(1) DEFAULT NULL,
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3324 DEFAULT CHARSET=latin1;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
22
mRemoteV1/Resources/Language/Language.Designer.cs
generated
22
mRemoteV1/Resources/Language/Language.Designer.cs
generated
@@ -6288,6 +6288,17 @@ namespace mRemoteNG
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connect to a Hyper-V host with enhanced mode enabled..
|
||||
/// </summary>
|
||||
internal static string strPropertyDescriptionUseEnhancedMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceManager.GetString("strPropertyDescriptionUseEnhancedMode", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Feel free to enter any information you need here..
|
||||
/// </summary>
|
||||
@@ -6981,6 +6992,17 @@ namespace mRemoteNG
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Use enhanced mode.
|
||||
/// </summary>
|
||||
internal static string strPropertyNameUseEnhancedMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return ResourceManager.GetString("strPropertyNameUseEnhancedMode", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to User Field.
|
||||
/// </summary>
|
||||
|
||||
@@ -2825,4 +2825,10 @@ Development Channel includes Alphas, Betas & Release Candidates.</value>
|
||||
<data name="strPropertyDescriptionPasswordProtect" xml:space="preserve">
|
||||
<value>Set a password needed to encrypt the connection file with. You will be prompted to enter your passcode before starting mRemoteNG.</value>
|
||||
</data>
|
||||
<data name="strPropertyDescriptionUseEnhancedMode" xml:space="preserve">
|
||||
<value>Connect to a Hyper-V host with enhanced mode enabled.</value>
|
||||
</data>
|
||||
<data name="strPropertyNameUseEnhancedMode" xml:space="preserve">
|
||||
<value>Use enhanced mode</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -47,6 +47,7 @@
|
||||
<xs:attribute name="RdpVersion" type="xs:string" use="required" />
|
||||
<xs:attribute name="VmId" type="xs:string" use="required" />
|
||||
<xs:attribute name="UseVmId" type="xs:boolean" use="required" />
|
||||
<xs:attribute name="UseEnhancedMode" type="xs:boolean" use="required" />
|
||||
<xs:attribute name="PuttySession" type="xs:string" use="required" />
|
||||
<xs:attribute name="Port" type="xs:int" use="required" />
|
||||
<xs:attribute name="ConnectToConsole" type="xs:boolean" use="required" />
|
||||
@@ -139,6 +140,7 @@
|
||||
<xs:attribute name="InheritUseCredSsp" type="xs:boolean" use="optional" />
|
||||
<xs:attribute name="InheritVmId" type="xs:boolean" use="optional" />
|
||||
<xs:attribute name="InheritUseVmId" type="xs:boolean" use="optional" />
|
||||
<xs:attribute name="InheritUseEnhancedMode" type="xs:boolean" use="optional" />
|
||||
<xs:attribute name="InheritUserField" type="xs:boolean" use="optional" />
|
||||
<xs:attribute name="InheritExtApp" type="xs:boolean" use="optional" />
|
||||
<xs:attribute name="InheritFavorite" type="xs:boolean" use="optional" />
|
||||
|
||||
@@ -251,6 +251,7 @@ namespace mRemoteNG.UI.Controls.ConnectionInfoPropertyGrid
|
||||
if (!SelectedConnectionInfo.UseVmId)
|
||||
{
|
||||
strHide.Add(nameof(AbstractConnectionRecord.VmId));
|
||||
strHide.Add(nameof(AbstractConnectionRecord.UseEnhancedMode));
|
||||
}
|
||||
|
||||
return strHide;
|
||||
|
||||
Reference in New Issue
Block a user