Resonance effects in low and high energy electron diffraction by crystals