cannot grab strings from html tags

Hi guys,

I am using managed c++/cli. I have a trouble with my code, I cannot be able to grab the html tags from my website using with httprequest.

Here's the html tags:

[PHP]
<a href="delete.php?test=test&id=1">Delete</a> </td>[/PHP]




Here's the current code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
try
        {
            Form1 ^form1 = dynamic_cast<Form1 ^>(Owner);
            //Address of URL
            String ^URL = "http://mysite.com/members.php?user=" + form2->label1->Text + "&pass=" + form2->label2->Text;
            HttpWebRequest ^request = safe_cast<HttpWebRequest^>(WebRequest::Create(URL));
            HttpWebResponse ^response = safe_cast<HttpWebResponse^>(request->GetResponse());
            StreamReader ^reader = gcnew StreamReader(response->GetResponseStream());
            String ^str = reader->ReadToEnd();
            String ^pattern1 = form1->ListView1->SelectedItems[0]->Text + "</p><p id=\"delete\"> <a href=\"delete.php\\?delete.php?test=test&id=(.*?)\">";
            Match ^m1 = Regex::Match(str, pattern1);
            MatchCollection ^matches1 = Regex::Matches(str, pattern1);

            for each (Match ^x1 in matches1)
            {
                MessageBox::Show("test 1");
                array<String^> ^StrArr1 = x1->Value->ToString()->Split();
                String ^test = (URL + x1->Value->ToString()->Replace(form1->ListView1->SelectedItems[0]->Text, "")->Replace("</p><p id=\"delete\"> <a href=\"", "")->Replace("\"" + ">", ""));
                MessageBox::Show(test);
            }
         }
        catch (Exception ^ex)
         {
        }




Do you know why and what's wrong? :(

Any advice would be much appreciated.

Thanks,
Mark
Last edited on
Please can someone help???????????
You'd do better asking in a CLI forum. We're mostly C++ around here.
Topic archived. No new replies allowed.