Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Extract web page via code fromatting (http://www.velocityreviews.com/forums/t516185-extract-web-page-via-code-fromatting.html)

Lit 06-21-2007 12:14 AM

Extract web page via code fromatting
 
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.





Alexey Smirnov 06-21-2007 07:23 AM

Re: Extract web page via code fromatting
 
On Jun 21, 2:14 am, "Lit" <sql_agent...@hotmail.com> 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 06-21-2007 10:26 PM

Re: Extract web page via code fromatting
 
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" <alexey.smirnov@gmail.com> wrote in message
news:1182410600.013728.142600@u2g2000hsc.googlegro ups.com...
> On Jun 21, 2:14 am, "Lit" <sql_agent...@hotmail.com> 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 06-22-2007 06:55 AM

Re: Extract web page via code fromatting
 
On Jun 22, 12:26 am, "Lit" <sql_agent...@hotmail.com> wrote:
> when I save to PDF I am getting the \r\n\t etc..


Then it depends on the function that saved PDF


Lit 06-22-2007 05:17 PM

Re: Extract web page via code fromatting
 
Nop, The PDF function needs the same thing you see when you view source.
I think some Encoding is needed here.

"Alexey Smirnov" <alexey.smirnov@gmail.com> wrote in message
news:1182495328.762335.25110@c77g2000hse.googlegro ups.com...
> On Jun 22, 12:26 am, "Lit" <sql_agent...@hotmail.com> wrote:
>> when I save to PDF I am getting the \r\n\t etc..

>
> Then it depends on the function that saved PDF
>





All times are GMT. The time now is 11:22 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.