Based on ab initio methods and nonequilibrium Green's function theory, we have investigated the photoswitching mechanism of diarylethenes with a phenyl linker and the effect of F-substituent on the photoswitchable performance. Numerical results show that the current through the closed-state system is larger than that through the open-state system under small bias, indicating the switching behavior is stable under small bias, and the photoswitchable performance can be improved by F-substituent significantly.