The invention discloses a method for controlling an air-conditioner. The method includes the steps that A, the operating mode of the air-conditioner is detected in real time; B, when the air-conditioner is in a
refrigeration mode or in a dehumidification mode, the indoor environment temperature and the first indoor environment humidification of the air-conditioner are collected, and the
operating time of the air-conditioner in the
refrigeration mode or in the dehumidification mode is counted; C, when the
operating time of the air-conditioner in the
refrigeration mode or in the dehumidification mode reaches first preset time, whether the judging conditions that the first indoor environment humidification is larger than first preset humidification and the indoor environment temperature belongs to a first preset temperature interval can be met at the same time or not is judged, if yes, the step D is executed, and if not, the step A is executed; D, the operating maximum frequency of a compressor of the air-conditioner is set to be a first frequency, and the current
operating frequency of the compressor of the air-conditioner is lowered according to the first frequency. The invention further discloses a
system for controlling the air-conditioner. By means of the method and
system for controlling the air-conditioner, the maximum
operating frequency of the compressor of the air-conditioner is lowered, and condensation is prevented.