|
Damn - you're right.
This C# code:
Directory.CreateDirectory(@"\\warlock\c$\1.0");
string [] files = Directory.GetFiles(@"c:\1.0");
foreach(string file in files)
{
File.Copy(file, Path.Combine( @"\\warlock\C$\1.0", Path.GetFileName(file)));
}
Directory.Delete(@"c:\1.0");
worked fine to move a directory to another computer, so I'm sure it will do what you want.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks Christian,
This is again moving files across the volumes.
I guess microsoft dosen't provide function for moving directories across volumes.
|
|
|
|
|
Tha'ts because it's physically impossible to "move" files to different volumes.
You move "move" directories/files inside the same volume because all that is required is manipulating directory entry pointers so that the files appear under the new directory. No file data is ever "moved" or "copied" to make this happen. This, obviously, can't be done acrossed volumes.
So, in order to "move" files/directories to another volume, the source files/directories must be copied to the destination, then removed from the source.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave, another reason can be that moving directories across volumes can result in freeing up permissions on the directory and there can be a possiability that user might be moving the directory from a fat to ntfs and vice versa
|
|
|
|
|
Can i read the length of the directory.
What i want is to increment the progressbar during thr directory.move.
If i can read the bytes that are moved , then accordingly i can increment the progress bar.
Directory is about 150mb
or
Is there a way of incrementing the progressbar during the move process.
|
|
|
|
|
It all depends on what your using to do the move. If you use Directory.Move to move an entire batch of files all at once, you don't get any information back on status, and therefore, nothing usable to update a ProgressBar.
If you want to use a progressbar, you'll have to write the code to "move" the files yourself, one at a time. You'll also have to supply the methods for reporting status and progress.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
nitin_ion wrote:
This is again moving files across the volumes.
Yes, it is. And it works. What's the problem ? To 'move' the files, the code I provided created a directory on another machine, copied the files over and deleted them. It *works*, I tested it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It's no problem if the directory contains no other directory, but if it contains multiple directories then it would be a problem.
|
|
|
|
|
That's why recursion is your friend.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
I currently use VB6 and have been toying with the idea of switching to .NET
I have heard the .NET was all together a better program than VB6 from some but from others I heard that it was complete rubbish and are happy they went back to VB6.
Just trying to get some opinions of fellow VB6/.NET users
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
Code is a beautiful thing
Theres nothing like the feeling you get when you create your first program.No matter how basic
MS DOS it all
<marquee>
PC Chips M811LU mobo, AMD Duron 1.8GHz processor,WINTEC AMPO 1GB RAM,20 GB Maxtor & 80 GB EXCELSTOR hard drives,ATADC POWERKING 400W,LITE-ON DVD-ROM PSU,
|
|
|
|
|
tekfall wrote:
I have heard the .NET was all together a better program than VB6 from some but from others I heard that it was complete rubbish and are happy they went back to VB6.
There are a group of (incompetent) MVPs who are pushing Microsoft to continue VB6 support.
I can only give advice from my perspective, so I'll tell you what that is first, so you know where this is coming from. I am a C++ programmer, who has migrated to C#, and I help in this board because a lot of stuff in VB.NET is the same as C# ( that is, they use the same libraries, which is what most questions are about ). I *hate* VB6, I think it's a terrible language, designed to write a small subset of all possible apps quickly and easily, for people who aren't smart enough to learn C++.
So, that's my bias. As far as I can see, VB6 filled a need in the past, and VB.NET is the step forward for people who don't want to learn C#, but want to use a better language, and one that is going to be supported in the future. It also means you can write web apps using ASP.NET. The only thing to watch out for is, VB6 supports some truly excremental things, and Microsoft tried to remove them, but were met with howls of protest from the VB comunity. So, VB.NET still lets you do a lot of htings that suck, so you should start from scratch with a good VB.NET book, and actually learn where you should use new syntax instead of what you are used to.
I think that VB6 -> VB.NET -> C# is an admirable path for anyone to pursue ( and I can live with you skipping the C# step ). Anyone who sticks to VB6 is plainly incompetent - a real programmer is capable of continuing to learn, and of using more than one language. I'm sure there were plenty of C programmers who hated C++, but which offers more work today, and which is more widely used. There is still a place for C though, I doubt that will be the case for VB, it has no support outside of Microsoft, and Microsoft are wisely in the process of dumping it for VB.NET. The inside word is that Microsoft have long term plans for VB.NET ( I wish they did not, but the truth is that they do ).
Learn VB.NET - it can't hurt you, even if you decide to use VB6. Like I said, a real programmer will change languages from time to time, because a better tool will become available. I still use C++, but I use C# most of the time, because it's easier, and because it supports stuff I need to do.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
a group of (incompetent) MVPs
Christian Graus wrote:
Anyone who sticks to VB6 is plainly incompetent
What will you do when you're in a team, and every body only knows VB6? You have to use it, whether you like it or not.
<italic>Work hard, Work effectively.
|
|
|
|
|
Yulianto. wrote:
What will you do when you're in a team, and every body only knows VB6? You have to use it, whether you like it or not.
If the team as a whole does not want to move to VB.NET, then a change of job would be necessary to save your career. But if you were in that situation, you'd hopefully already have identified that you were in a team of losers.
Note - I say this not just because I hate VB6 ( although I do ), but because any induhvidual OR team that is determined to keep using the same technology until the end of time has a built in expiry date, in time, they have to fail, and they are in the wrong job. Simple as that. I'd say the same about anyone who goes for web based work on the basis of using ASP, for the same reasons. I wouldn't say it about people who go after fat client app work in MFC, necessarily, because C++ still does some stuff better. But I'd suspect the possibility, because C# makes writing a lot of common app types easier, without the ball and chain that VB6 was when it made the same claims.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yulianto. wrote:
What will you do when you're in a team, and every body only knows VB6?
Uhhh, point and laugh?
If they can't learn the new technology and don't want to follow the direction the rest of the world is following, then I don't need to be on that team! Why would I want to stagnate myself, stalled in the VB6 world indefinately?
Sorry, but I started to migrate myself from VB6 to .NET the minute I installed the first Beta of Visual Studio .NET 2002...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
Uhhh, point and laugh?
Dave, this could truly be a moment in history. I believe that you've been more derisive than me on the same thread :P I've sure tried to answer in a way that's helpful and expose my bias.
Dave Kreskowiak wrote:
Sorry, but I started to migrate myself from VB6 to .NET the minute I installed the first Beta of Visual Studio .NET 2002...
That's why you're a programmer, and the people lobbying Microsoft for continued VB6 support will never be.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I still, to this day, can't understand why that petition was started by/signed by a bunch of MVP's!!! This boggles the mind!!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yeah, it's got me beat as well. Although, an MVP is someone with expertise in one area, and who is willing to share it. There's no reason why someone who knows VB6 well and likes to help people is guarenteed to also be willing to learn something new.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote:
There's no reason why someone who knows VB6 well and likes to help people is guarenteed to also be willing to learn something new.
That is soooooooo true!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Go with VB.NET
I went from C++ --> C --> Java --> VB6 --> VB.NET and C#
I kept jumpping around till about VB6. In VB6 I was able to make quick and simple apps with a GUI. The minute I tried VB.NET I pretty much forgot everything about VB6 and have never looked back. The new .NET languages just make it so much easier to create a user interface and then have more time to work on backend things like data storage, validation, and reports.
Plus, VB.NET and C# are pretty similar, so once you learn one you'll be able to understand the other
So, give it a shot and see what you think.
|
|
|
|
|
You went from C++ to C ? Why ? How did you end up with VB6, did you actually learn to use C++ with MFC ? That's one odd migration path IMO
chrismerrill wrote:
Plus, VB.NET and C# are pretty similar, so once you learn one you'll be able to understand the other
Yeah, that's mostly true, although knowing VB6 AND C++ would give you a head start in terms of the differences of syntax. I've done VB.NET work ( although I refuse to do it again ), and I found it pretty easy, except that the syntactical differences still catch me.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Well, it's cause I started learning C++ at the beginning of my senior year of high school and when I got to UCSD I had to start with C and work my way up. After some time at UCSD I just wasn't cutting it so I left for a community college and they had Java. After Java the only other computer programming class was VB6, so I did that and loved how simple it was. I could whip up a quick GUI to go with my code; stuff that would have taken forever in the other languages (at least for me since the classes and books covered concepts and the console window but not how to make your own GUI). Then VS2002 came out, I saw VB.NET and C# and said this is what I've been waiting for
So I tried a bunch of languages in about a 2.5 year period and finally decided that .NET is the way I want to go. I mainly use VB.NET because it has better intellisense support than C#; for the moment anyways. I also like C# because it has the GUI creation of VB with the coding style of C/C++.
Can't wait for VS2005 Final. Maybe if the intellisense is better for C# I'll make the final switch and just stick with C#.
It wasn't till I started learning .NET that I was finally offered a job as a programmer. It started as a normal convert our old apps to new apps but has now gone to custom control creation (fun), database interaction (ok), controlling office through com (hate it), ASP.NET (hate it, VS is always messing up my pretty html code so I have to be careful when switching between webform view and html view so that I can undo it's auto-format), gdi+ graphics rendering (lots of fun), and creating pdf files (was fun at first, but now becoming a pain since the company wants EVERYTHING to go directly to pdf and with minimal user effort, which means WAY MORE work on my part).
Hope that explains my odd migration path
|
|
|
|
|
chrismerrill wrote:
It wasn't till I started learning .NET that I was finally offered a job as a programmer.
OK, that makes sense. I thought you'd worked with those languages in that order, professionally
chrismerrill wrote:
controlling office through com (hate it),
LOL - who wouldn't ?
chrismerrill wrote:
ASP.NET (hate it, VS is always messing up my pretty html code so I have to be careful when switching between webform view and html view so that I can undo it's auto-format),
VS2005 won't mess with your HTML. In the meantime, never use the design view. I work every day in ASP.NET, have since it came out. I've never used it, for that reason.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
wow. didnt expect the responses i got, very impressed with the code project community.
Switched over to .NET today, havent had the time to play with it yet but, from what I have read, I am dying to get my tired little fingers on it
Once again, thanks for the help
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
Code is a beautiful thing
Theres nothing like the feeling you get when you create your first program.No matter how basic
MS DOS it all
<marquee>
PC Chips M811LU mobo, AMD Duron 1.8GHz processor,WINTEC AMPO 1GB RAM,20 GB Maxtor & 80 GB EXCELSTOR hard drives,ATADC POWERKING 400W,LITE-ON DVD-ROM PSU,
|
|
|
|
|
tekfall wrote:
Once again, thanks for the help
Glad to help. Remember, these forums are here for you if you get stuck.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|