Silica-carbon composite nanoparticles (NP-MCM-C) with uniform shapes and highly ordered mesoporous structures are directly prepared by using template polymers as the carbon source. And, taking advantage of the size exclusion effect of the mesopores to proteins and the specific interaction between carbon and oligosaccharides, the prepared nanoparticles are utilized to enrich N-linked glycans from complex biological samples with high selectivity and efficiency.