The Density functional theory (DFT) and time-dependent DFT methods are used to study the detection mechanism of the fluorescent probe TB-N2H4 and its product TB-OH in ethanol (EtOH) solvent. For the TB-N2H4, EtOH can form dual intermolecular hydrogen bonds (IHBs) with TB-N2H4 at two locations (X and Y). The geometric structure and charge distribution show that the TB-N2H4 undergoes a twisted intramolecular charge transfer (TICT) process, resulting in the fluorescence quenching of TB-N2H4. In contrast, for the TB-OH, EtOH can only form IHBs with TB-OH at one site (X). The charge distribution show that intramolecular charges redistributed between the proton donor and proton acceptor groups, providing the driving force for the proton transfer process. The TICT is inhibited by excited-state dual proton transfer (ESDPT) process of TB-OH, resulting in the appearance of new fluorescence. Moreover, the results obtained from the potential energy curves manifest that the stepwise ESDPT process.