聊天客户端,其中System.windows.forms命名空间不存在

时间:2017-10-17 09:05:44

标签: c# asp.net namespaces

我正在asp.net上编写聊天客户端,并希望使用不存在的System.windows.forms命名空间。

我知道您无法在asp.net中使用system.windows.forms命名空间,但我如何使用此代码在asp.net中编写聊天客户端。

private void GChat_DataReceived(object sender, SimpleTCP.Message e)
{


        tbxStatus.Invoke((MethodInvoker)delegate ()
        {


            if ((e.MessageString) == tbxName.Text + " said: " + tbxMessage.Text + "")
            {
                tbxStatus.Text += "You said: " + tbxMessage.Text + "\r\n";
                tbxMessage.Clear();
                tbxStatus.SelectionStart = tbxStatus.Text.Length;
                tbxStatus.ScrollToCaret();

                if (this.WindowState == FormWindowState.Minimized)
                {
                    this.Hide();
                    notifyIcon1.ShowBalloonTip(1000, "Bat Signal Activated", "You Have New Messages", ToolTipIcon.Info);
                }
            }
            else
            {
                tbxStatus.Text += e.MessageString.Remove(e.MessageString.Length -1) + "\r\n";

                if (this.WindowState == FormWindowState.Minimized)
                {
                     this.Hide();
                     notifyIcon1.ShowBalloonTip(1000, "Bat Signal Activated", "You Have New Messages", ToolTipIcon.Info);
                }
            }
 });
 }
 }

0 个答案:

没有答案