HTML parsing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sunny

    #1

    HTML parsing

    Hi all,
    I have to get a HTML content of a given URL, to inspect links and images and
    to change something in there, and to save the result. I have done it already
    with:
    System.Net.WebC lient source = new System.Net.WebC lient();

    StreamReader mr = null;

    try

    {

    mr = new StreamReader(so urce.OpenRead(s Url));

    sWebPage = mr.ReadToEnd();

    }

    catch

    {

    oParent.PagesDo ne++;

    return;

    }

    finally

    {

    if (mr != null)

    mr.Close();

    }

    After that I make a lot of IndexOfs' and Replaces to change the things I
    want, and as it is sooooo ugly :( and slow.

    So I decided to see if I can use MSHTML's IHTMLDocument2 interface, and just
    to find and change values I need, but ... so far I couldn't imagine how to
    place the string in the IHTMLDocument2 object and how to retrieve it from
    there after that in order to save it.

    Any clues will be highly appreciated.

    Thanks

    Sunny

  • Daniel O'Connell

    #2
    Re: HTML parsing

    Well, I'm no mshtml expert, but you might be able to get away with just
    using IHTMLDocument4. createDocumentF romUrl to load the document directly
    from the url into an IHTMLDocument class (any given html document class
    should support IHTMLDocument through IHTMLDocument5) I'm not sure if it'll
    work, but you can try.

    If there is a mshtml specific newsgroup, you should be able to ask there as
    the managed mshtml is just a PIA wrapper around the com objects. I'm sure
    the talent pool in relation to mshtml would be far greater there.
    "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
    news:utw8QBIdDH A.2368@TK2MSFTN GP09.phx.gbl...[color=blue]
    > Hi all,
    > I have to get a HTML content of a given URL, to inspect links and images[/color]
    and[color=blue]
    > to change something in there, and to save the result. I have done it[/color]
    already[color=blue]
    > with:
    > System.Net.WebC lient source = new System.Net.WebC lient();
    >
    > StreamReader mr = null;
    >
    > try
    >
    > {
    >
    > mr = new StreamReader(so urce.OpenRead(s Url));
    >
    > sWebPage = mr.ReadToEnd();
    >
    > }
    >
    > catch
    >
    > {
    >
    > oParent.PagesDo ne++;
    >
    > return;
    >
    > }
    >
    > finally
    >
    > {
    >
    > if (mr != null)
    >
    > mr.Close();
    >
    > }
    >
    > After that I make a lot of IndexOfs' and Replaces to change the things I
    > want, and as it is sooooo ugly :( and slow.
    >
    > So I decided to see if I can use MSHTML's IHTMLDocument2 interface, and[/color]
    just[color=blue]
    > to find and change values I need, but ... so far I couldn't imagine how to
    > place the string in the IHTMLDocument2 object and how to retrieve it from
    > there after that in order to save it.
    >
    > Any clues will be highly appreciated.
    >
    > Thanks
    >
    > Sunny
    >[/color]


    Comment

    • Sunny

      #3
      Re: HTML parsing

      Thanks Daniel,
      but I'm a little bit confused, because all examples so far I have found are
      using IHTMLDocument2 interface, so I'm worried about compatibility, i.e. on
      what systems is available 5, and on what 2 ?
      Also, you are talking about PIA, are there official PIAs, maybe I'm not
      searching right, but I can not find any. I just made a reference to the
      mshtml.dll, and VS .net had made some interop assembly, but because MS are
      providing official PIAs for some products (I know for sure there are for
      Office XP), I wondered are there any for mshtml.
      I'll try to search again, and also to post this question in other groups
      also, but one little :) push will be very helpful :)

      Thanks again
      Sunny

      P.S. If there is any other way to solve may problem - I'm open to any
      suggestion :)

      "Daniel O'Connell" <onyxkirx@comca st.net> wrote in message
      news:Ngt6b.1819 48$2x.50943@rwc rnsc52.ops.asp. att.net...[color=blue]
      > Well, I'm no mshtml expert, but you might be able to get away with just
      > using IHTMLDocument4. createDocumentF romUrl to load the document directly
      > from the url into an IHTMLDocument class (any given html document class
      > should support IHTMLDocument through IHTMLDocument5) I'm not sure if it'll
      > work, but you can try.
      >
      > If there is a mshtml specific newsgroup, you should be able to ask there[/color]
      as[color=blue]
      > the managed mshtml is just a PIA wrapper around the com objects. I'm sure
      > the talent pool in relation to mshtml would be far greater there.
      > "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
      > news:utw8QBIdDH A.2368@TK2MSFTN GP09.phx.gbl...[color=green]
      > > Hi all,
      > > I have to get a HTML content of a given URL, to inspect links and images[/color]
      > and[color=green]
      > > to change something in there, and to save the result. I have done it[/color]
      > already[color=green]
      > > with:
      > > System.Net.WebC lient source = new System.Net.WebC lient();
      > >
      > > StreamReader mr = null;
      > >
      > > try
      > >
      > > {
      > >
      > > mr = new StreamReader(so urce.OpenRead(s Url));
      > >
      > > sWebPage = mr.ReadToEnd();
      > >
      > > }
      > >
      > > catch
      > >
      > > {
      > >
      > > oParent.PagesDo ne++;
      > >
      > > return;
      > >
      > > }
      > >
      > > finally
      > >
      > > {
      > >
      > > if (mr != null)
      > >
      > > mr.Close();
      > >
      > > }
      > >
      > > After that I make a lot of IndexOfs' and Replaces to change the things I
      > > want, and as it is sooooo ugly :( and slow.
      > >
      > > So I decided to see if I can use MSHTML's IHTMLDocument2 interface, and[/color]
      > just[color=green]
      > > to find and change values I need, but ... so far I couldn't imagine how[/color][/color]
      to[color=blue][color=green]
      > > place the string in the IHTMLDocument2 object and how to retrieve it[/color][/color]
      from[color=blue][color=green]
      > > there after that in order to save it.
      > >
      > > Any clues will be highly appreciated.
      > >
      > > Thanks
      > >
      > > Sunny
      > >[/color]
      >
      >[/color]

      Comment

      • Daniel O'Connell

        #4
        Re: HTML parsing

        Well, I can't remember if there is a mshtml interop dll for vs.net 2002, but
        I am very sure it is there for vs.net 2003. In your add reference dialog,
        scroll down and look for Microsoft.mshtm l.dll, it should be there.
        Likewise for borland C# builder, there is a Borland.mshtml. dll included in
        the install folder (just incase you or anyone who reads this is curious).

        Anyway, as for the IHTMLDocument interfaces, use of:
        IHTMLDocument and IHTMLDocument2 requires IE 4.
        IHTMLDocument3 requires IE 5.
        IHTMLDocument4 requires IE 5.5.
        IHTMLDocument5 requires IE 6.
        I consider it a pretty safe bet that IE 5.5+ is installed, and 6 has been
        out a while and windows update pushes it.

        IHTMLDocument2 provides most of the functionality you need, hence it gets
        most of the exposure in examples. Due to COM issues, each individual
        interface is seperate. As such, you will need both a IHTMLDocument2 & a
        IHTMLDocument4 typed reference to your document object. It is a pain but it
        is part of the price of COM interop.
        So, something like

        IHTMLDocument2 myDocument = <get your document>;
        IHTMLDocument4 myDocument4 = (IHTMLDocument4 )myDocument;

        should do the job of giving you both typed references.

        "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
        news:eed5k6MdDH A.2816@TK2MSFTN GP09.phx.gbl...[color=blue]
        > Thanks Daniel,
        > but I'm a little bit confused, because all examples so far I have found[/color]
        are[color=blue]
        > using IHTMLDocument2 interface, so I'm worried about compatibility, i.e.[/color]
        on[color=blue]
        > what systems is available 5, and on what 2 ?
        > Also, you are talking about PIA, are there official PIAs, maybe I'm not
        > searching right, but I can not find any. I just made a reference to the
        > mshtml.dll, and VS .net had made some interop assembly, but because MS are
        > providing official PIAs for some products (I know for sure there are for
        > Office XP), I wondered are there any for mshtml.
        > I'll try to search again, and also to post this question in other groups
        > also, but one little :) push will be very helpful :)
        >
        > Thanks again
        > Sunny
        >
        > P.S. If there is any other way to solve may problem - I'm open to any
        > suggestion :)
        >
        > "Daniel O'Connell" <onyxkirx@comca st.net> wrote in message
        > news:Ngt6b.1819 48$2x.50943@rwc rnsc52.ops.asp. att.net...[color=green]
        > > Well, I'm no mshtml expert, but you might be able to get away with just
        > > using IHTMLDocument4. createDocumentF romUrl to load the document directly
        > > from the url into an IHTMLDocument class (any given html document class
        > > should support IHTMLDocument through IHTMLDocument5) I'm not sure if[/color][/color]
        it'll[color=blue][color=green]
        > > work, but you can try.
        > >
        > > If there is a mshtml specific newsgroup, you should be able to ask there[/color]
        > as[color=green]
        > > the managed mshtml is just a PIA wrapper around the com objects. I'm[/color][/color]
        sure[color=blue][color=green]
        > > the talent pool in relation to mshtml would be far greater there.
        > > "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
        > > news:utw8QBIdDH A.2368@TK2MSFTN GP09.phx.gbl...[color=darkred]
        > > > Hi all,
        > > > I have to get a HTML content of a given URL, to inspect links and[/color][/color][/color]
        images[color=blue][color=green]
        > > and[color=darkred]
        > > > to change something in there, and to save the result. I have done it[/color]
        > > already[color=darkred]
        > > > with:
        > > > System.Net.WebC lient source = new System.Net.WebC lient();
        > > >
        > > > StreamReader mr = null;
        > > >
        > > > try
        > > >
        > > > {
        > > >
        > > > mr = new StreamReader(so urce.OpenRead(s Url));
        > > >
        > > > sWebPage = mr.ReadToEnd();
        > > >
        > > > }
        > > >
        > > > catch
        > > >
        > > > {
        > > >
        > > > oParent.PagesDo ne++;
        > > >
        > > > return;
        > > >
        > > > }
        > > >
        > > > finally
        > > >
        > > > {
        > > >
        > > > if (mr != null)
        > > >
        > > > mr.Close();
        > > >
        > > > }
        > > >
        > > > After that I make a lot of IndexOfs' and Replaces to change the things[/color][/color][/color]
        I[color=blue][color=green][color=darkred]
        > > > want, and as it is sooooo ugly :( and slow.
        > > >
        > > > So I decided to see if I can use MSHTML's IHTMLDocument2 interface,[/color][/color][/color]
        and[color=blue][color=green]
        > > just[color=darkred]
        > > > to find and change values I need, but ... so far I couldn't imagine[/color][/color][/color]
        how[color=blue]
        > to[color=green][color=darkred]
        > > > place the string in the IHTMLDocument2 object and how to retrieve it[/color][/color]
        > from[color=green][color=darkred]
        > > > there after that in order to save it.
        > > >
        > > > Any clues will be highly appreciated.
        > > >
        > > > Thanks
        > > >
        > > > Sunny
        > > >[/color]
        > >
        > >[/color]
        >[/color]


        Comment

        • Sunny

          #5
          Re: HTML parsing

          Hi Daniel,
          I have solved the problem. I'll post the solution in case someone needs it
          (it was little bit hard for me to find it).

          So, I am reading the URL with the code already posted in the beginning.
          Now in sWebPage I have the text content of the page. This text is placed in
          a HTMLDocumentCla ss object as follows:

          HTMLDocumentCla ss myDoc;

          try

          {

          object[] oPageText = {sWebPage};

          myDoc = new HTMLDocumentCla ss();

          IHTMLDocument2 oMyDoc = (IHTMLDocument2 )myDoc;

          oMyDoc.write(oP ageText);

          }

          catch

          {

          //handle

          }

          And now you may do to the document whatever you want. And after all the HTML
          text is in myDoc.documenyE lement.outerHTM L.

          This link was very useful in solving that problem (Thanks Alex):



          Sunny


          "Daniel O'Connell" <onyxkirx@comca st.net> wrote in message
          news:kou6b.2814 92$It4.131364@r wcrnsc51.ops.as p.att.net...[color=blue]
          > Well, I can't remember if there is a mshtml interop dll for vs.net 2002,[/color]
          but[color=blue]
          > I am very sure it is there for vs.net 2003. In your add reference dialog,
          > scroll down and look for Microsoft.mshtm l.dll, it should be there.
          > Likewise for borland C# builder, there is a Borland.mshtml. dll included in
          > the install folder (just incase you or anyone who reads this is curious).
          >
          > Anyway, as for the IHTMLDocument interfaces, use of:
          > IHTMLDocument and IHTMLDocument2 requires IE 4.
          > IHTMLDocument3 requires IE 5.
          > IHTMLDocument4 requires IE 5.5.
          > IHTMLDocument5 requires IE 6.
          > I consider it a pretty safe bet that IE 5.5+ is installed, and 6 has been
          > out a while and windows update pushes it.
          >
          > IHTMLDocument2 provides most of the functionality you need, hence it gets
          > most of the exposure in examples. Due to COM issues, each individual
          > interface is seperate. As such, you will need both a IHTMLDocument2 & a
          > IHTMLDocument4 typed reference to your document object. It is a pain but[/color]
          it[color=blue]
          > is part of the price of COM interop.
          > So, something like
          >
          > IHTMLDocument2 myDocument = <get your document>;
          > IHTMLDocument4 myDocument4 = (IHTMLDocument4 )myDocument;
          >
          > should do the job of giving you both typed references.
          >
          > "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
          > news:eed5k6MdDH A.2816@TK2MSFTN GP09.phx.gbl...[color=green]
          > > Thanks Daniel,
          > > but I'm a little bit confused, because all examples so far I have found[/color]
          > are[color=green]
          > > using IHTMLDocument2 interface, so I'm worried about compatibility, i.e.[/color]
          > on[color=green]
          > > what systems is available 5, and on what 2 ?
          > > Also, you are talking about PIA, are there official PIAs, maybe I'm not
          > > searching right, but I can not find any. I just made a reference to the
          > > mshtml.dll, and VS .net had made some interop assembly, but because MS[/color][/color]
          are[color=blue][color=green]
          > > providing official PIAs for some products (I know for sure there are for
          > > Office XP), I wondered are there any for mshtml.
          > > I'll try to search again, and also to post this question in other groups
          > > also, but one little :) push will be very helpful :)
          > >
          > > Thanks again
          > > Sunny
          > >
          > > P.S. If there is any other way to solve may problem - I'm open to any
          > > suggestion :)
          > >
          > > "Daniel O'Connell" <onyxkirx@comca st.net> wrote in message
          > > news:Ngt6b.1819 48$2x.50943@rwc rnsc52.ops.asp. att.net...[color=darkred]
          > > > Well, I'm no mshtml expert, but you might be able to get away with[/color][/color][/color]
          just[color=blue][color=green][color=darkred]
          > > > using IHTMLDocument4. createDocumentF romUrl to load the document[/color][/color][/color]
          directly[color=blue][color=green][color=darkred]
          > > > from the url into an IHTMLDocument class (any given html document[/color][/color][/color]
          class[color=blue][color=green][color=darkred]
          > > > should support IHTMLDocument through IHTMLDocument5) I'm not sure if[/color][/color]
          > it'll[color=green][color=darkred]
          > > > work, but you can try.
          > > >
          > > > If there is a mshtml specific newsgroup, you should be able to ask[/color][/color][/color]
          there[color=blue][color=green]
          > > as[color=darkred]
          > > > the managed mshtml is just a PIA wrapper around the com objects. I'm[/color][/color]
          > sure[color=green][color=darkred]
          > > > the talent pool in relation to mshtml would be far greater there.
          > > > "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
          > > > news:utw8QBIdDH A.2368@TK2MSFTN GP09.phx.gbl...
          > > > > Hi all,
          > > > > I have to get a HTML content of a given URL, to inspect links and[/color][/color]
          > images[color=green][color=darkred]
          > > > and
          > > > > to change something in there, and to save the result. I have done it
          > > > already
          > > > > with:
          > > > > System.Net.WebC lient source = new System.Net.WebC lient();
          > > > >
          > > > > StreamReader mr = null;
          > > > >
          > > > > try
          > > > >
          > > > > {
          > > > >
          > > > > mr = new StreamReader(so urce.OpenRead(s Url));
          > > > >
          > > > > sWebPage = mr.ReadToEnd();
          > > > >
          > > > > }
          > > > >
          > > > > catch
          > > > >
          > > > > {
          > > > >
          > > > > oParent.PagesDo ne++;
          > > > >
          > > > > return;
          > > > >
          > > > > }
          > > > >
          > > > > finally
          > > > >
          > > > > {
          > > > >
          > > > > if (mr != null)
          > > > >
          > > > > mr.Close();
          > > > >
          > > > > }
          > > > >
          > > > > After that I make a lot of IndexOfs' and Replaces to change the[/color][/color][/color]
          things[color=blue]
          > I[color=green][color=darkred]
          > > > > want, and as it is sooooo ugly :( and slow.
          > > > >
          > > > > So I decided to see if I can use MSHTML's IHTMLDocument2 interface,[/color][/color]
          > and[color=green][color=darkred]
          > > > just
          > > > > to find and change values I need, but ... so far I couldn't imagine[/color][/color]
          > how[color=green]
          > > to[color=darkred]
          > > > > place the string in the IHTMLDocument2 object and how to retrieve it[/color]
          > > from[color=darkred]
          > > > > there after that in order to save it.
          > > > >
          > > > > Any clues will be highly appreciated.
          > > > >
          > > > > Thanks
          > > > >
          > > > > Sunny
          > > > >
          > > >
          > > >[/color]
          > >[/color]
          >
          >[/color]

          Comment

          • Daniel O'Connell

            #6
            Re: HTML parsing

            Ahh, much cleaner solution in your particular case. Hopefully the next time
            someone asks this question (and someone will), I may actually remember the
            solution you found.
            "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
            news:uhK7eDQdDH A.656@tk2msftng p13.phx.gbl...[color=blue]
            > Hi Daniel,
            > I have solved the problem. I'll post the solution in case someone needs it
            > (it was little bit hard for me to find it).
            >
            > So, I am reading the URL with the code already posted in the beginning.
            > Now in sWebPage I have the text content of the page. This text is placed[/color]
            in[color=blue]
            > a HTMLDocumentCla ss object as follows:
            >
            > HTMLDocumentCla ss myDoc;
            >
            > try
            >
            > {
            >
            > object[] oPageText = {sWebPage};
            >
            > myDoc = new HTMLDocumentCla ss();
            >
            > IHTMLDocument2 oMyDoc = (IHTMLDocument2 )myDoc;
            >
            > oMyDoc.write(oP ageText);
            >
            > }
            >
            > catch
            >
            > {
            >
            > //handle
            >
            > }
            >
            > And now you may do to the document whatever you want. And after all the[/color]
            HTML[color=blue]
            > text is in myDoc.documenyE lement.outerHTM L.
            >
            > This link was very useful in solving that problem (Thanks Alex):
            >
            > http://www.csharphelp.com/archives/archive146.html
            >
            > Sunny
            >
            >
            > "Daniel O'Connell" <onyxkirx@comca st.net> wrote in message
            > news:kou6b.2814 92$It4.131364@r wcrnsc51.ops.as p.att.net...[color=green]
            > > Well, I can't remember if there is a mshtml interop dll for vs.net 2002,[/color]
            > but[color=green]
            > > I am very sure it is there for vs.net 2003. In your add reference[/color][/color]
            dialog,[color=blue][color=green]
            > > scroll down and look for Microsoft.mshtm l.dll, it should be there.
            > > Likewise for borland C# builder, there is a Borland.mshtml. dll included[/color][/color]
            in[color=blue][color=green]
            > > the install folder (just incase you or anyone who reads this is[/color][/color]
            curious).[color=blue][color=green]
            > >
            > > Anyway, as for the IHTMLDocument interfaces, use of:
            > > IHTMLDocument and IHTMLDocument2 requires IE 4.
            > > IHTMLDocument3 requires IE 5.
            > > IHTMLDocument4 requires IE 5.5.
            > > IHTMLDocument5 requires IE 6.
            > > I consider it a pretty safe bet that IE 5.5+ is installed, and 6 has[/color][/color]
            been[color=blue][color=green]
            > > out a while and windows update pushes it.
            > >
            > > IHTMLDocument2 provides most of the functionality you need, hence it[/color][/color]
            gets[color=blue][color=green]
            > > most of the exposure in examples. Due to COM issues, each individual
            > > interface is seperate. As such, you will need both a IHTMLDocument2 & a
            > > IHTMLDocument4 typed reference to your document object. It is a pain but[/color]
            > it[color=green]
            > > is part of the price of COM interop.
            > > So, something like
            > >
            > > IHTMLDocument2 myDocument = <get your document>;
            > > IHTMLDocument4 myDocument4 = (IHTMLDocument4 )myDocument;
            > >
            > > should do the job of giving you both typed references.
            > >
            > > "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
            > > news:eed5k6MdDH A.2816@TK2MSFTN GP09.phx.gbl...[color=darkred]
            > > > Thanks Daniel,
            > > > but I'm a little bit confused, because all examples so far I have[/color][/color][/color]
            found[color=blue][color=green]
            > > are[color=darkred]
            > > > using IHTMLDocument2 interface, so I'm worried about compatibility,[/color][/color][/color]
            i.e.[color=blue][color=green]
            > > on[color=darkred]
            > > > what systems is available 5, and on what 2 ?
            > > > Also, you are talking about PIA, are there official PIAs, maybe I'm[/color][/color][/color]
            not[color=blue][color=green][color=darkred]
            > > > searching right, but I can not find any. I just made a reference to[/color][/color][/color]
            the[color=blue][color=green][color=darkred]
            > > > mshtml.dll, and VS .net had made some interop assembly, but because MS[/color][/color]
            > are[color=green][color=darkred]
            > > > providing official PIAs for some products (I know for sure there are[/color][/color][/color]
            for[color=blue][color=green][color=darkred]
            > > > Office XP), I wondered are there any for mshtml.
            > > > I'll try to search again, and also to post this question in other[/color][/color][/color]
            groups[color=blue][color=green][color=darkred]
            > > > also, but one little :) push will be very helpful :)
            > > >
            > > > Thanks again
            > > > Sunny
            > > >
            > > > P.S. If there is any other way to solve may problem - I'm open to any
            > > > suggestion :)
            > > >
            > > > "Daniel O'Connell" <onyxkirx@comca st.net> wrote in message
            > > > news:Ngt6b.1819 48$2x.50943@rwc rnsc52.ops.asp. att.net...
            > > > > Well, I'm no mshtml expert, but you might be able to get away with[/color][/color]
            > just[color=green][color=darkred]
            > > > > using IHTMLDocument4. createDocumentF romUrl to load the document[/color][/color]
            > directly[color=green][color=darkred]
            > > > > from the url into an IHTMLDocument class (any given html document[/color][/color]
            > class[color=green][color=darkred]
            > > > > should support IHTMLDocument through IHTMLDocument5) I'm not sure if[/color]
            > > it'll[color=darkred]
            > > > > work, but you can try.
            > > > >
            > > > > If there is a mshtml specific newsgroup, you should be able to ask[/color][/color]
            > there[color=green][color=darkred]
            > > > as
            > > > > the managed mshtml is just a PIA wrapper around the com objects. I'm[/color]
            > > sure[color=darkred]
            > > > > the talent pool in relation to mshtml would be far greater there.
            > > > > "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
            > > > > news:utw8QBIdDH A.2368@TK2MSFTN GP09.phx.gbl...
            > > > > > Hi all,
            > > > > > I have to get a HTML content of a given URL, to inspect links and[/color]
            > > images[color=darkred]
            > > > > and
            > > > > > to change something in there, and to save the result. I have done[/color][/color][/color]
            it[color=blue][color=green][color=darkred]
            > > > > already
            > > > > > with:
            > > > > > System.Net.WebC lient source = new System.Net.WebC lient();
            > > > > >
            > > > > > StreamReader mr = null;
            > > > > >
            > > > > > try
            > > > > >
            > > > > > {
            > > > > >
            > > > > > mr = new StreamReader(so urce.OpenRead(s Url));
            > > > > >
            > > > > > sWebPage = mr.ReadToEnd();
            > > > > >
            > > > > > }
            > > > > >
            > > > > > catch
            > > > > >
            > > > > > {
            > > > > >
            > > > > > oParent.PagesDo ne++;
            > > > > >
            > > > > > return;
            > > > > >
            > > > > > }
            > > > > >
            > > > > > finally
            > > > > >
            > > > > > {
            > > > > >
            > > > > > if (mr != null)
            > > > > >
            > > > > > mr.Close();
            > > > > >
            > > > > > }
            > > > > >
            > > > > > After that I make a lot of IndexOfs' and Replaces to change the[/color][/color]
            > things[color=green]
            > > I[color=darkred]
            > > > > > want, and as it is sooooo ugly :( and slow.
            > > > > >
            > > > > > So I decided to see if I can use MSHTML's IHTMLDocument2[/color][/color][/color]
            interface,[color=blue][color=green]
            > > and[color=darkred]
            > > > > just
            > > > > > to find and change values I need, but ... so far I couldn't[/color][/color][/color]
            imagine[color=blue][color=green]
            > > how[color=darkred]
            > > > to
            > > > > > place the string in the IHTMLDocument2 object and how to retrieve[/color][/color][/color]
            it[color=blue][color=green][color=darkred]
            > > > from
            > > > > > there after that in order to save it.
            > > > > >
            > > > > > Any clues will be highly appreciated.
            > > > > >
            > > > > > Thanks
            > > > > >
            > > > > > Sunny
            > > > > >
            > > > >
            > > > >
            > > >[/color]
            > >
            > >[/color]
            >[/color]


            Comment

            Working...