Fredholm Alternative for the Resonant Dirichlet Problem