Opening Network files

annir

Active member
Joined
Sep 1, 2008
Messages
32
Programming Experience
Beginner
Hi guys

I have a problem, does anyone knows how to open the network or a specific drive then it will open in the same form or can place it in a container inside that form...

pls, I need your help...

thanks a lot...

annir
 
Hello there.

I understand that English may not be your mother tongue, but I have a hard time understanding what you want.

Do you want to open a file in the network?
Or do you want to open a form/control which is located inside a .dll in the network?

Bobby
 
Sorrry for that....

I Have a share drive (network drive) and I want to open that.

This is the process:
I have a form in vb.net then in that form I will open the network drive but I want all the file in the network to be list inside my form and at the same time I can open any files in that list.

thanks hope you will understand this time, my knowledge in vb.net is very basic..

annir.
 
Now I understand. :)

I haven't seen a control for that but you can use the Listview and Treeview to show the files and folders. For getting this information you can use the classes IO.File and IO.Directory (IO.Directory.GetDirectories(path) and IO.Directory.GetFiles(Path)).

With this you can easily clone the Windows Explorer or any other file Navigator.

Bobby
 
Try it out.

Directory.GetFiles/Directories returns a String Array, through which you can easily loop through with a For Each loop.

Some pseudo Code:

VB.NET:
Private yourPath as String = "whatever"
Private newPath as String = ""

Form Load()
Me.YourListView.Items.Clear()
For each thing as String in IO.Directory.GetFiles(yourPath)
      Me.YourListView.Items.Add(thing)
Next

ListView DoubleClick
me.newPath &= "\" & ClickedItem.name
For each thing as String in IO.Directory.GetFiles(yourPath & newPath)
      Me.YourListView.Items.Add(thing)
Next

The Same for the dirctories.

Bobby
 
thanks,

can I ask one more thing what is ClickedItem.name it gives me error

thank you very much...

annir
 
I didn't remember what it was so I called it that way. ;)
Actually it's Me.YourListView.SelectedItems(0).Name/Text .

Bobby

thanks again,

but it gives me an error... says: Property access must assign to the property or use its value.

Bobby, thank you very much... I really appreciate your kindness!

Posting the error and possibly a screen shot is always better than just saying "it gives me an error"

sorry, for the wrong grammar.

annir
 
Back
Top