Creating folder structure

Viktor

Member
Joined
Feb 7, 2007
Messages
8
Programming Experience
Beginner
Hi people,

I want to make a simple form which should do the following:

1. Have an import button
2. Have a simple browse button
3. When I click the import button (after a file is selected) the file is assigned a simple incremental number (the first file I choose would be 0001, the second 0002 and so on) but the filename would stay the same
4. The form should create a directory named 0001 in some default location
5. Put the selected file in the newly created directory

The result should look something like:
d:/main/000X

Is this very complicated procedure or a newbie could understand it?

Thanks,
Viktor
 
I asked this same question a while back, but unfortunately I didn't get any answers. I'll try to explain it a bit more this time, and hopefully somebody will find the time to answer it.
My goal is to create a folder structure that will keep different files that I'd "import" in the application. I also have a database on SQL2000 and one of the tables is "Docs" (dcID, dcName, dcChars, dcTrans....).

When I get a file, through a form (very standard bound form) I enter the details about the file in the table.
In the very next step, I'd like to make a button that
1) Will get the dcID value (which is integer and which I'm able to do)
2) Create a folder which name will be the previous integer value on a location d:\docs\
3) Ideally, i'd have a browse button where I could select a file(s) which will be then saved to the created location (which will be d:\docs\0001\ for the first file)

Any solutions for this or maybe another idea how to do this?

Thanks,
Viktor
 
this is simple, use the System.IO.Directory and System.IO.File namespaces for the actual directory creating loop and then the file.copy method for copying the file (and renaming) to the newly created dir
 
I asked this same question a while back, but unfortunately I didn't get any answers. I'll try to explain it a bit more this time, and hopefully somebody will find the time to answer it.

You mean, do it for you? How far have you already got?
 
You mean, do it for you? How far have you already got?


Hey, I actually did it, although it is quite a mess when I look at it - but it works. I'll post it later in the day so somebody can use it or improve it :)

So proud of me :)

VIktor
 
Back
Top