Isomorphism of rings implies isomorphism of vector spaces?
Let $A$ and $B$ be isomorphic unitary rings. Suppose that both of them admit a structure of (maybe finite dimensional) vector space over some field $k$. I would like to know if then $A$ and $B$ are isomorphic as vector spaces over $k$ (if they are forced to have the same dimension). Notice that in general I am not requiring $A$ and $B$ to be $k$-algebras, i.e. I am not requiring any kind of compatibility between the multiplicative structure and the product with scalars from the field. My guess is that in this generality the answer is no, but I can't provide nor find any example.
Here I gather some things I can prove:
1) if the field is $k=\mathbb{Q}$ and $A$ and $B$ are $k$-algebras, then the answer is yes.
2) if the field is $k=\mathbb{R}$, $A$ and $B$ are $k$-algebras and they are fields, then the answer is yes again.
3) if $A$ and $B$ are finite $k$-algebras (and so $k$ is finite too) the answer is yes again.
Unfortunately these rule out most of the examples from a first course in ring theory, so I suspect the answer would be more exotic than this, but I can't find anything. Maybe the answer is yes even in the general setting (or maybe just for $k$-algebras), and in this case I'd like to see a proof.
Thanks in advance.
I assume you want both the ring and the vector space structures to share the same abelian group structure. $A = B = \mathbb{R}$. Give $A$ the structure of $\mathbb{R}^n$ and give $B$ the structure of $\mathbb{R}^m$, $n \neq m$. You can do it because $\mathbb{R}^n \cong \mathbb{R}^m$ as vector spaces over $\mathbb{Q}$ and thus as abelian groups, given the axiom of choice.
To prove this, consider a Hamel basis $X$ of $\mathbb{R}$ over $\mathbb{Q}$. $\operatorname{card} X = \mathfrak{c}$, thus $X^m \cong X \cong X^n$ as sets, which induces the isomorphism of $\mathbb{R}^m \cong \mathbb{R} \cong \mathbb{R}^n$.
Edit: to the downvoters: please provide a reason.