By applying nonequilibrium Green’s function formalism combined with first-principles density functional theory, we investigate the electronic transport properties of an anthracene-based optical molecular switch. The molecules that comprise the switch can convert between the monomer and dimer forms upon photoexcitation, and two forms can keep stable over a wider temperature range. The transmission spectra of two forms are remarkably distinctive. Theoretical results show that the current through the monomer form is significantly larger than that through the dimer form, which suggests that this system has attractive potential application in future molecular switch technology.