We propose to measure Purcell effect by observing the current through a semeiconductor quantum dot embedded inside a microcavity. The stationary current is shown to be altered if one varies the cavity length. For the double-dot system, we find that the stationary current shows oscillatory behavior as one varies the inter-dot distance. Furthermore, the current is suppressed if the dot distance is small compared to the wavelength of the emitted photon. This photon trapping phenomenon generates the entangled state and may be used to control the emission of single photons at predetermined times.