$6 . a 、 b$ are integers, it is known that the equation about $x$
$$
\frac{1}{4} x^{2}-a x+a^{2}+a b-a-b-1=0
$$

has two identical real roots. Then $a-b$ equals ( ).
(A) 1
(B) 2
(C) $\pm 1$
(D) $\pm 2$
6.C.

According to the problem,
$$
\begin{aligned}
\Delta & =a^{2}-4 \times \frac{1}{4}\left(a^{2}+a b-a-b-1\right) \\
& =-a b+a+b+1=0, \\
& (a-1)(b-1)=2=2 \times 1=1 \times 2 \\
& =(-1) \times(-2)=(-2) \times(-1) .
\end{aligned}
$$

Solving, we get $a-b=1$ or $a-b=-1$.