B. Given that $n$ is even, and $1 \leqslant n \leqslant 100$. If there is a unique pair of positive integers $(a, b)$ such that $a^{2}=b^{2}+n$ holds, then the number of such $n$ is
B. 12.

From the given, we have $(a-b)(a+b)=n$, and $n$ is even, so $a-b$ and $a+b$ are both even.
Therefore, $n$ is a multiple of 4.
Let $n=4m$. Then $1 \leqslant m \leqslant 25$.
(1) If $m=1$, we get $b=0$, which contradicts that $b$ is a positive integer.
(2) If $m$ has at least two different prime factors, then there are at least two pairs of positive integers $(a, b)$ that satisfy
$$
\frac{a-b}{2} \cdot \frac{a+b}{2}=m.
$$

If $m$ is exactly a power of a prime, and this power is not less than 3, then there are at least two pairs of positive integers $(a, b)$ that satisfy equation (1).
(3) If $m$ is a prime number, or $m$ is exactly a power of a prime, and this power is 2, then there is a unique pair of positive integers $(a, b)$ that satisfies equation (1).

Since there is a unique pair of positive integers $(a, b)$, the possible values of $m$ are
$$
2,3,4,5,7,9,11,13,17,19,23,25,
$$

a total of 12.