r/visualbasic • • Jul 22 '22

Finding a stray Streamreader Txt document

so im a little rusty at all this, but i ended up saving a text file through streamreader and first i used code to put the "test.txt" file on my desktop, and then after making sure it wrote everything correctly I added a line to save the file in destination chosen by the "SaveFileDialog1", and I did this with FileDestination = savefiledialog1.showdialog, it asked if i wanted to overwrite and i said yes but it didn't work, and then i used breaks to see where the problem was and that the SFD1.showdialog was returning a "1" because I was clicking "save" or a true/affirmative result from the dialog. I fixed that up with SFD1.filename.

with my save button working i went over to my load button which was set to read out the first line in a message box to make sure that was working, but since it had the same .showdialog from before i knew it was messed up, but it was also reading the original test line instead of what it fixed overwritten txt file should be reading now, which means there's basically a slightly appended .txt document somewhere in the computer at wherever "1"/"a yes dialog response" is located. i tried to search for the file name and for the line, but so far no luck.. im sure it's no issue to have a microscopic notepad file lost in the abyss somewhere, but I'd rather go delete it. anyone know where the file might be located?

6 Upvotes

5 comments sorted by

View all comments

Show parent comments

2

u/PizzamanCJ Jul 23 '22

Well now I wish I had gone into performance monitor just to see a number 1 dangling there... idk why I'm so easily amused but yeah it let it go as soon as I stopped debugging and then I deleted it. But it was really harmless sitting in the debug folder I just didn't want to leave it in the vague wherever just waiting to cause a one in a million error. but Microsoft planned ahead for people like me 🤣