The relationship between the infectivity of virus infecting cells and its mechanical properties has been becoming a hot issue of biology. Atomic force microscopy (AFM) provides an effective tool for studying the interaction of viruses infecting cells under physiological conditions. In order to explore the process of virus infecting cells and reveal the action principle of antiviral drugs, this paper analyzes the changing trend of mechanical properties of cells under normal conditions and after being infected by viruses, which is always soft → hard → soft for adhesion and Young's modulus; Next the influence of virus quantity on the process of infecting cells is studied, the result represents that increasing the viruses will speed up the change of mechanical properties and accelerate cell apoptosis. Then, through the comparison of the two experimental results, the process of the antiviral drug ribavirin in inhibiting the virus infecting cells is studied, which revealed that ribavirin could inhibit the virus infecting cells by modifying the surface structure of the virus. This conclusion is illustrated by measuring the hardness changing before and after the adenovirus is modified by ribavirin.