正在执行主编译...
c:\documents and settings\aa\my documents\visual studio projects\windowsapplication66\form1.cs(188,3): error CS0116: 命名空间并不直接包含诸如字段或方法之类的成员
c:\documents and settings\aa\my documents\visual studio projects\windowsapplication66\form1.cs(248,10): error CS1518: 应输入 class、delegate、enum、interface 或 struct生成完成 -- 2 个错误,0 个警告
正在生成附属程序集...
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace WindowsApplication66
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.ListBox listBox2;
private System.Windows.Forms.Label label1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null; public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();

//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
Socket socket;
Thread recvThread;
IPAddress address=IPAddress.Parse("244.100.0.1");
IPEndPoint multiIPEndPoint;
this.textBox1.Text="";
multiIPEndPoint=new IPEndPoint(address,6788);
socket=new Socket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp);
IPEndPoint iep=new IPEndPoint(IPAddress.Any,6788);
EndPoint ep=(EndPoint)iep;
socket.Bind(ep);
socket.SetSocketOption(SocketOptionLevel.IP,SocketOptionName.AddMembership,new MulticastOption(address));
recvThread=new Thread(new ThreadStart(ReceiveMessage));
recvThread.IsBackground=true;
recvThread.Start();
byte[] bytes=System.Text.Encoding.GetBytes("#");
socket.SendTo(bytes,SocketFlags.None,multiIPEndPoint);
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null) 
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void ReceiveMessage()
{
EndPoint ep=(EndPoint)multiIPEndPoint;
byte[] bytes=new byte[1024];
string str;
int length;
while(true)
{
length=socket.ReceiveFrom(bytes,ref ep);
string epAddress=ep.ToString;
epAddress=epAddress.Substring(0,epAddress.LastIndexOf(":"));
str=System.Text.Encoding.Unicode.GetString(bytes,0,length);
switch(str[0])
{
case'#':
this.listBox1.Items.Add("["+epAddress+"]进入。");
string str1="&:"+epaddress;
for(int i=0;i<this.listBox2.Items.Count;i++)
{
str1+=":"+this.listBox2.Items[i].ToString();
}
byte[] users=System.Text.Encoding.Unicode.GetBytes(str1);
socket.SendTo(users,SocketFlags.None,multiIPEndPoint);
break;
case'@':
this.listBox1.Items.Add("["+epAddress+"]退出。");
this.listBox2.Items.Remove(epAddress);
break; case'&':
string[] strArray=str.Split(':');
for(int i=1;i<strArray.Length;i++)
{
bool isExist=false;
for(int j=0;j<this.listBox2.Count;j++)
{
if(strArray[i]==this.listBox2.Items[j].ToString())
{
isExist=true;
break;
}
}
}
if(isExist==false)
{
this.listBox2.Items.Add(strArray[i]);
}

break;
case'!':
this.listBox1.Items.Add("["+epAddress+"]说:");
this.listBox2.Items.Add(str.Substring(1));
this.listBox1.SelectedIndex=this.listBox1.Items.Count-1;
break;
}
}
}
private void textBox1_KeyPress(object sender,System.Windows.Forms.KeyPressEventArgs e)
{
if(e.KeyChar==(char)Keys.Return)
{
if(this.textBox1.Text.Trim().Length>0)
{
byte[] bytes=System.Text.Encoding.Unicode.GetBytes("!"+this.textBox1.Text);
this.textBox1.Text="";
socket.SendTo(bytes,SocketFlags.None,multiIPEndPoint);
}
}
} private void Form1_Closing(object sender,System.ComponentModel.CancelEventArgs e)
{
byte[] bytes=System.Text.Encoding.Unicode.GetBytes("@");
socket.SendTo(bytes,SocketFlags.None,multiIPEndPoint);
recvThread.Abort(); 
socket.Close();
} private void InitializeComponent()
{
// 
// Form1
// 
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Name = "Form1";
this.Load += new System.EventHandler(this.Form1_Load); } private void Form1_Load(object sender, System.EventArgs e)
{

}
} #region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.listBox1 = new System.Windows.Forms.ListBox();
this.listBox2 = new System.Windows.Forms.ListBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
// 
// textBox1
// 
this.textBox1.Location = new System.Drawing.Point(104, 208);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(152, 21);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "textBox1";
// 
// listBox1
// 
this.listBox1.ItemHeight = 12;
this.listBox1.Location = new System.Drawing.Point(40, 8);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(112, 88);
this.listBox1.TabIndex = 1;
// 
// listBox2
// 
this.listBox2.ItemHeight = 12;
this.listBox2.Location = new System.Drawing.Point(176, 40);
this.listBox2.Name = "listBox2";
this.listBox2.Size = new System.Drawing.Size(96, 88);
this.listBox2.TabIndex = 2;
// 
// label1
// 
this.label1.Location = new System.Drawing.Point(24, 208);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 24);
this.label1.TabIndex = 3;
this.label1.Text = "label1";
// 
// Form1
// 
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.label1);
this.Controls.Add(this.listBox2);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false); }
#endregion /// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main() 
{
Application.Run(new Form1());
} private void Form1_Load(object sender, System.EventArgs e)
{

}
}
各位帮我找找问题出在哪里