rdp-portal/MainForm.cs

34 lines
981 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RDP_Portal {
public partial class MainForm : Form {
public MainForm() {
InitializeComponent();
}
private void buttonMoreOptions_Click(object sender, EventArgs e) {
ProcessStartInfo startInfo = new ProcessStartInfo {
CreateNoWindow = false,
UseShellExecute = false,
FileName = "mstsc.exe",
Arguments = "/edit test.rdp"
};
try {
var exeProcess = Process.Start(startInfo) ?? throw new InvalidOperationException();
exeProcess.WaitForExit();
} catch (Exception ex) {
MessageBox.Show(ex.ToString());
}
}
}
}