473,625 Members | 2,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use saveFileDialog

ad
Hi,
I want to use saveFileDialog to save a file (like c:\aa.zip) to another
place.
How can I assgin c:\aa.zip to saveFileDialog
Aug 16 '06 #1
2 20499
The saveFileDialog returns a handle to the file being saved.

--
_______________ _________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------
"ad" <fl****@wfes.tc c.edu.twwrote in message
news:O2******** ******@TK2MSFTN GP06.phx.gbl...
Hi,
I want to use saveFileDialog to save a file (like c:\aa.zip) to another
place.
How can I assgin c:\aa.zip to saveFileDialog

Aug 16 '06 #2
Here is an example of some code we use to save some app files in xml format.
We only pull up and use xml to filter out any other files in the directory.

private void saveTPButton_Li nkClicked(objec t sender,
LinkLabelLinkCl ickedEventArgs e)
{
SaveFileDialog savDialog = new SaveFileDialog( );
savDialog.Filte r = "Test Point Files(*.xml)\"| *.xml";
savDialog.AddEx tension = true;
DialogResult result;
result =savDialog.Show Dialog();
string savFile = savDialog.FileN ame;

if (result == DialogResult.OK )
{
FlightDataManag er.FlightDataMa nagerClass.test PointPanelDataS et.Write
Xml(savFile);
}
}

The user can navigate to any directory before they click Save, or you could
assign a directory in the savFile variable before doing the actual save.

HTH

WhiteWizard
aka Gandalf
MCSD.NET, MCAD, MCT
"ad" wrote:
Hi,
I want to use saveFileDialog to save a file (like c:\aa.zip) to another
place.
How can I assgin c:\aa.zip to saveFileDialog
Aug 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3444
by: Michael A. Covington | last post by:
I've just determined, by experimenting, that regardless of its Filter and DefaultExt properties, a SaveFileDialog will let you save the file with *any* registered extension. For instance, if you specify a SaveFileDialog with the attributes: AddExtension = true Filter = "Foo files|*.foo" DefaultExt = "foo"
6
19278
by: Ken Allen | last post by:
I have enocuntered something wierd. If I invoke an instance of the above dialog and elect to save the file in a directory where a file of that name does not exist, then the return is DialogResult.OK, but if I elect to save the file on top of a file with the same name in the same directory, when I press the Save button I get a "do you want to overwrite" dialog -- even if I press OK the SaveFileDialog returns DialogResult.Cancel! How...
2
1636
by: Yoshi | last post by:
Hi Everyone! I am using the SaveFileDialog class. I want the user to specify the "SaveAs" filename so I can use that name when creating a text document. Here is my question below. When the SaveFileDialog is displayed, how do you get it to show all the files that have the ".txt" extension? It's only showing me the folders. Thanks,
2
1880
by: Dennis C. Drumm | last post by:
Is there a way for the parent that calls the SaveFileDialog.ShowDialog to consume events associated with this dialog such as LocationChanged, Moved and Closed events? I had been working on a way to customize the SaveFileDialog and on second thought think it might be better to attach a FixedToolWindow dialog to the bottom that contains the two text box controls I need for user input. Thanks,
5
2807
by: juli | last post by:
Hello dear fellows! Is there any chance that you know how can I upload a file with the saveFileDialog control to a specific folder-> I want any file uploaded to be save on specific folder with specific name. Do you know how? Thank you very much!
3
3122
by: josh | last post by:
How do I make it actually save or open a file? It only opens the dialogs. What do I type to get it to save? Here's what I have so far: Public Class frmMainApp Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code "
17
8018
by: Peter Duniho | last post by:
I searched using Google, on the web and in the newsgroups, and found nothing on this topic. Hopefully that means I just don't understand what I'm supposed to be doing here. :) The problem: I am trying to use the SaveFileDialog class to get a filename, which is subsequently opened for writing (write access, read sharing, but using read/write sharing doesn't make the problem go away anyway). Sometimes, on the statement where I...
3
2661
by: =?Utf-8?B?UmljaA==?= | last post by:
I want to create a class library project (dll) for use with a com app. The idea is to use .Net objects in com. I also want to include a SaveFileDialog in the class library. Is it possible to include a SaveFileDialog object in my library project without having to include a form in the project? how to do this? Thanks, Rich
8
11596
by: Joe Duchtel | last post by:
Hello - I have the following code to detemine a file name when my application is saving a file. The problem is that if the file already exists and I select the Yes button in the "Do you want to replace" dialog, the DialogResult is Cancel instead of OK. Is there something I am missing? Dim lSaveFileDialog As New SaveFileDialog
0
8251
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8688
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8352
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7178
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6115
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2614
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 we have to send another system
2
1496
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.