Fix a $\tau$-connection DL on a line bundle L over $X\times \mathbb{C}$, where X is a compact connected Riemann surface of genus at least three. Let $\mathcal{M}_X(D_L)$ denote the moduli space of all semistable $\tau$-connections of rank n, where $n\geq 2$, with the property that the induced $\tau$-connection on the top exterior product is isomorphic to (L, DL). Let $\mathcal{M}_Y(D_M)$ be the similar moduli space for another Riemann surface Y with genus(Y) = genus(X), where DM is a $\tau$-connection on a line bundle M over $Y\times \mathbb{C}$. We prove that if the variety $\mathcal{M}_X(D_L)$ is isomorphic to $\mathcal{M}_Y(D_M)$, then X is isomorphic to Y.
Let $\mathcal{M}^D_X$ denote the moduli space of all rank n flat connections on X. We prove that $\mathcal{M}^D_X$ determines X up to finitely many Riemann surfaces. For the very general Riemann surface X, the variety $\mathcal{M}^D_X$ determines X.