473,507 Members | 8,054 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 1515
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******@sbcglobal.netwrote in message
news:11*********************@v33g2000cwv.googlegro ups.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******@sbcglobal.netwrote in message
news:11*********************@v33g2000cwv.googlegro ups.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******@sbcglobal.netwrote in message
news:11**********************@q40g2000cwq.googlegr oups.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******@sbcglobal.netwrote in message
news:11*********************@v33g2000cwv.googlegr oups.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******@sbcglobal.netwrote in message
news:11**********************@q40g2000cwq.googlegr oups.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******@sbcglobal.netwrote in message
news:11*********************@v33g2000cwv.googlegro ups.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******@sbcglobal.netwrote in message
news:11**********************@s80g2000cwa.googlegr oups.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******@sbcglobal.netwrote in message
news:11**********************@q40g2000cwq.googleg roups.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******@sbcglobal.netwrote in message
news:11*********************@v33g2000cwv.googlegr oups.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
1434
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...
12
1533
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...
0
973
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...
10
2804
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...
1
1161
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....
8
1530
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...
2
2582
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...
3
1049
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)...
1
1076
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...
32
2752
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...
0
7223
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,...
0
7110
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...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
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,...
0
4702
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...
0
3191
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
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 ...
1
758
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.