Hello Everyone,

I hope this is the right place i'm posting
this, basically I need some help with Visual Basic 2008.

We've been set a task to build a
really basic web browser with one advanced function. I've done the web browser
with the basic functionality, but this advanced feature really has got me

The advanced feature is a "most
visited site" feature. I need to create some kind of listbox, that keeps track
of all the websites visited (when the go button is pressed) and arranges them in
the most popular order (i.e. the one that has been clicked the most)

Furthermore, it states that substrings
should be used so that for example if you go to http://daniweb.com and go to http://daniweb.com/test that counts as 1 hit.

I've been breaking my head out, because I'm sure its something to do with arrays,
but he did say you will need to use multiple procedures/strings/functions....

Hope someone out there can help me


First off the visited locations will need to be stored somewhere, which could mean a small database table or a file. All visited pages will need to be saved into that file with all of the relevant information you would need.
A regular expression can easily split out the domain part of the URL. Then it is just a matter of sorting the database table or file based on the number of occurrences for each URL.

ahh right, ok thank you hericles.
The thing is, he doesn't want us to use complicated things like databases yet.
All he told us was that it as possible just using basic functions, procedures and possibly arrays. I'm beggining to wonder whether its actually possible as no one on the whole web has done an example with this feature on.

Well, it is. But arrays won't persist beyond the browser being shut down. An array would work during one particular session however so if that is what is required create a string array, array list or dataTable to hold the domain part of each URL and store each URL in there as it is visited.
Counting through the array to find the most popular isn't too difficult (efficiency will be important though, there are a variety of ways you could implement this) and then output the results in order of highest to lowest in the drop down.

Thats exactly what I'm looking to do hericles :)
I do understand that the array will be lost when the application is closed as he did say that, I would be very greatful if you could give me a sample code to work on for the counting feature as I've tried creating basic arrays, but I don't have a clue how to make it count and show it in the most popular order from highest to lowest.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.