I get this error
System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=Client StackTrace: at Client.Form1.SendMessageToolStripMenuItem1_Click(Object sender, EventArgs e) in C:\Users\crypt\Desktop\Client\Client\Form1.cs:line 114 at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at Client.Program.Main() in C:\Users\crypt\Desktop\Client\Client\Program.cs:line 23
Context
public static NetworkStream send;
private void SendMessageToolStripMenuItem1_Click(object sender, EventArgs e)
{
byte[] buffer = new byte[1048];
send.Write(buffer, 0, buffer.Length);
}
please help
this is for my remote message system
public static NetworkStream send;
private void SendMessageToolStripMenuItem1_Click(object sender, EventArgs e)
{
byte[] buffer = new byte[1048];
send.Write(buffer, 0, buffer.Length);
}
.
User contributions licensed under CC BY-SA 3.0