2-甲基 Alkyl halides undergo nucleophilic substitution with heterocylic compounds such as 2-methylquinoline and 4-methylquinoline, and form the stabile quaternary ammonium salt. Because of strong withdrawal electrons effects at the nitrogen atom on quaternary ammonium salt, the methyl group out of aromatic ring becomes an active nucleophile, witch can react with aromatic aldehydes to form cyanine compounds. The blue dye “cyanine”was first prepared by Greville Williams in 1856, in which two heterocyclic nuclei containing nitrogen are linked through an odd numbered methane chain in such a way that resonance occurs through the conjugated system between tertiary and quaternary nitrogen atoms, that make the red shift of ultraviolet-visible spectra of the cyanine compounds. The study takes 2-methylpyridine to be the reactant and synthesizes cyanine compounds with aromatic aldehydes. By changing the number of methane chain, we hope to synthesize the compounds which have the maximum absorbance of ultraviolet-visible spectra more than 600nm, and study on the property of ultraviolet-visible and infrared spectra.