The invention discloses a windshield lock for automobile violations, which comprises a lock body, two protrusions facing each other on one side of the lock body, shaft holes are respectively arranged in the protrusions, and the lock body is located in the middle of the side opposite to the protrusions. There is a handle, and the other side of the lock body is equipped with a solar panel, a control card, a two-digit code, a battery and two through holes, and an air suction nozzle and an air discharge nozzle are installed in the through holes, and the lock body is connected with the solar energy. There are bosses around the opposite side of the battery board, and a sealing ring is installed on the bosses. The bosses and the sealing rings form a "mouth"-shaped square cavity. Two parallel rotating shafts are arranged on the connecting body, and a lock body is connected to the rotating shafts respectively. , the lock body can rotate around the shaft connected to it. When the two lock bodies on the connecting body are unfolded to an angle of about 180°, the two sealing rings on the lock body are attached to a plane at the same time and folded to the angle. When it is about 0°, the two sealing rings on the lock body fit closely. The invention creates a new way of locking illegal vehicles, which is simple and convenient to operate and suitable for popularization.