The invention discloses a beta-tetrahydro-carboline 
antifungal compound and a pharmaceutically acceptable salt thereof. The structure of the compound is shown as the general formula I, wherein n is 1to 3; R1 is 
hydrogen or monosubstituted 
acetylene or polysubstituted 
acetylene in any optional position on the 
benzene ring, X is O or NH, R2 is substituted or unsubstituted aliphatic or aromatic ring; or X is NR3, R2 and R3 are individually lower 
alkyl and substituted or unsubstituted aliphatic or aromatic ring; or X is N, R2 and X composes substituted or unsubstituted heterocycloalkyl. The invention also discloses a preparation method of the compound and the application of the compound in preparation of 
antifungal drugs. The compound has the characteristic of well 
antifungal activity, the result of partial compound is better than that of the control 
drug fluconazole, and the compound can be utilized to prepare 
antifungal drugs. The experiment result also show that the combined usage of the partial compound and 
fluconazole has good synergistic effect to clinically isolated 
fluconazole-resistant 
candida albicans.