Extract web page via code fromatting

Discussion in 'ASP .Net' started by Lit, Jun 21, 2007.

  1. Lit

    Lit Guest

    Hello,

    I get a web page, from java web server, via C# code but when I try to write
    the response I get from the web page to a text file it has lost of junk in
    it.
    \r\n\t\n\r\ etc...
    what Encoding should I use to get the HTML as seen from View Source???

    good day.
    Lit, Jun 21, 2007
    #1
    1. Advertising

  2. On Jun 21, 2:14 am, "Lit" <> wrote:
    > Hello,
    >
    > I get a web page, from java web server, via C# code but when I try to write
    > the response I get from the web page to a text file it has lost of junk in
    > it.
    > \r\n\t\n\r\ etc...
    > what Encoding should I use to get the HTML as seen from View Source???
    >
    > good day.


    \r\n is an escape sequence for a new line
    \t for a tab

    It means you have these characters in the original text.

    Where do you print it? If you view the string in the IDE it may appear
    like this. Output to a file would give you a new line and a tab
    instead the escape characters

    You can also use Replace(Replace("\r\n","") or a regular expression to
    remove the escape characters
    Alexey Smirnov, Jun 21, 2007
    #2
    1. Advertising

  3. Lit

    Lit Guest

    Hello,

    I am using the replace and it works good.
    I don't print at all
    when I save to PDF I am getting the \r\n\t etc..
    I was wondering if I can use some Encoding trick that will take care of it
    instead of using replace this with that.
    Also depending on a .NET class then in the future that will take care of
    this automatically instead off having to modify my replace statements.

    thanks


    "Alexey Smirnov" <> wrote in message
    news:...
    > On Jun 21, 2:14 am, "Lit" <> wrote:
    >> Hello,
    >>
    >> I get a web page, from java web server, via C# code but when I try to
    >> write
    >> the response I get from the web page to a text file it has lost of junk
    >> in
    >> it.
    >> \r\n\t\n\r\ etc...
    >> what Encoding should I use to get the HTML as seen from View Source???
    >>
    >> good day.

    >
    > \r\n is an escape sequence for a new line
    > \t for a tab
    >
    > It means you have these characters in the original text.
    >
    > Where do you print it? If you view the string in the IDE it may appear
    > like this. Output to a file would give you a new line and a tab
    > instead the escape characters
    >
    > You can also use Replace(Replace("\r\n","") or a regular expression to
    > remove the escape characters
    >
    Lit, Jun 21, 2007
    #3
  4. On Jun 22, 12:26 am, "Lit" <> wrote:
    > when I save to PDF I am getting the \r\n\t etc..


    Then it depends on the function that saved PDF
    Alexey Smirnov, Jun 22, 2007
    #4
  5. Lit

    Lit Guest

    Nop, The PDF function needs the same thing you see when you view source.
    I think some Encoding is needed here.

    "Alexey Smirnov" <> wrote in message
    news:...
    > On Jun 22, 12:26 am, "Lit" <> wrote:
    >> when I save to PDF I am getting the \r\n\t etc..

    >
    > Then it depends on the function that saved PDF
    >
    Lit, Jun 22, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Say

    DataList Fromatting Cell

    Paul Say, Jun 24, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    375
    Eliyahu Goldin
    Jun 26, 2005
  2. gt
    Replies:
    4
    Views:
    314
  3. sir_alex

    Fromatting an xml file

    sir_alex, Feb 2, 2006, in forum: Python
    Replies:
    2
    Views:
    284
  4. Replies:
    1
    Views:
    139
    Van den Driessche Willy
    Sep 20, 2006
  5. Replies:
    0
    Views:
    84
Loading...

Share This Page