Example 7 satisfies that there are right-angled triangles with two legs of integer lengths, and the perimeter is exactly an integer multiple of the area. There are ( ) such triangles.
(A) 1
(B) 2
(C) 3
(D) infinitely many
(2007, National Junior High School Mathematics Competition, Zhejiang Province)
Explanation: Let the lengths of the two legs of a right triangle be $a$ and $b$ ($a \leqslant b$). Then,
$$
a+b+\sqrt{a^{2}+b^{2}}=k \cdot \frac{1}{2} a b\left(a, b, k \in \mathbf{N}_{+}\right) \text {. }
$$

Simplifying, we get $(k a-4)(k b-4)=8$.
Therefore, $\left\{\begin{array}{l}k a-4=1, \\ k b-4=8\end{array}\right.$ or $\left\{\begin{array}{l}k a-4=2, \\ k b-4=4 .\end{array}\right.$
Solving, we get
$$
(k, a, b)=(1,5,12) \text { or }(2,3,4) \text { or }(1,6,8) \text {. }
$$

There are three solutions in total. Hence, the answer is (C).