One, (20 points) For a right-angled triangle with integer side lengths, if the lengths of its two legs are the roots of the equation
$$
x^{2}-(k+2) x+4 k=0
$$

find the value of $k$ and determine the lengths of the three sides of the right-angled triangle.
Given the right-angled sides are $a$ and $b$ (both have the same parity), so,
$$
\left\{\begin{array} { l } 
{ k - 6 + n = 1 6 , } \\
{ k - 6 - n = 2 }
\end{array} \text { or } \left\{\begin{array}{l}
k-6+n=8, \\
k-6-n=4 .
\end{array}\right.\right.
$$

Solving gives $k=15$ or 12.
When $k=15$,
$$
\begin{array}{l}
a+b=17, a b=60 \\
\Rightarrow a=5, b=12, c=13 ;
\end{array}
$$

When $k=12$,
$$
\begin{array}{l}
a+b=14, a b=48 \\
\Rightarrow a=6, b=8, c=10 .
\end{array}
$$