 In 1877, he became magistrate for Gaochun County (now Gaochun District, Nanjing, Jiangsu Province).In 1882, he became magistrate for Tongshan County (now Tongshan District, Xuzhou, Jiangsu Province).He served as magistrate of Nanhui County (now Nanhui District) from 1886 and of Shanghai County (now Minhang District) in 1891 and 1892.