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 8864349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:13:13+00:00 2026-06-14T16:13:13+00:00

I have a slightly strange problem with an application that writes database connection settings

  • 0

I have a slightly strange problem with an application that writes database connection settings into a file located int the users temp directory.

I use the standard call – GetTempPath and then save the file using this path. I build my app and deploy. 99/100 machines work – and save their files in the users temp directory, including XP and Win7 users.

However, I have noticed one user (Win 7 Pro 64bit), every time the program goes to create the connection file in the users temp path, it creates a new folder (with about 5/6 random characters) in the temp directory and saves the file in there!. This means every time the user restarts the app, the settings cannot be retrieved (because there is no capability for saving the last used random folder!), the user effectively loses their settings. So the program just keeps creating new random folders in the temp path time and time again. Bizarre!

Has anyone else had this problem, or does anyone know what might be going on here? I suspect its something to do with the OS, not my code.

  • 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-14T16:13:14+00:00Added an answer on June 14, 2026 at 4:13 pm

    Path.GetTempPath only gets the folder of the temp files. It sounds like you’re using Path.GetTempFileName.

    Its by design, the first sentence says “Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file.”. It will not return a temp files that already exist. If you want to have temporary setting its a fine function to call but remember the function will not return the same location unless it can make the file zero byte long.

    If you like to access the file again put the setting file elsewhere or use a more permanent solution (this allows you to set default values and change/save/load at runtime). If you want to be especially lazy create a guid or mash random letters on your keyboard (sdhfuisdhfusdhc) and use that as a hardcoded filename. Example: Path.GetTempPath()+"sdhfuisdhfusdhc";

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

Sidebar

Related Questions

I have slightly altered the architecture of our application, and IWindsorContainer is no longer
I have a slightly theoretical question that I want to clear up before I
I have a slightly complex problem here. I need to show to the client
I have a need for two slightly different classes, that have the same members,
I have strange problem for which I can't think of a solution. I have
I'm having a strange problem with a colour animation. I have a list of
a noob question here. I have a very strange situation that's very puzzling to
I have what appears (to me anyway) to be a strange problem... I created
We have a repository that was exported from subversion into git. This repository is
I am attempting to cycle four images that have slightly more brightness, I'm attempting

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.