none
程式指令寫法 RRS feed

  • 問題

  • 各位大大您们好:

               我再網路上看到一行程式的用法,覺得很神奇,又在網路上找不到相關資料,所以希望各位大大可以幫我,我將程式碼貼下來,紅色部分就是我一直不懂的寫法,謝謝各位大大的幫助

     

    ThreadPool.QueueUserWorkItem(new WaitCallback((stateInfo) =>
                    {
                        try
                        {
                            byte[] buf = new byte[1024];
                            int size = 0;
                            do
                            {
                                size = sendSocket.Receive(buf, 1024, SocketFlags.None);
                                if (size > 0)
                                {
                                    recMess = Encoding.ASCII.GetString(buf, 0, size);
                                    this.Invoke(new InvokeDelegate(() =>
                                        {
                                            textBox1.Text += "\r\nThe server said:" + recMess;
                                        }));
                                }
                            } while (size > 0);
                        }
                        catch { }
                    }));

    2009年1月21日 上午 06:06

解答

所有回覆