A housing mechanism (100) includes a main body (10) and a shield (20). The main body includes a pair of guiding portions (142) and at least one port (146) defined through the sidewall (14) thereof. The shield includes a pair of guiding poles (242) provided on an inner surface (24) thereof. The shield cooperates with the main body. The guiding poles slide in the corresponding guiding portions and are selectively positionable/slidable between one of two ends of the respective guiding portions to allow the shield to cover/uncover the at least one port.