Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Comments
Sergey Alexandrovich Kryukov 2-Jan-13 23:53pm    
Why?!
—SA
Harikamalina 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..
Sergey Alexandrovich Kryukov 3-Jan-13 0:54am    
It only justifies my advice you can find in Solution 1.
—SA

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
 
Share this answer
 
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.
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
 
Share this answer
 
Comments
Harikamalina 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900