  We investigate the evolution of the magnetic field of isolated pulsars and of
neutron stars in different kinds of binary systems, assuming the field to be
originally confined to the crust. Our results for the field evolution in
isolated neutron stars helps us to constrain the physical parameters of the
crust. Modelling the full evolution of a neutron star in a binary system
through several stages of interaction we compare the resulting final field
strength with that observed in neutron stars in various types of binary
systems. One of the interesting aspects of our result is a positive correlation
between the rate of accretion and the final field strength, for which some
observational indication already exists. Our results also match the overall
picture of the field evolution in neutron stars derived from observations.
