Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8778053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:25:56+00:00 2026-06-13T19:25:56+00:00

I am creating a WPF/C# app that deletes files and creates new ones before

  • 0

I am creating a WPF/C# app that deletes files and creates new ones before closing (from online data). The problem comes when the app randomly crashes before the new file creation process is complete or even starts.

Is there a way of file recovery (to be done within the app not just undelete apps etc) that I can use in my code so when the app crashes the file that was deleted cannot be lost?

To be more accurate I delete the 4 files at the start of the app and create new ones at the end of the app. But if the app crashes in the middle the files are lost.

How can I prevent this issue?

I tried to reduce the probability of random crashing but once in a while it still happens.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:25:57+00:00Added an answer on June 13, 2026 at 7:25 pm

    If you’re warry about lost of the file(s), you can:

    • before deleting of A.txt (say) on startup create it’s copy A.tmp and after delete.
    • on close, create new files and delete all tmp file(s) present in directory.

    In this way, if something went wrong during program run, when program starts again, it will find tmp last created, so can reconstruct information (if need) from them and continue program cycle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a WPF app that needs to allow users to work in
I'm pondering creating a WPF or Silverlight app that acts just like a terminal
I am creating a WPF app with a list box that I am binding
I am creating a new WPF window that I want to be parented to
I'm creating a wpf app that can be controlled by a remote control or
I am creating a WPF app using MVVM. The app manages tagged documents, called
I'm creating a WPF app using the MVVM design pattern, and I'm trying to
I have begun creating a wpf mvvm app. It seems a vital ingredient to
I am creating my first WPF metro app. I am trying to extend the
Using the MVVM pattern creating WPF applications you have the ViewModel providing data to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.