2. The number of positive integers $k$ for which the equation $a^{2}+b^{2}=k \cdot a b$ has positive integer solutions $(a, b)$ is ( ).
(A) 0
(B) 1
(C) more than 1, but only finitely many
(D) infinitely many
2. (B).

Let the greatest common divisor of $a$ and $b$ be $d$, $a=d \cdot a_{1}$, $b=d \cdot b_{1}$ ($a_{1}$ and $b_{1}$ are coprime), substituting into $a^{2}+b^{2}=k \cdot a b$ yields $a_{1}^{2}+b_{1}^{2}=k \cdot a_{1} b_{1}$. Therefore, $a_{1} \mid b_{1}$ and $b_{1} \mid a_{1}$, hence $a_{1}=b_{1}$, at this point $k=2$. When $k=2$, we can take $a=b$, which satisfies the requirement.

Solution: From $a^{2}+b^{2}=k a b$, we get $\left(\frac{a}{b}\right)^{2}-k \cdot \frac{a}{b}+1=0$, i.e., the equation $x^{2}-k \cdot x+1=0$ has a rational solution, so its discriminant $\Delta=k^{2}-4$ should be a perfect square. Let $k^{2}-4=c^{2}$ (where $c$ is a non-negative integer), then $(k-c)(k+c)=4=2 \times 2=1 \times 4$. Hence $k-c=2, k+c=2$, or $k-c=1, k+c=4$. From this, it is easy to see that $k=2$.