The present invention discloses a primary-side feedback switching power supply that uses a sample-and-hold circuit to obtain a corner voltage of a harmonic wave voltage while the primary-side auxiliary winding is operating at a discontinuous mode as a feedback control, and provides both voltage regulation and current limit functions. A stable voltage output is provided within the nominal input voltage and nominal output load, such that when the output reaches a current limit, the output voltage drops but the output current is controlled to remain unchanged, so as to provide an over-current protection.