コード例 #1
0
        private void StartServer()
        {
            if (!CommonBehavior.VerifyPath(TbPath))
            {
                return;
            }
            if (!CommonBehavior.VerifyEndpoint(TbIp, TbPort, out IPEndPoint addr))
            {
                return;
            }

            TbIp.ReadOnly = TbPort.ReadOnly = TbPath.ReadOnly = true;
            WorkerAbort   = new CancellationTokenSource();
            Worker        = new Task(new Action(() => TcpWorker(addr)), WorkerAbort.Token);
            Worker.Start();
            BtnToggle.Text = "Stop";
        }