Over the past 50 years, rainfall events have made significant alterations to environments due to global warming. The grasslands in arid and semi-arid regions are extremely sensitive to variations in rainfall patterns, which are considered to significantly affect ecosystem functions. In this study, an experiment with varying rainfall sizes and frequencies (0 mm, 2 mm, 5 mm, 10 mm, 20 mm, and 40 mm) was conducted during growing seasons in typical grasslands, to study the effect of changes in rainfall regime on net ecosystem exchange (NEE). Our results indicated that NEE exhibited nonlinear responses to rainfall treatments, and reached its peak under 20 mm in middle growing season. Further, the component fluxes of both NEE (i.e., gross primary productivity (GPP)) and ecosystem respiration (ER) illustrated nonlinear responses to treatment gradient, with peak values at 20 mm and 5 mm, respectively. Based on five-year eddy flux measurements, further analyses demonstrated that GPP and ER increased with increasing soil moisture, and net ecosystem carbon uptake (-1*NEE) was significantly stimulated due to a more enhanced GPP than ER, when soil moisture was above 8%. Additionally, we found that the response of root biomass was different from that of carbon fluxes to changes in rainfall patterns. Overall, these findings highlight the importance of both changes in rainfall regimes in controlling ecosystem C exchange and investigation of the potential threshold for ecosystem function shifts, which are crucial to further understand C cycles in grasslands.