Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8384051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:18:51+00:00 2026-06-09T17:18:51+00:00

private string downloadContent() { try { WebRequest request = WebRequest.Create(url); request.Method = GET; response

  • 0
private string downloadContent()
        {
            try
            {
                WebRequest request = WebRequest.Create(url);
                request.Method = "GET";
                response = request.GetResponse();
                Stream stream = response.GetResponseStream();
                reader = new StreamReader(stream);
                string content = reader.ReadToEnd();
                return content;
            }
            catch
            {
                return error;
            }

        }

The result is :

14/08/2012 22:22:11===> ��'���� ����  ���� ������ ���� ������ ������
14/08/2012 22:22:11===> ������ ������ 14/08/2012
14/08/2012 22:22:11===> ������� ���� �������� ����� ��� ������ ���� �� 2 ������
14/08/2012 22:22:11===> ��'��� ��'��� ��� ������ �''�
14/08/2012 22:22:11===> ''�� ������ ����� �� ��� ������� �����''
14/08/2012 22:22:11===> ��� ������ ������: ������ �� ����� ��� ��� �� ��������
14/08/2012 22:22:11===> ���: ����� ��� ��� ���� �� ����-����� ���� ����� �� ����
14/08/2012 22:22:11===> ��''�: ��'���� ������ ����� ����� ����� ������� ������� ��-������
14/08/2012 22:22:11===> ����� ���� ��� ����� �� ���� ���� ���� ���� ������
14/08/2012 22:22:11===> ����� ���� ������ �������: ''����� ������ �� ���� 2013''
14/08/2012 22:22:11===> ���� ������ �����: ���� ���� ������� ������
14/08/2012 22:22:11===> ��� ���: ���� ������ ����� �� ������ ���������� ���� ����� ������- ������ ����..

While the source of the website page is like this:

<TD ALIGN="RIGHT" VALIGN="TOP">&nbsp;<font size=-1 color=#ff9933><b>3077</b></font>&nbsp;</TD></TR><TR BGCOLOR="#FDFDFD">
<TD ALIGN="RIGHT" VALIGN="TOP">
<body onmousemove="overhere()">
<a  onmouseover="EnterContent('ToolTip','פיקוד העורף יערוך ביומיים הקרובים 5 תרגילים בצפון','<u><span style=color:#000099;>כתב: Bloops   בתאריך: 14.08.12  שעה: 21:39</span></u><br>פיקוד העורף יקיים מחר (רביעי) ומחרתיים מספר תרגילים באזור טבריה, עפולה, מגדל העמק ונצרת. מחר בבוקר יתקיים תרגיל המדמה נפילת טילים באזור כלא גלבוע במוע...'); Activate();" onmouseout="deActivate()" href="javascript:void(0)"> 
<img src="http://rotter.net/forum/Images/new_icon_general.gif" border="0"></a></TD><TD ALIGN="right" VALIGN="TOP" WIDTH="55%">
<FONT CLASS='text15bn'><FONT FACE="Arial">
<a href="http://rotter.net/cgi-bin/forum/dcboard.cgi?az=read_count&om=18520&forum=scoops1"><b>פיקוד העורף יערוך ביומיים הקרובים 5 תרגילים בצפון</b>   
</a></font></TD>
      <TD ALIGN="CENTER" VALIGN="TOP">
      <FONT SIZE="2" COLOR="#000099" 
      FACE="Arial"><font size=1 color=000099>14.08.12&nbsp;&nbsp;<font size=1 color=red>21:39</font><br>
       <a href="http://rotter.net/cgi-bin/forum/dcboard.cgi?az=user_profiles&user=Bloops"><font CLASS='text13'><b>Bloops</b></font></a></FONT></TD>      
      <TD ALIGN="CENTER" VALIGN="TOP"><FONT SIZE="1" 
      COLOR="#000099" FACE="Arial">14.08.12<font color="#FDFDFD" size="1">&nbsp;&nbsp;</font><font color=red>21:39</font> <br>מאת Bloops</FONT></TD>
      <TD ALIGN="CENTER" VALIGN="TOP"><FONT 
      SIZE="2" COLOR="#000099" FACE="Arial"><b>0
</b></FONT></TD>

         <TD ALIGN="RIGHT" VALIGN="TOP">&nbsp;<font size=-1 color=#ff9933><b>בעדכון</b></font>&nbsp;</TD></TR><TR BGCOLOR="#eeeeee">
<TD ALIGN="RIGHT" VALIGN="TOP">
<body onmousemove="overhere()">
<a  onmouseover="EnterContent('ToolTip','תשואה&rsquo;&rsquo; מדהימה למדינה: כל מצלמת מהירות עולה 180 א&rsquo; ש&rsquo;ח','<u><span style=color:#000099;>כתב: elbaz   בתאריך: 14.08.12  שעה: 19:35</span></u><br>עמוד &quot;דחליל&quot; עולה 140 א&rsquo; ש&rsquo; ותפעול - 22 מיליון שקל; הרווח מהדוחות? מאות מיליונים בשנה<br>עמוד ריק עולה כמו ניידת משטרה חדשה &#96...'); Activate();" onmouseout="deActivate()" href="javascript:void(0)"> 
<img src="http://rotter.net/forum/Images/new_icon_general.gif" border="0"></a></TD><TD ALIGN="right" VALIGN="TOP" WIDTH="55%">
<FONT CLASS='text15bn'><FONT FACE="Arial">
<a href="http://rotter.net/cgi-bin/forum/dcboard.cgi?az=read_count&om=18489&forum=scoops1"><b>תשואה'' מדהימה למדינה: כל מצלמת מהירות עולה 180 א' ש'ח</b>      
</a></font></TD>
      <TD ALIGN="CENTER" VALIGN="TOP">
      <FONT SIZE="2" COLOR="#000099" 
      FACE="Arial"><font size=1 color=000099>14.08.12&nbsp;&nbsp;<font size=1 color=red>19:35</font><br>
       <a href="http://rotter.net/cgi-bin/forum/dcboard.cgi?az=user_profiles&user=elbaz"><font CLASS='text13'><b>elbaz</b></font></a></FONT></TD>      
      <TD ALIGN="CENTER" VALIGN="TOP"><FONT SIZE="1" 
      COLOR="#000099" FACE="Arial">14.08.12<font color="#eeeeee" size="1">&nbsp;&nbsp;</font><font color=red>21:38</font> <br>מאת גדליה הפיל</FONT></TD>
      <TD ALIGN="CENTER" VALIGN="TOP"><FONT 
      SIZE="2" COLOR="#000099" FACE="Arial"><b>4
</b></FONT></TD>

And im downloading the text between the tags:

private void GetText(string text)
        {
            names = new List<string>();
            string startTag = "forum=scoops1\"><b>";
            string endTag = "</b>";
            int startTagWidth = startTag.Length;
            int endTagWidth = endTag.Length;
            index = 0;
            while (true)
            {
                index = text.IndexOf(startTag, index);
                if (index == -1)
                {
                    break;
                }
                // else more to do - index now is positioned at first character of startTag 
                int start = index + startTagWidth;
                index = text.IndexOf(endTag, start + 1);
                if (index == -1)
                {
                    break;
                }
                // found the endTag 
                profileName = text.Substring(start, index - start);
                names.Add(profileName);
            }
        }

While text is the content source of the website page.

The question is why im getting this symbols instead text and if there is anyway to repair it ?

Im using same code for another site wich im not having this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:18:52+00:00Added an answer on June 9, 2026 at 5:18 pm

    You need to use the correct encoding in order to read the returned stream values.

    Make sure that you are using the same encoding that the page is in (will either be in the HTTP headers or a meta element on the page – the content-type of the page).

    Use that encoding to get the correct string representation of the bytes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the download code: private string downloadContent() { WebRequest request = WebRequest.Create(url); request.Method
private string _itemId; [Browsable(true), Description(Required identifier for the Item.)] public string ItemId { get
private class CompAdvertisements : IComparer<Advertisements> { private string OrderBy { get; set; } public
public string DefString { set; private get; } private string path = http://someuri.org/search?Par1=15&Par2=55; public
I have a method : private String getProperty(String property) throws IOException,ConfigException { // first
class Student { private string FirstName { get; set; } private string LastName {
I receive three errors using the following function: Private Sub readWebpage(ByVal url As String)
I have: class Foo1 { private string name1; [CategoryAttribute(Category1)] public string Name1 { get
private string? typeOfContract { get { return (string?)ViewState[typeOfContract]; } set { ViewState[typeOfContract] = value;
private String indexPage(URL currentPage) throws IOException { String content = ; is = currentPage.openStream();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.