6. B. Given that the lengths of the two legs are integers $a$ and $b$ $(b<2011)$. Then the number of right triangles with the hypotenuse length $b+1$ is
6. B. 31.
By the Pythagorean theorem, we have
$$
a^{2}=(b+1)^{2}-b^{2}=2 b+1 \text{. }
$$

Given $b<2011$, we know that $a$ is an odd number in the interval $(1, \sqrt{4023})$, so $a$ must be $3, 5, \cdots, 63$.
Therefore, there are 31 right-angled triangles that satisfy the conditions.