I have a problem which I can't solve.
I've made a program which sends a UDP-packet to a certain IP-address.
Here's source code:
byte[] packetData = System.Text.ASCIIEncoding.ASCII.GetBytes("<The Data of Packet>");
string IP = txtIP.ToString();
int Port = Convert.ToInt16(txtPort.Text);
IPEndPoint ep = new IPEndPoint(IPAddress.Parse(IP), Port);
Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,ProtocolType.Udp);
client.SendTo(packetData, ep);
Program asks for IP and port from the user as you can see, but when I try to run this program, I get error message:
'WDoS.Form1' does not contain a definition for 'button1_Click' and no extension method 'button1_Click' accepting a first argument of type 'WDoS.Form1' could be found (are you missing a using directive or an assembly reference?)
I've tried to solve this by myself, but I haven't been able to solve this problem.