更新 Controller类

改善错误输出
This commit is contained in:
ChsBuffer
2020-07-17 19:18:29 +08:00
parent a779295525
commit 281c67aced
17 changed files with 195 additions and 254 deletions

View File

@@ -11,8 +11,8 @@ namespace Netch.Controllers
public NTTController()
{
MainFile = "NTT";
InitCheck();
Name = "NTT";
MainFile = "NTT.exe";
}
/// <summary>
@@ -21,10 +21,9 @@ namespace Netch.Controllers
/// <returns></returns>
public (bool, string, string, string) Start()
{
if (!Ready) return (false, null, null, null);
try
{
Instance = GetProcess("bin\\NTT.exe");
Instance = GetProcess();
Instance.StartInfo.Arguments = $" {Global.Settings.STUN_Server} {Global.Settings.STUN_Server_Port}";
@@ -52,7 +51,7 @@ namespace Netch.Controllers
}
}
private void OnOutputDataReceived(object sender, DataReceivedEventArgs e)
private new void OnOutputDataReceived(object sender, DataReceivedEventArgs e)
{
if (!string.IsNullOrEmpty(e.Data))
_lastResult = e.Data;