Use C # To compile your own RSS Service

Source: Internet
Author: User
There is always no good idea about RSS. I accidentally found a good article today. Article

Write your own. Net RSS feed in C #
Http://www.computorcompanion.com/LPMArticle.asp? Id = 194

Add the httphandler of *. RSS to Web. config and use the configuration file to configure each channel. I tried it and thought it was good and generic. The experiment encountered a small problem. IE7 always reported XML file format errors. CopySource codeSave and use IE7. When I was confused, I suddenly remembered whether it was a coding problem? Because of myProgramConfigure it to gb2312 in Web. config.

< Globalization requestencoding = " Gb2312 " Responseencoding = " Gb2312 "   />

Modified the class of the article and forced utf8 for output to solve the problem.

Context. response. contenttype =   " Text/XML " ;
Context. response. contentencoding = System. Text. encoding. utf8;
Context. response. Write ( " <? XML version = \ " 1.0 \ " ?> " );
Context. response. Write (cachedchan );

Related ArticlesCode.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.