Fabrication and electrical and photosensitive properties of silicon nanowire p–n homojunctions