Save File Dialog

3 views
Skip to first unread message

CoachBarker

unread,
Jul 9, 2007, 12:51:46 PM7/9/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Is it possible in vb.net to use the Save File Dialog to save a file
without the user seeing the dialog box itself. On one form (in an MDI)
I use the Folder Browser Dialog to select the path to the folder, and
then in another form I need to use the Selected Path along with the
File Name, Date Created and the extension to save the file.

Thanks
CoachBarker

Cerebrus

unread,
Jul 9, 2007, 11:41:59 PM7/9/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
The SaveFileDialog is just an interface to obtain the desired save
location and filename from the user. It does *not* do the actual job
of saving the file. That job is done by your code.

Since your code already has the desired location and other information
(assuming you got a filename earlier too), there is no reason at all
for you to show a SaveFileDialog. The SaveFileDialog.OpenFile() method
returns a Stream referencing the target file that you can write to,
and when you close the stream, your file is saved. That's what happens
in the background.

CoachBarker

unread,
Jul 10, 2007, 8:26:50 AM7/10/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Thanks for your reply, by the end of the day I had figured out the
problem and had the files saving to the correct folders.

> > CoachBarker- Hide quoted text -
>
> - Show quoted text -

Cerebrus

unread,
Jul 10, 2007, 12:21:39 PM7/10/07
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Sweet ! Keep up the good work ! ;-)
Reply all
Reply to author
Forward
0 new messages