Let $X$ be a smooth irreducible projective algebraic curve of genus $g\geq 1$ and $S=X^2$ the surface one obtains as the cartesian product of $X$ with itself. Let $\Delta$ be the diagonal in $S$, that is to say, a copy of $X$ embedded diagonally in $X^2$.
Is the quasi-projective surface $U=S\setminus \Delta$ affine?
One criterion for showing affinness is showing that $\Delta$ is an ample divisor in $S$. But the self-intersection of $\Delta$ is $\Delta^2=2-2g<0$ and therefore $\Delta$ can not be ample. Does this already imply that $U$ is not affine? I guess not.
Besides, Serre's criterion provides a necessary and sufficient condition for $U$ to be affine: this is the case if and only if $H^i(U,\mathcal F)=0$ for all $i>0$ and all coherent sheaves $\mathcal F$ on $U$. But I don't know how to check this in this example.