In this paper, two imidazoline derivatives, N1-(2-aminoethyl)-N2-(2-((2-(2-heptyl-4,5-dihydro-1H-imidazol-1-yl)ethyl)amino)ethyl)ethane-1,2-diamine (HEIM) and N1-(2-aminoethyl)-N2-(2-((2-(2-(perfluoroheptyl)-4,5-dihydro-1H-imidazol-1-yl)ethyl)amino)ethyl)ethane-1,2-diamine (PFIM), have been used as corrosion inhibitors of carbon steels in 1 M HCl at elevated temperatures. Two inhibitors are confirmed by 1H NMR, 13C NMR, high-resolution mass spectra and FT-IR tools. Electrochemical and immersion tests indicate that the PFIM displays a stable protection performance at different temperatures, with an inhibition efficiency value around 95%. Moreover, scanning Electron Microscopy (SEM), energy dispersive X-ray (EDX) analysis, atomic force microscope (AFM) and X-ray photoelectron spectroscopy (XPS) indicates that the PFIM inhibitor film shows high hydrophobicity and stability at 363 K. Theoretical calculations suggest that the adsorption of PFIM is mainly through the bonding of the F of fluorocarbon chain on the Fe surface. This study helps us further explore the inhibition mechanisms of fluorocarbon chain-based imidazoline derivatives at high temperatures.