17. A student builds a tower using small cubes of the same shape but different colors. Using two red, three blue, and four green small cubes, the number of towers that can be built with any eight of these small cubes is ( ).
( A) 24
(B) 288
(C) 312
(D) 1260
(E) 40320
17. D.

Three cases:
(1) 1 Red 3 Blue 4 Green: $\frac{8!}{3!\times 4!}=280$;
(2) 2 Red 2 Blue 4 Green:
$$
\frac{8!}{2!\times 2!\times 4!}=420 \text {; }
$$
(3) 2 Red 3 Blue 3 Green:
$$
\frac{8!}{2!\times 3!\times 3!}=560 \text {. }
$$

In summary, $N=280+420+560=1260$.