Dependence of the magnitude and direction of the persistent current on the magnetic flux in superconducting rings