A finite-difference approach is used to develop a time-dependent mild-slope equation incorporating the effects of bottom dissipation and nonlinearity. The Enler predietor-corrector method and the three-point finite-difference method with varying spatial steps are adopted to discretize the time derivatives and the two-dimensional horizontal ones, respectively, thus leading both the time and spatial derivatives to the second-order accuracy. The boundary conditions for the present model are treated on the basis of the general conditions for open and fixed boundaries with an arbitrary reflection coefficient and phase shift. Both the linear and nonlinear versions of the numerical model are applied to the wave propagation and transformation over an elliptic shoal on a sloping beach, respectively, and the linear version is applied to the simulation of wave propagation in a fully open rectangular harbor. From comparison of numerical results with theoretical or experimental ones, it is found that they are in reasonable agreement.