Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I need to get some information from a website
"http://www.tsetmc.com/Loader.aspx?ParTree=15"

I used any code like:

C#
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://www.tsetmc.com/Loader.aspx?ParTree=15");
            myRequest.Method = "GET";
            WebResponse myResponse = myRequest.GetResponse();
            StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
            string result = sr.ReadToEnd();
            sr.Close();
            myResponse.Close();
            Console.WriteLine(result.ToString());

but the result is like :
� MI�T ��}[s����{���nHV@��R�V�8���]��ʦjkK5$Aq�� wf$Kɗ�OJ*�~�>{(ӶJT���c(�}�d�i 3 b(R#�E
��h�O�>�>}��_�w��w�Bo���r9�7l��\�7��p%X�v��kW>^ ��Eop0���`�;����l�P�w�h�s����9^ ^y����p�s��ò¥¨¯Ë½ï¿½ns��r���>�o|q��n���q#�]m�����~k�ҥ��6 ���s-X�ܜ]ڸ�^�7;m/l���w�����`'��˭�Z�u���B/����i?�97s��̯�wç—°Q����A����V�����~��t���r;�����~/�"�?��^n~��Ǡ���f�ɵYߛ�Ϲ�.u�ޥV��v�Fo���/��{~5��볿���7�^����9|��R���V�� ��w�{�����������߿X�]����a�V���Q/;"����A��!|�_� 5��+¤wyy�7;�@�[7�v?�� �07s�׿ �-5s�R\�;F�m.���?i�x����ƍ�޸�����_�fv>h�+I4
��3kݰ�ï

I have to say the site is in Arabic
Posted
Updated 23-Feb-15 1:20am
v2
Comments
Rajat_RJT 23-Feb-15 7:31am    
Are you trying to get data from REST Api of that website?
It may be in Stream format, You need to check response headers.
Member 10875659 24-Feb-15 7:35am    
I'm not very well in web application, I just need two number of mentioned site to use it in my application. I don't know what is the REST Api.
Rajat_RJT 26-Feb-15 2:15am    
Which numbers you want to use from that website?
Member 10875659 26-Feb-15 12:55pm    
I think the problem is because of the website security, because my code works for other sites. I also used webbrowser control to browse the site ,but it failed!!
Rajat_RJT 27-Feb-15 0:41am    
May be, but if its security issue, then possibly it should return "Unauthorized" message.

1 solution

 
Share this answer
 
Comments
Member 10875659 24-Feb-15 8:46am    
I tried your solution but still it doesn't work! and I got bad symbols
Member 10875659 24-Feb-15 9:37am    
The problem is that I can't access to this site. I think it's because of website security. Because I tested my code on the other Arabic website and worked.
OriginalGriff 24-Feb-15 9:53am    
There isn't anything I can do about that! :laugh:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900