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.

-
Just to clarify your question: it is easy to find isomorphism of rings that are not isomorphism of $k$-vector spaces. For instance, the Frobenius mapping $x\mapsto x^p$ is an automorphism of $\overline{\Bbb F}_p$ which is not ${\Bbb F}_{p^2}$-linear. Yet, this doesn't answer "no" to your question. – Andrea Mori Jan 3 '13 at 12:33
By the way, "finite $k$-algebra" conventionally means a $k$-algebra that is finitely-generated as a $k$-module – in particular it doesn't have to have finitely many elements! (This is the same convention as "finite field extension".) – Zhen Lin Jan 3 '13 at 13:06
@AndreaMori : thanks for this nice example!! – Lor Jan 3 '13 at 13:50
@ZhenLin : you're right of course; in the question I mean "with finitely many elements". – Lor Jan 3 '13 at 13:51

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$.
@ZhenLin: Both $A$ and $B$ are isomorphic to $\Bbb R$ as rings. It's only as $\Bbb R$-vector spaces that they are different. – Chris Eagle Jan 3 '13 at 12:49
@ZhenLin But I'm not using the ring structure of $\mathbb{R}^n$ :) – Alexei Averchenko Jan 3 '13 at 12:49
Thank you for your answer. Of course I want the same underlying group. I'm not familiar with infinite extensions, so please let me get this right: you are saying that $\mathbb{R} \cong \mathbb{R}^m \cong \mathbb{R}^n$ as abelian groups and as (infinite dimensional) $\mathbb{Q}$-spaces. In my notations, the field $k$ is $\mathbb{R}$, right? So you are taking $\mathbb{R}$ as ring and you put on it two non isomorphic structures of $\mathbb{R}$-space, right? – Lor Jan 3 '13 at 14:05