Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
- try
- {
- WebRequest^ Request = WebRequest::Create("http://bash.org.ru/rss/");
- WebResponse^ Response = Request->GetResponse();
- Stream^ S = Response->GetResponseStream();
- StreamReader^ sr = gcnew StreamReader(S, Encoding::GetEncoding(1251));
- for each(String^ s in sr->ReadToEnd()->Split(gcnew array<String^>(2) {"<item>", "</item>"}, StringSplitOptions::None))
- {
- if(s->Contains("http://bash.org.ru/quote/"))
- {
- String^ str = nullptr;
- str = s->Split(gcnew array<String^>(2){"<title>", "</title>"}, StringSplitOptions::None)[1] + "\n\n" + s->Split(gcnew array<String^>(2){ "<![CDATA[", "]]>" }, StringSplitOptions::None)[1]->Replace("<br>", "\n")->Replace(""", "") + "\n============\n";
- richTextBox1->Text += str;
- }
- }
- }
- catch(...)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment