We develop DeepOPF as a Deep Neural Network (DNN) approach for solving security-constrained direct current optimal power flow (SC-DCOPF) problems, which are critical for reliable and cost-effective power system operation. DeepOPF is inspired by the observation that solving the SC-DCOPF problem for a given power network is equivalent to depicting a high-dimensional mapping between load inputs and generation and phase-angle outputs. We first construct and train a DNN to learn the mapping between the load inputs and the generations. We then directly compute the phase angles from the generations and loads by using the (linearized) power flow equations. Such a two-step procedure significantly reduces the dimension of the mapping to learn, subsequently cutting down the size of the DNN and the amount of training data/time needed. We further characterize a condition that allows us to tune the size of our neural network according to the desired approximation accuracy of the load-to-generation mapping. Simulation results of IEEE test cases show that DeepOPF always generates feasible solutions with negligible optimality loss, while speeding up the computing time by up to 400x as compared to a state-of-the-art solver.