  We study in detail, solving the Bogoliubov-de Gennes equations, the magnetic
field, supercurrent and order parameter profiles originated by a solenoid or
magnetic whisker inserted in a type-II superconductor. We consider solutions of
different vorticities, n, in the various cases. The results confirm the
connection between the vorticity, the internal currents and the boundstates in
a self-consistent way. The number of boundstates is given by the vorticity of
the phase of the gap function as in the case with no external solenoid. In the
limiting case of an infinitely thin solenoid, like a Dirac string, the solution
is qualitatively different. The quasiparticle spectrum and wave functions are a
function of n-n_ext, where n_ext is the vorticity of the solenoid. The flux is
in all cases determined by the vorticity of the gap function.
