Click here to Skip to main content
15,881,876 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a C# program that has list box and button, when I click button it update list box with data from file
something like this:
http://www.up.iranblog.com/images/yqadtgtg0ikq9qcg9m0u.rar
please help me
Posted
Updated 17-Jul-11 23:24pm
v2
Comments
Abhinav S 18-Jul-11 5:13am    
Did you try something?
Member 7904482 18-Jul-11 5:16am    
not yet
OriginalGriff 18-Jul-11 5:42am    
Well, there's your problem!

You need to use the class System.Net.HttpWebRequest. To create one, you need to use the compile-time variable of the class System.Net.WebRequest and its static factory method Create, as the run-time type is defined by the URI. You System.Net.HttpWebRequest.Method should be "GET".

Find a code sample here: http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx[^].

—SA
 
Share this answer
 
Assuming you have a version of Visual Studio, then you should at least have a Form containing a Listbox and Button with some event handling code. You will then need to write some more code to receive your data, parse it if necessary, and populate your listbox. I would guess you will be using a WebBrowser[^] control to get access to your internet data.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 18-Jul-11 13:37pm    
Why using WebBrowser? What to do with it? OP simply needs System.Net.HttpWebRequest to do Web scraping.

Please see my solution.
--SA
Richard MacCutchan 18-Jul-11 14:31pm    
I'm just giving pointers. If OP really wants to make progress then he/she really needs to learn to do some research, and that seemed a good enough place to start from.

However, I think your suggestion will be useful for me, so I'll add a 5 for you.
Sergey Alexandrovich Kryukov 18-Jul-11 14:37pm    
Thank you very much. You would be completely right if you did not mention WebBrowser at all -- this is misleading as this is not really needed and puzzling.
--SA
Richard MacCutchan 18-Jul-11 14:47pm    
Yeah, I made a screen scraper using WebBrowser, so I now need to take your suggestions and rework my program. As you may guess, screen scraping is a new subject for me.

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