I have programatically created a test.txt file in the LocalApplicationData folder on the computer.

Now I test if I can find that file with the below code and it works.
The file do exist.

What I have found is that the file should be in this directory ?
LocalApplicationData
C:\Documents and Settings\Charlie\Local Settings\Application Data

However I cant find this directory on my computer. I have no "Local Settings" (I use XP professional)

If I Search for test.txt on C:\ with the Search function in the Startmenu, this search cant find test.txt either ?

But the code below can anyway, so the file do exist in some way wich is good but I cant find it manually.

String^ Path = System::Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData) + "\\" + "test.txt";

	 if( System::IO::File::Exists(Path) ) //Exists ?
	 {
		 MessageBox::Show("File exist");
	 }

Recommended Answers

All 4 Replies

You perhaps should enable the "View Hidden files" option from the folder option of the windows explorer.

Thank you, that worked well.

I have 2 additional questions when knowing this.

1.
I am creating this file when installing a program that I have made on the computer.
The file will be needed in order to make the program work properly.
Is it a good idéa to create the file in this folder or can this folder be "locked" at some computers (for commercial purpose and users in mind)

2.
When creating test.txt in this folder. Is it possible to make it completely hidden wich meens that it wont be possible to find the file even that you show hidden files ?

thanks...

You perhaps should enable the "View Hidden files" option from the folder option of the windows explorer.

Both of your questions (even the former one) are related to the OS rather than C++.
I am not a windows user (I use Linux). Then too, from what I know, I can tell you that:
Problem 1.Most of windows developers store the application data in C:\Documents and Setings\Application Data\your_application_folder Problem 2. I am afraid you cannot. But you sure can use a binary file instead and encrypt it using some sought of complex algorithm.

Thank you.. I will try to see what I can do.
I will have the encryption in mind also..

Thank you for the tips !

Both of your questions (even the former one) are related to the OS rather than C++.
I am not a windows user (I use Linux). Then too, from what I know, I can tell you that:
Problem 1.Most of windows developers store the application data in C:\Documents and Setings\Application Data\your_application_folder Problem 2. I am afraid you cannot. But you sure can use a binary file instead and encrypt it using some sought of complex algorithm.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.