Significant differences in superconducting and microstructural properties between two types of MgB2 films prepared by pulsed laser deposition were determined. A very high Hc2-T slope of 1.1 T/K was achieved in the in situ film. The Jc-H curves of the in situ film also show a much weaker field dependence than that of the ex situ film. The magneto-optical (MO) images show that at 4 K the flux penetrates the in situ MgB2 film through random paths, while for the ex situ film, the flux penetration pattern is mostly repeatable, indicating a defect-controlled flux penetration. Microstructural study (transmission electron microscopy and atomic force microscopy) revealed a relatively big grain size in the ex situ film. The correlation between the superconducting properties, microstructure and preparation conditions is discussed with regard to the two types of films.