A computer enclosure includes a chassis (10), a resilient locking member (20), a cover (40), and a resilient member (30). The chassis comprises a bottom plate (12) and a side plate (16). The side plate defines a through opening (162) therein and has a flange (164) with slits (166) defined therein. The locking member is secured on the bottom plate and abuts on the side plate. A locking tab (244) with a slanted surface (246) extends from the locking member. The cover has a plurality of hooks (42) formed thereon. A blocking tab (442) is formed on the cover. The resilient member is secured between the side plate of the chassis and the cover, and resiliently deforms when the blocking tab of the cover is engaged with the locking tab of the locking member to block the cover sliding in a second direction parallel to the side plate.