⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 26.6.txt

📁 《Microsoft Visual C# .NET 2003开发技巧大全》源代码
💻 TXT
字号:
Listing 26.6 Creating a Listener Thread
using System;
using System.Threading;
using System.Net.Sockets;
using System.IO;
using System.Text;
namespace _7_IRChatClient
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox tbTranscript;
private System.Windows.Forms.TextBox tbMessage;
private System.Windows.Forms.Button btnSend;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem mnuExit;
private Thread listenerThread;
private string serviceType = “IRDA_CHAT”;
IrDAListener listener;
public Form1()
{
InitializeComponent();
// create the IR listener
listener = new IrDAListener( serviceType );
// create the thread and start it
listenerThread = new Thread( new ThreadStart(
ListenerThreadMethod ));
listenerThread.Start();
}
void ListenerThreadMethod()
{
}
// continued…
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -