Spin Dependent Transport Properties of Metallic and Semiconducting Nanostructures