Computing.Net > Forums > Programming > VB 2005 Save File Dialog

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

VB 2005 Save File Dialog

Reply to Message Icon

Original Message
Name: astroraptor
Date: February 25, 2006 at 08:18:56 Pacific
Subject: VB 2005 Save File Dialog
OS: Windows 2000 Pro
CPU/Ram: 1.6GHz/512Mb
Comment:

Wow, I got Visual Basic 2005 Express Edition and let me tell you, it's NOT at ALL like VB 6.0. It's really ridiculously over-complicated. Or maybe I'm just not doing things right. I don't know. Anyway, all I want is to be able to go to save file dialog box and use the result as a variable to be then used for a FileCopy. MSDN and the help only give ridiculously complex examples which I really could not grasp. Please skip the "maybe you shouldn't be programming" bit, I have done it before with VB 6.0 but it wasn't this complicated. Thanks.


Report Offensive Message For Removal


Response Number 1
Name: SN
Date: February 25, 2006 at 21:59:44 Pacific
Reply: (edit)

"it's NOT at ALL like VB 6.0."
You've got that right. VB has gone through puberty...

"It's really ridiculously over-complicated."
More complicated than VB6? yes. Over-complicated? No. Just like most things in computers, power and flexibility comes with the price of usability.

VB.NET is really a different animal completely than VB6 - it has much more in common with C# than it does with previous versions of VB. The good news is that VB6 has grown up, and if you're willing to spend some time to learn the .NET framework, you'll be using a top-notch language, and no longer vulnerable to taunts by Java and C# programmers.

Anyway, to answer your question...I don't know how simple this was in VB6, but it's still pretty simple in VB.NET 2005:

'assuming you already have the source
'filename in a variable named sourceFilename
Dim fs as SaveFileDialog = New SaveFileDialog()
fs.ShowDialog()
Dim destFilename as String = fs.Filename
System.IO.File.Copy(sourceFilename, destFilename)

Good luck,
-SN


Report Offensive Follow Up For Removal

Response Number 2
Name: astroraptor
Date: February 26, 2006 at 06:01:25 Pacific
Reply: (edit)

Yeah, I figured it was closer to C than VB now. I guess it pleases the masses more having a programming language that seems like a programming language. I know it's not overly-complicated. I just took a semester of VB 6.0 in high school 4 years ago and seeing VB 2005 was like "Whoa, what the hell is this!?". Thanks for the reply, I'll give that code a whirl. :)


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software