Herein, we report a facile one-step solvothermal synthesis of nitrogen and sulfur co-doped fluorescent carbon dots (N,S-CDs) using benzoic acid as the carbon source and sulfonamide as the doping agent. The synthesized N,S-CDs exhibit stable photoluminescence with an impressive fluorescence quantum yield of 16.8 %. These N,S-CDs maintain their luminescent properties under various challenging conditions, including high salt concentrations, elevated temperatures, UV radiation exposure, acidic or alkaline environments, long-term storage, and different solvents. Notably, the photoluminescence of N,S-CDs is excitation-wavelength dependent, with emission wavelengths tunable from 470 nm to 585 nm. Furthermore, the N,S-CDs display distinct fluorescent hues in aqueous and ethanolic media, presenting a novel dual-switch anti-counterfeiting ink system. Leveraging the sensitivity of N,S-CDs to gentamicin, we have developed a facile and rapid detection method for this antibiotic, which has been successfully applied to the analysis of authentic milk samples. This research contributes a novel and efficient protocol for the fabrication of high-performance carbon dots, thereby expanding their potential applications in food analysis and anti-counterfeiting technologies.