In this paper, the method of lines (MoL) is successfully extended to solve the EM wave scattering problems of two dimensional metallic periodic surfaces. Compared with available data, the method is proven to be accurate and feasible. For different structures only a slight change of matrix elements is needed to be handled in numerical calculation. Meanwhile, the method presented here possesses the advantage of less computation. The results of groove, comb, and sinusoidal surfaces are presented.