Click here to Skip to main content
15,895,462 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionMight be a stupid question but... Pin
Darshon23-Feb-06 11:08
Darshon23-Feb-06 11:08 
AnswerRe: Might be a stupid question but... Pin
Dean_SF24-Feb-06 9:20
Dean_SF24-Feb-06 9:20 
GeneralRe: Might be a stupid question but... Pin
Darshon24-Feb-06 10:43
Darshon24-Feb-06 10:43 
GeneralRe: Might be a stupid question but... Pin
Dean_SF24-Feb-06 10:56
Dean_SF24-Feb-06 10:56 
GeneralRe: Might be a stupid question but... Pin
Darshon24-Feb-06 11:15
Darshon24-Feb-06 11:15 
GeneralRe: Might be a stupid question but... Pin
Dean_SF24-Feb-06 11:24
Dean_SF24-Feb-06 11:24 
GeneralRe: Might be a stupid question but... Pin
Darshon24-Feb-06 11:34
Darshon24-Feb-06 11:34 
GeneralRe: Might be a stupid question but... Pin
Darshon24-Feb-06 13:37
Darshon24-Feb-06 13:37 
Hey Dean,

I did what you suggested and it works very nicely and it doesn't lag at all. At least not with my Favorites folder and I have quite a few links in there. Wink | ;-) The only problem I have now is that I have only been able to read the complete url file text and there is too much garbage text to send it as a http: address. I have to find a way to extract only the url text and put that in the hidden column. Any ideas? Thanks Smile | :)

The text I get from the StreamReader is simular to this for every url file it reads, just the actual http:// text changes.

"[default]baseurl=http://www.adenak.com/[InternetShortcut]URL=http://www.adenak.com/Modified=1067F49A2E3BC50134"

Private Sub tvwExplorer_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvwExplorer.AfterSelect<br />
        'Get reference to the selected node<br />
        Dim dirInfo As DirectoryInfo = New DirectoryInfo(e.Node.FullPath)<br />
        'Clear all the items in the listview<br />
        lvwExplorer.Items.Clear()<br />
        'Check if the Directory exist or not<br />
        If (dirInfo.Exists) Then<br />
            'Get reference to all the files<br />
            Dim fileInfos As FileInfo() = dirInfo.GetFiles()<br />
            'Add all the files to the ListView one by one<br />
            Dim info As FileInfo<br />
            For Each info In fileInfos<br />
                'First check the extension, make sure it's a url file<br />
                If info.Extension = ".url" Then<br />
                    Try<br />
                        'Open the file and read it<br />
                        'Convert the file path into a string for the StreamReader<br />
                        Dim infoPath As String = info.FullName<br />
                        ' Create an instance of StreamReader to read from each file.<br />
                        Dim sr As StreamReader = New StreamReader(infoPath)<br />
                        'Read the complete url file text<br />
                        Dim url As String<br />
                        url = sr.ReadToEnd()<br />
                        'Extract only the url text<br />
                        <big>This is where I need to extract the http text</big><br />
<br />
                        Dim item As ListViewItem = New ListViewItem<br />
                        item = lvwExplorer.Items.Add(info.Name)<br />
                        ' Link the ImageList object<br />
                        item.ImageIndex = 2<br />
                        'Add the items<br />
                        item.SubItems.Add(url.ToString())<br />
                        item.SubItems.Add(info.LastAccessTime.ToString())<br />
                        sr.Close()<br />
                    Catch ex As Exception<br />
                        'Ignor Exception<br />
                        Return<br />
                    End Try<br />
                End If<br />
            Next<br />
        End If<br />
    End Sub


-- modified at 19:43 Friday 24th February, 2006
GeneralRe: Might be a stupid question but... Pin
Darshon24-Feb-06 15:57
Darshon24-Feb-06 15:57 
QuestionForm created by thread inaccessible Pin
RJGCarey23-Feb-06 10:52
RJGCarey23-Feb-06 10:52 
AnswerRe: Form created by thread inaccessible Pin
Joshua Quick24-Feb-06 8:10
Joshua Quick24-Feb-06 8:10 
QuestionStupid question Pin
teuneboon23-Feb-06 9:55
teuneboon23-Feb-06 9:55 
AnswerRe: Stupid question Pin
J4amieC23-Feb-06 10:17
J4amieC23-Feb-06 10:17 
GeneralRe: Stupid question Pin
teuneboon23-Feb-06 10:24
teuneboon23-Feb-06 10:24 
GeneralRe: Stupid question Pin
J4amieC23-Feb-06 10:31
J4amieC23-Feb-06 10:31 
GeneralRe: Stupid question Pin
teuneboon23-Feb-06 11:04
teuneboon23-Feb-06 11:04 
AnswerRe: Stupid question Pin
progload23-Feb-06 10:27
progload23-Feb-06 10:27 
GeneralRe: Stupid question Pin
teuneboon23-Feb-06 10:31
teuneboon23-Feb-06 10:31 
GeneralRe: Stupid question Pin
progload23-Feb-06 10:47
progload23-Feb-06 10:47 
GeneralRe: Stupid question Pin
teuneboon23-Feb-06 11:11
teuneboon23-Feb-06 11:11 
GeneralRe: Stupid question Pin
progload23-Feb-06 11:20
progload23-Feb-06 11:20 
GeneralRe: Stupid question Pin
teuneboon24-Feb-06 2:51
teuneboon24-Feb-06 2:51 
GeneralRe: Stupid question Pin
progload24-Feb-06 5:58
progload24-Feb-06 5:58 
GeneralRe: Stupid question Pin
teuneboon24-Feb-06 6:39
teuneboon24-Feb-06 6:39 
AnswerRe: Stupid question Pin
Allah On Acid23-Feb-06 10:41
Allah On Acid23-Feb-06 10:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.