In this paper, we study of n-SiCN/p-PS/p-silicon heterojunction with porous silicon (PS) buffer layer for low-cost and high-temperature ultraviolet (UV) detecting applications in details. The electrochemical anodization and rapid thermal chemical vapor deposition were applied sequentially to form the PS layer and the cubic crystalline n-SiCN film on the top of p-(100) silicon substrate. The PS layer has a high resistivity to suppress the dark current, and provides sponge-like structure to limit strain and cracks development after the post growth cooling. Thus, favors nucleation to result in a better single-crystal SiCN film. Consequently, the developed optical sensing device has a high photo/dark current ratio of 85.4 under room temperature (25degC), with and without irradiation of and 254 nm UV light with 0.5 mW/cm2 optical power. At 200degC the ratio is still equal to 7.42, which are better than the reported ZnO on GaAs substrate or beta-SiC on Si substrate UV detectors without porous treatment.