Viruses use methods such as file infection, email attachment, and infected Webpages to infect other programs or documents. Once a virus has executed on a target machine, it can start exchanging information with other malicious code in the same network or the Internet. This allows viruses to quickly spread and infect new targets.