Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I create a file named "Products.txt" on sdCard. When I open it first time its name is "Products[1].txt", second time the name is "Products[2].txt", third time again "Product[1].txt" and so on. I don't understand why because I don't have another file with the same name. My big problem is that I want to write in it and every time I write something it creates a new one with the same problem. Someone know why the name is changed and how to solve this problem? Thanks!

What I have tried:

I tried to add try catch blocks, but it doesn't work.
Posted
Comments
Richard MacCutchan 14-Mar-16 12:54pm    
Check your card for any hidden files. Also check your code for any duplication.
Ionascut Mihai 16-Mar-16 11:19am    
I verified my card and I haven't any hidden folder and no duplication in my code. That's why I asked this question because it is a very strange situation.
Just an exception of type 'System.Reflection.TargetInvocationException' when trying to create the file in sdCard.

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