3. Let $a, b$ be positive integers, and $a+b, a+5, b-2$ are the lengths of the three sides of a right-angled triangle. Then the number of positive integer pairs $(a, b)$ is $(\quad)$.
(A) 0
(B) 1
(C) 2
(D) 3
3.A.

If $a+b$ is the length of the hypotenuse, then
$$
(a+b)^{2}=(a+5)^{2}+(b-2)^{2} \text {, }
$$

which simplifies to $2(ab-5a+2b)=29$.
The left side of the equation is even, while the right side is odd, leading to a contradiction.
If $a+5$ is the length of the hypotenuse, then
$$
(a+5)^{2}=(a+b)^{2}+(b-2)^{2} \text {, }
$$

which simplifies to $2(5a-ab-b^{2}+2b)=-21$.
This is a contradiction.
If $b-2$ is the length of the hypotenuse, then
$$
(b-2)^{2}=(a+b)^{2}+(a+5)^{2},
$$

which simplifies to $2(a^{2}+ab+5a+2b)=-21$.
This is also a contradiction.
Therefore, there are no positive integer pairs $(a, b)$ that satisfy the conditions.