6. Divide each side of a square into 8 equal parts, and take the division points as vertices (excluding the vertices of the square), the number of different triangles that can be formed is ( ).
(A) 1372
(B) 2024
(C) 3136
(D) 4495
6. C.

Solution 1: First, note that the three vertices of the triangle are not on the same side of the square. Choose any three sides of the square so that each of the three vertices lies on one of them, which can be done in 4 ways.

Next, select a point on each of the chosen three sides, which can be done in $7^{3}$ ways.
The number of such triangles is $4 \times 7^{3}=1372$.
Additionally, if two vertices of the triangle are on one side of the square and the third vertex is on another side, first choose one side to have two vertices of the triangle, which can be done in 4 ways; then choose any two points on this side, which can be done in 21 ways; finally, choose one point from the remaining 21 points as the third vertex.
The number of such triangles is $4 \times 21 \times 21=1764$.
In summary, the number of different triangles is
$$
1372+1764=3136 \text {. }
$$

Solution 2: $C_{28}^{3}-4 C_{7}^{3}=3136$.