Static methods and variables are available without an instance of the class.
The most important thing to know about static variables is that in each process there is only one instance of this variable (more precisely, AppDomain, however most processes have only 1 AppDomain). I believe that static variables are global variables. You can create static class constructors to initialize these static variables. The static constructor is called once when this class gets the first access. But keep in mind concurrency issues regarding multi-threaded applications that allow access and modification of static elements, especially static collections!
Static methods can be considered as a function in C. They can be called without creating any object, which is slightly better for performance (but should only be used in those places where they make sense). For example, I would use the int method CountNumberOfCommas (string s) as a static method in a static utility class, since this is an operation that does not depend on any instance of the class.
You are not doing anything wrong. You just need to choose one of two options: you can create an instance of the program and call InitPort, or make InitPort static, and not create an instance of the program. Creating all the static ones is essentially the same as writing a C program, where you define only functions.
source share