Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 596 Vote(s) - 3.45 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.Net] Making a cool File/Directory Search

#21
How can I make a list that will actually provide you with a link to that file after searching for it?
Reply

#22
Quote:(04-03-2013, 11:27 PM)jameswomack Wrote:

[To see links please register here]

How can I make a list that will actually provide you with a link to that file after searching for it?

By link you mean string? As in filepath?

List<T> generic class from the System.Collections namespace. Make the type string.
Reply

#23
I like the way the results are displayed using the original code on this thread, but I want users to be able to click on the results and navigate to them or open the file. I have tried implementing List of T and keep getting different errors.
Reply

#24
Quote:(04-04-2013, 02:44 PM)jameswomack Wrote:

[To see links please register here]

I like the way the results are displayed using the original code on this thread, but I want users to be able to click on the results and navigate to them or open the file. I have tried implementing List of T and keep getting different errors.

You're going to have to tell us what errors you are getting as nobody will be able to help until you do. You're doing something wrong, but until we know what errors you are dealing with you might as well ask us to grab a crystal ball and guess what your solution might be. The List<string> should be implemented to store the filepaths, then when a certain item is "clicked" grab the filepath from the list associated with the selection, and invoke the default handler for that filetype perhaps to open the file.
Reply

#25
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
Dim strPath
strPath = "C:\QualWorld\ISO World\ISO9001\"
For Each Item As String In IO.Directory.GetFiles(strPath, "*" & ComboBox1.Text.ToString & "*" & ".*", IO.SearchOption.AllDirectories)
With ListView1.Items
'Strip the Filename from the Full file path
.Add(Item.Substring(Item.LastIndexOf("\") + 1), iconlist.Images.Count - 1)

.Add(IO.Path.GetFileNameWithoutExtension(Item))

'Add File size to second coloumn
.Item(.Count - 1).SubItems.Add(Math.Round(FileLen(Item) / 1048576, 2) & " MB")

'Add Full path to third coloumn
.Item(.Count - 1).SubItems.Add(Item)


'Show current Progress
Label1.Text = .Count.ToString & " Files found"
End With
Threading.Thread.Sleep(10)
Next

End Sub

Okay above is the code I got from this before I tried to add the links. This code works as it should. Can you please show me where to put in the List(of T)...Thanks,
Reply

#26
Well if you read the comments in the code, one of them say "strip the filename from the full file path". So before or after it, add Item to the List you wish to use. This "Item" contains full file path.
Reply

#27
I guess I don't understand. I don't seem to be able to comprehend what you are suggesting. Can you send me an example? Does the current setup allow for links to be processed inside "listview1"?
Reply

#28
Actually the full file path is already in the listview's third coloumn. So all you have to do is trigger the listview's item selected event and enter your code to open the file or whatever you want there.

If you are unable to follow this, then still you should find out on your own. Otherwise you'll have a hard time learning.
Reply

#29
Private Sub ListView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
Dim OpenThis As String
Dim SelectedPath As Object
Dim PathConverted As Converter(Of Object, String)

SelectedPath = Me.ListView1.CheckedItems(Path.Text)
PathConverted = SelectedPath
OpenThis = "C:\" & SelectedPath

FileOpen(Access:=OpenAccess.Default, FileName:=OpenThis, FileNumber:=Nothing, Mode:=OpenMode.Append, RecordLength:=Nothing, Share:=Nothing)
End Sub


Above is my activation code and everything goes smooth until it reads the file name. I did notice that when it displays the path on my pc it leaves out the C:\ so I added it to the code and I still get the same error. "Bad file name or File Number." Any ideas???? Thanks again for all the help!
Reply

#30
Dim OpenSelected As String
OpenSelected = "C:\" & TextBox1.Text.ToString
System.Diagnostics.Process.Start(OpenSelected)

Figured it out. I was trying to open the file all wrong. Above is the code I wound up using.

Coder-San - Thank you for tellg me that it triggering was a factor it all sort of fell into place after you said that.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through