473,569 Members | 3,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help Needed with Treeview control

Hi all,

I'm fairly new to VB.NET but have more experience with VB6 and earlier.
I'm trying to create an application that will move files from one
folder to another. Here is the scenario.

I have a folder on my local hard drive that has about 1400 .XLS files.
These files are all named with the same pattern of call#_Serial #.xls.
I need to move these to a folder on the network. the network folder
structure is based on serial #. So what I want to do is read through
the files on my local hard drive (particular folder only) then parse
out the serial number from the file name, find that folder on the
network (subfolder of a main folder) and move the file there.

I've built a form that populates a tree control with the files from the
source directory and them I'm stuck on how to proceed from there.

Any help that someone can give me on this would be appreciated.

Thanks

Craig

Jan 4 '07 #1
5 1524
First of all, if you have an expectation that, when you post a message via
Google Groups, the message will be 'published' instantly, then please
disabuse yourself of that expectation. Messages can take some minutes to get
'published'. There is nothing more annoying than people posting messages
multiple times, and even more so when they are only a few seconds apart.

If you want the 'number' part of the filename when all the filenames conform
to that pattern, all you need to do is something like:

Dim _ss As String() = _filename.Split ("#"c")
Dim _targetfolder as String = _ss(1)

The 'number' part will always be found in the 2nd element of the array
returned by the Split method.
"Saabster" <cb******@sbcgl obal.netwrote in message
news:11******** *************@v 33g2000cwv.goog legroups.com...
Hi all,

I'm fairly new to VB.NET but have more experience with VB6 and earlier.
I'm trying to create an application that will move files from one
folder to another. Here is the scenario.

I have a folder on my local hard drive that has about 1400 .XLS files.
These files are all named with the same pattern of call#_Serial #.xls.
I need to move these to a folder on the network. the network folder
structure is based on serial #. So what I want to do is read through
the files on my local hard drive (particular folder only) then parse
out the serial number from the file name, find that folder on the
network (subfolder of a main folder) and move the file there.

I've built a form that populates a tree control with the files from the
source directory and them I'm stuck on how to proceed from there.

Any help that someone can give me on this would be appreciated.

Thanks

Craig

Jan 4 '07 #2
Actually the double posting was a problem with the beta google groups
interface. for some reason it was hung up and when I trued to refresh
it, it posted twice. I did delete the 2nd erroneous posting as soon as
I saw it. so my apologies for that. I agree I hate seeing multiple
postings as well and usually use a new reader, but as this is a group I
spend little time in, I used Google instead.

Next Thanks for the info on parsing out the serial number. I took a
longer way since I did not know about the split method.

Once I have the target folder name how can find that in a network tree
structure that can be buried 3 levels deep and is not named the serial
number but instead is called "Serial Number 123456-456712"? So I guess
I 'm asking is how do I traverse a directory structure and find a 1
folder out of over 1000 that has my serial number in its name?

Thanks

Craig
Stephany Young wrote:
First of all, if you have an expectation that, when you post a message via
Google Groups, the message will be 'published' instantly, then please
disabuse yourself of that expectation. Messages can take some minutes to get
'published'. There is nothing more annoying than people posting messages
multiple times, and even more so when they are only a few seconds apart.

If you want the 'number' part of the filename when all the filenames conform
to that pattern, all you need to do is something like:

Dim _ss As String() = _filename.Split ("#"c")
Dim _targetfolder as String = _ss(1)

The 'number' part will always be found in the 2nd element of the array
returned by the Split method.
"Saabster" <cb******@sbcgl obal.netwrote in message
news:11******** *************@v 33g2000cwv.goog legroups.com...
Hi all,

I'm fairly new to VB.NET but have more experience with VB6 and earlier.
I'm trying to create an application that will move files from one
folder to another. Here is the scenario.

I have a folder on my local hard drive that has about 1400 .XLS files.
These files are all named with the same pattern of call#_Serial #.xls.
I need to move these to a folder on the network. the network folder
structure is based on serial #. So what I want to do is read through
the files on my local hard drive (particular folder only) then parse
out the serial number from the file name, find that folder on the
network (subfolder of a main folder) and move the file there.

I've built a form that populates a tree control with the files from the
source directory and them I'm stuck on how to proceed from there.

Any help that someone can give me on this would be appreciated.

Thanks

Craig
Jan 4 '07 #3
Ahhhh ... Another good reason to avoid Google Groups like the plague :)

Ummm ... How about:

Dim _targetfolder As String = "Serial Number " & _ss(1)

Surely you must know the base path to where your target folders are stored.
"Saabster" <cb******@sbcgl obal.netwrote in message
news:11******** **************@ q40g2000cwq.goo glegroups.com.. .
Actually the double posting was a problem with the beta google groups
interface. for some reason it was hung up and when I trued to refresh
it, it posted twice. I did delete the 2nd erroneous posting as soon as
I saw it. so my apologies for that. I agree I hate seeing multiple
postings as well and usually use a new reader, but as this is a group I
spend little time in, I used Google instead.

Next Thanks for the info on parsing out the serial number. I took a
longer way since I did not know about the split method.

Once I have the target folder name how can find that in a network tree
structure that can be buried 3 levels deep and is not named the serial
number but instead is called "Serial Number 123456-456712"? So I guess
I 'm asking is how do I traverse a directory structure and find a 1
folder out of over 1000 that has my serial number in its name?

Thanks

Craig
Stephany Young wrote:
>First of all, if you have an expectation that, when you post a message
via
Google Groups, the message will be 'published' instantly, then please
disabuse yourself of that expectation. Messages can take some minutes to
get
'published'. There is nothing more annoying than people posting messages
multiple times, and even more so when they are only a few seconds apart.

If you want the 'number' part of the filename when all the filenames
conform
to that pattern, all you need to do is something like:

Dim _ss As String() = _filename.Split ("#"c")
Dim _targetfolder as String = _ss(1)

The 'number' part will always be found in the 2nd element of the array
returned by the Split method.
"Saabster" <cb******@sbcgl obal.netwrote in message
news:11******* **************@ v33g2000cwv.goo glegroups.com.. .
Hi all,

I'm fairly new to VB.NET but have more experience with VB6 and earlier.
I'm trying to create an application that will move files from one
folder to another. Here is the scenario.

I have a folder on my local hard drive that has about 1400 .XLS files.
These files are all named with the same pattern of call#_Serial #.xls.
I need to move these to a folder on the network. the network folder
structure is based on serial #. So what I want to do is read through
the files on my local hard drive (particular folder only) then parse
out the serial number from the file name, find that folder on the
network (subfolder of a main folder) and move the file there.

I've built a form that populates a tree control with the files from the
source directory and them I'm stuck on how to proceed from there.

Any help that someone can give me on this would be appreciated.

Thanks

Craig

Jan 4 '07 #4
I have the base path mapped as a drive letter so yes I know that, but
the problem is there are subfolders within subfolders. the actual
target folder can be up to 3 levels deeper than the base path.
Will VB.NET beable to find it without having the full path? If so how?

Thanks

Craig
Stephany Young wrote:
Ahhhh ... Another good reason to avoid Google Groups like the plague :)

Ummm ... How about:

Dim _targetfolder As String = "Serial Number " & _ss(1)

Surely you must know the base path to where your target folders are stored.
"Saabster" <cb******@sbcgl obal.netwrote in message
news:11******** **************@ q40g2000cwq.goo glegroups.com.. .
Actually the double posting was a problem with the beta google groups
interface. for some reason it was hung up and when I trued to refresh
it, it posted twice. I did delete the 2nd erroneous posting as soon as
I saw it. so my apologies for that. I agree I hate seeing multiple
postings as well and usually use a new reader, but as this is a group I
spend little time in, I used Google instead.

Next Thanks for the info on parsing out the serial number. I took a
longer way since I did not know about the split method.

Once I have the target folder name how can find that in a network tree
structure that can be buried 3 levels deep and is not named the serial
number but instead is called "Serial Number 123456-456712"? So I guess
I 'm asking is how do I traverse a directory structure and find a 1
folder out of over 1000 that has my serial number in its name?

Thanks

Craig
Stephany Young wrote:
First of all, if you have an expectation that, when you post a message
via
Google Groups, the message will be 'published' instantly, then please
disabuse yourself of that expectation. Messages can take some minutes to
get
'published'. There is nothing more annoying than people posting messages
multiple times, and even more so when they are only a few seconds apart.

If you want the 'number' part of the filename when all the filenames
conform
to that pattern, all you need to do is something like:

Dim _ss As String() = _filename.Split ("#"c")
Dim _targetfolder as String = _ss(1)

The 'number' part will always be found in the 2nd element of the array
returned by the Split method.
"Saabster" <cb******@sbcgl obal.netwrote in message
news:11******** *************@v 33g2000cwv.goog legroups.com...
Hi all,

I'm fairly new to VB.NET but have more experience with VB6 and earlier.
I'm trying to create an application that will move files from one
folder to another. Here is the scenario.

I have a folder on my local hard drive that has about 1400 .XLS files.
These files are all named with the same pattern of call#_Serial #.xls.
I need to move these to a folder on the network. the network folder
structure is based on serial #. So what I want to do is read through
the files on my local hard drive (particular folder only) then parse
out the serial number from the file name, find that folder on the
network (subfolder of a main folder) and move the file there.

I've built a form that populates a tree control with the files from the
source directory and them I'm stuck on how to proceed from there.

Any help that someone can give me on this would be appreciated.

Thanks

Craig
Jan 4 '07 #5
No VB.NET will not be able to find it, but you will be able to write some
recursive code to walk the directory tree starting from the base path to
find the folder of interest.

For each folder that you inspect that is not the one you want you need to
check it's sub-folders and so on.
"Saabster" <cb******@sbcgl obal.netwrote in message
news:11******** **************@ s80g2000cwa.goo glegroups.com.. .
>I have the base path mapped as a drive letter so yes I know that, but
the problem is there are subfolders within subfolders. the actual
target folder can be up to 3 levels deeper than the base path.
Will VB.NET beable to find it without having the full path? If so how?

Thanks

Craig
Stephany Young wrote:
>Ahhhh ... Another good reason to avoid Google Groups like the plague :)

Ummm ... How about:

Dim _targetfolder As String = "Serial Number " & _ss(1)

Surely you must know the base path to where your target folders are
stored.
"Saabster" <cb******@sbcgl obal.netwrote in message
news:11******* *************** @q40g2000cwq.go oglegroups.com. ..
Actually the double posting was a problem with the beta google groups
interface. for some reason it was hung up and when I trued to refresh
it, it posted twice. I did delete the 2nd erroneous posting as soon as
I saw it. so my apologies for that. I agree I hate seeing multiple
postings as well and usually use a new reader, but as this is a group I
spend little time in, I used Google instead.

Next Thanks for the info on parsing out the serial number. I took a
longer way since I did not know about the split method.

Once I have the target folder name how can find that in a network tree
structure that can be buried 3 levels deep and is not named the serial
number but instead is called "Serial Number 123456-456712"? So I guess
I 'm asking is how do I traverse a directory structure and find a 1
folder out of over 1000 that has my serial number in its name?

Thanks

Craig
Stephany Young wrote:
First of all, if you have an expectation that, when you post a message
via
Google Groups, the message will be 'published' instantly, then please
disabuse yourself of that expectation. Messages can take some minutes
to
get
'published'. There is nothing more annoying than people posting
messages
multiple times, and even more so when they are only a few seconds
apart.

If you want the 'number' part of the filename when all the filenames
conform
to that pattern, all you need to do is something like:

Dim _ss As String() = _filename.Split ("#"c")
Dim _targetfolder as String = _ss(1)

The 'number' part will always be found in the 2nd element of the array
returned by the Split method.
"Saabster" <cb******@sbcgl obal.netwrote in message
news:11******* **************@ v33g2000cwv.goo glegroups.com.. .
Hi all,

I'm fairly new to VB.NET but have more experience with VB6 and
earlier.
I'm trying to create an application that will move files from one
folder to another. Here is the scenario.

I have a folder on my local hard drive that has about 1400 .XLS
files.
These files are all named with the same pattern of call#_Serial
#.xls.
I need to move these to a folder on the network. the network folder
structure is based on serial #. So what I want to do is read through
the files on my local hard drive (particular folder only) then parse
out the serial number from the file name, find that folder on the
network (subfolder of a main folder) and move the file there.

I've built a form that populates a tree control with the files from
the
source directory and them I'm stuck on how to proceed from there.

Any help that someone can give me on this would be appreciated.

Thanks

Craig


Jan 4 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1442
by: MSNEWS | last post by:
Hi I'm trying to use the treeview control but having a hard time trying to visualize how I'm going to achieve when I'm trying to do, as an example in the end of my program I want my treeview to look something like this :- ANIMALS FOUR LEGS DOGS POODLE
12
1536
by: serge calderara | last post by:
Dear all, I have a function that I need to run in a thread due to the fact that it can takes long time to execute according to the amount of data to collect. This function is also populating a treeview control whne collected data gets finished. In order to achieve this I have used the following code :...
0
979
by: timtos | last post by:
I want to write my own treeview control. I set this.SetStyle(ControlStyles.UserPaint, true); and painted a treeview from scratch. So far so good. The problem now is that if I use/ tear the scrollbars to scroll up and down, some parts of the treeview are missing/ not painted. The same happens when _clicking_
10
2815
by: Brian | last post by:
I'm reasonably new to C#, and using a class containing a hashtable collection to feed a treeview. My problem is that I can't pull the data from the hashtable! Here's the code I have: if (myItem.DataFields.Count != 0) foreach (string name in myItem.DataFields.Values) { treeView1.SelectedNode.Nodes.Add (name); // Error on this line }
1
1168
by: needin4mation | last post by:
Hi, I am using C# in asp.net. I have my treeview control from my built ..dll on my toolbox. I can drop it on the webpage. What I cannot do is reference treeview objects from the codebehind form. I can see: protected Microsoft.Web.UI.WebControls.TreeView TreeView1; But as soon as I try something like:
8
1532
by: RCS | last post by:
All, OK, so I'm working on a template for our new ASP.NET applications. Part of this, includes using the new menu and breadcrumbs control in ASP.NET 2.0 (I'm using beta 2). I put the hierarchy of the applications and navigation in a database, and am able to pull that into the app by inheriting StaticSiteMapProvider. So that's set and...
2
2588
by: pmcguire67 | last post by:
There has been a lot of discussion lately about extending the treeview control to allow finding a node by key rather than by index. Everyone seems to agree that a hashtable is needed to accomplish this. Also, there is a KB article (http://support.microsoft.com/default.aspx?scid=kb;en-us;311318) purporting to show you how to extend the treenode...
3
1054
by: ljh | last post by:
Just learning......so please be gentle.... This is the idea (wrong as it may be)....... I'd like to code an app that has a treeview for a navigation element that opens panels (to it's right) based on which element in the treeview is selected. (Think Outlook - but single panes to the right instead of the usual double pane.) Thing...
1
1079
by: Blue Apricot | last post by:
Hello friendly people, I am on Day 2 of learniing ASP.NET. I am bored with watching videos, and want to "do something". In my current role as a Front End Designer making User Interfaces, I frequently custom make a "Windows Explorer Tree" in prototypes I design. Well, I see that there is a "Treeview control" built into ASP.NET 2.0! ...
32
2767
by: =?Utf-8?B?U2l2?= | last post by:
I have a form that I programmatically generate some check boxes and labels on. Later on when I want to draw the form with different data I want to clear the previously created items and then put some new ones on. In my code I am doing the following: For Each ctrl In tpMain.Controls If TypeOf (ctrl) Is CheckBox Then If...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.