Click here to Skip to main content
12,353,329 members (70,387 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0
how to save a newly created file..automatically with the default names, when the user close that file with out saving ...if the name is already exists then it create a new name.. how it possible in c# ?...
Posted 2-Jan-13 17:47pm
Comments
   
Why?!
—SA
Member 9721264 3-Jan-13 0:08am
   
thank you sir...i'm working with "dwg" files.. i'm providing option to view the current dwg according the user entered details...as a developer ..i want to check what type of the reviews like what type of output he/she needs.. by comparing all the dwg created by user details..it help to improve my program..
   
It only justifies my advice you can find in Solution 1.
—SA
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

This is not a good idea. If a user does not save a file but is about to loose some results of work, changes, you should detect this situation and warn the user, for example: "You changes are not saved. Do you really want to close this window?" or something like that. If the user cancels operation, nothing changes; it the user conform loosing the changes, they should be lost. Same thing about saving a file replacing existing file. The appropriate warning is the standard feature of the save file dialog; please look properly.

Don't frustrate the users by something they won't expect, keep sanity.

—SA
  Permalink  
v2
Comments
Christian Graus 3-Jan-13 0:15am
   
Good point, I assumed he would do that ( as I said in my reply ). I didn't even consider that he would just do it.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You don't say what you're using ( winforms, etc ), but most frameworks have an event for a form closing, which you can handle and prompt to save
  Permalink  
Comments
Member 9721264 3-Jan-13 0:11am
   
i'm using c# windows application..creating dwg files..i want to access save the files with c#
Christian Graus 3-Jan-13 0:12am
   
That does not answer my question ( winforms or WPF ), but my answer is still correct

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160621.1 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100