1,105,331 Community Members

Visual Basic Browser Isssue

Member Avatar
jakeevans
Newbie Poster
3 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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
stumped.

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

Thanks,
Jake

Member Avatar
hericles
Veteran Poster
1,078 posts since Nov 2007
Reputation Points: 98 [?]
Q&As Helped to Solve: 232 [?]
Skill Endorsements: 14 [?]
Featured
 
0
 

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.

Member Avatar
jakeevans
Newbie Poster
3 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
hericles
Veteran Poster
1,078 posts since Nov 2007
Reputation Points: 98 [?]
Q&As Helped to Solve: 232 [?]
Skill Endorsements: 14 [?]
Featured
 
0
 

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.

Member Avatar
jakeevans
Newbie Poster
3 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: