Sure it is possible!
Personally I would want to store the sites title and url on the same line though.
EXAMPLE:
Google|http://www.google.com/
Facebook|http://www.facebook.com/
Then it would be even easier to parse the file.
For an example I will parse this file into a dictionary with the title being the key and the url being the value.
EDIT: The code was in C# then I realized you wanted VB so I convert the code using the converter at
http://converter.telerik.com/[
^]
/// C# Code ///
using (WebClient client = new WebClient())
{
client.DownloadFile("http://something.com/test.txt", "test.txt");
}
string[] lines = File.ReadAllLines(@"test.txt");
Dictionary<string, string> fileData = new Dictionary<string, string>();
for (int i = 0; i < lines.Length; i++)
{
string[] split = lines[i].Split(new char[] { '|' },
StringSplitOptions.RemoveEmptyEntries);
fileData.Add(split[0], split[1]);
}
/// VB.Net Code ///
Using client As New WebClient()
client.DownloadFile("http://something.com/test.txt", "test.txt")
End Using
Dim lines As String() = File.ReadAllLines("test.txt")
Dim fileData As New Dictionary(Of String, String)()
For i As Integer = 0 To lines.Length - 1
Dim split As String() = lines(i).Split(New Char() {"|"C}, StringSplitOptions.RemoveEmptyEntries)
fileData.Add(split(0), split(1))
Next
Then just to show it works.
/// C# Code ///
string title = fileData.Keys.ElementAt(0);
string url = fileData[title];
MessageBox.Show(title + " - " + url);
/// VB.Net Code ///
Dim title As String = fileData.Keys.ElementAt(0)
Dim url As String = fileData(title)
MessageBox.Show(title + " - " + url)
the message box would show " Google - http://www.google.com/ "
You could add all these keys to a listBox for example:
/// C# Code ///
for (int i = 0; i < fileData.Count; i++)
{
sitesListBox.Items.Add(fileData.Keys.ElementAt(i));
}
/// VB.Net Code ///
For i As Integer = 0 To fileData.Count - 1
sitesListBox.Items.Add(fileData.Keys.ElementAt(i))
Next
then use the SelectedIndexChanged event of the list box to navigate the web browser to the url
/// C# Code ///
private void sitesListBox_SelectedIndexChanged(object sender, EventArgs e)
{
webBrowser.Navigate(fileData[(string)sitesListBox.SelectedItem]);
}
/// VB.Net Code ///
Private Sub sitesListBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sitesListBox.SelectedIndexChanged
webBrowser.Navigate(fileData(DirectCast(sitesListBox.SelectedItem, String)))
End Sub
NOTE:
There are many ways to do this but this is a quick way that will work just fine.