Periodic Solutions of Hamiltonian Systems in the Resonance Case