[Solved] Any Visual Studio Programs are not letting me code


Your code isn’t in a method.

You cannot declare a variable and assign it separately within the class scope. You also cannot put random expressions in class scope. Change your code to this:

public class PacketReader
{
    Socket MainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);

    public PacketReader() {
        // rest of the code here in your constructor
    }
}

This is going to sound mean.. but if you are unaware of basic language structure rules like this… then a packet monitor may just be out of your reach.

7

solved Any Visual Studio Programs are not letting me code