Crank-Nicolson (C-N) Method combined with $ B $-spline basis set can be used in both time-dependent and time-independent calculations of the photoionization cross sections of atoms and molecules. For time-independent systems, it is found that C-N method in imaginary-time propagation (ITP) can converge directly to not only the ground state, but also excited and continuum states by controlling the time step size. The C-N method can also be directly applied in time-dependent calculations. Both time-dependent and time-independent calculations agree very well with previous results. This method can also be extended to two-electron systems directly.