mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
23 lines
868 B
C#
23 lines
868 B
C#
using mRemoteNG.Connection.Protocol;
|
|
|
|
namespace mRemoteNG.Connection
|
|
{
|
|
public class WebHelper
|
|
{
|
|
public static void GoToUrl(string url)
|
|
{
|
|
var connectionInfo = new ConnectionInfo();
|
|
connectionInfo.CopyFrom(DefaultConnectionInfo.Instance);
|
|
|
|
connectionInfo.Name = "";
|
|
connectionInfo.Hostname = url;
|
|
connectionInfo.Protocol = url.StartsWith("https:") ? ProtocolType.HTTPS : ProtocolType.HTTP;
|
|
connectionInfo.SetDefaultPort();
|
|
if (string.IsNullOrEmpty(connectionInfo.Panel))
|
|
connectionInfo.Panel = Language.strGeneral;
|
|
connectionInfo.IsQuickConnect = true;
|
|
var connectionInitiator = new ConnectionInitiator();
|
|
connectionInitiator.OpenConnection(connectionInfo, ConnectionInfo.Force.DoNotJump);
|
|
}
|
|
}
|
|
} |