A relationship between complex network parameters and wireless sensor networks(WSN) capacity is obtained through theoretical derivation.Under the guidance of the relationship,a topology control is employed in removing some superfluous links and adding some shortcut,to increase the network capacity.According to the small-world effect which the WSN possesses after the topology control,a local area control of virus spreading is proposed in the light of the virus spreading intensity of nodes.The research suggests that by topology control,the WSN network capacity is effectively improved; by immunizing a small amount of essential nodes,the immune cost is saved,and the ability of anti-virus attack is enhanced.