May 12, 200719 yr I was toying in VB.net - in the program I am making, at the form load event, I ask for the user to enter a password. If they try more then 3 times, it will exit on them. private sub load() end sub if I replace the me.close with an end, I avoid this problem... but it'd still be nice to know whats causing it for future reference. Any clue? EDIT: Never mind, working now, had to nest the If statements. More importantly though - can anyone explain to me how I could enable the user to click a button and have a file open... for instance if they click "open text.txt" it will open the file named text.txt in the containing folders directory?? ...
May 22, 200719 yr Do you want that file to open ONLY text.txt? Or are you looking to browse for files? I would assume that it uses the order it searches for files, as long as you don't hard code the file path, would be the pwd, any defined bins, and then the system bins. The refuge that you built to flee that places that you've come to fear the most ... is the place that you have come to fear the most.Operator - http://www.heartunit.orgCouncil - http://z8.invisionfree.com/skillazModerator - http://forum.meebo.com
May 22, 200719 yr Author Do you want that file to open ONLY text.txt? Or are you looking to browse for files? I would assume that it uses the order it searches for files, as long as you don't hard code the file path, would be the pwd, any defined bins, and then the system bins. just the text.txt which would be in the bin folder. edit - duh, nvm I'm stupid, after writing that I realized what I needed to do. ...
May 22, 200719 yr wait... the text file is in the bin folder?? by bin directories i mean such folders as: C:\windows C:\windows\system32 I should have been more specific by calling it the PATH directories etc... The pwd (present working directory) is whereever your script runs from. So say you have your script in c:\scripts\textbuttontester if you have a c:\scripts\textbuttontester\text.txt it will load that. if you don't have that one, it will look for C:\windows\system32\text.txt if you don't have that one, it will look for C:\windows\text.txt if you don't have that one, it will look for C:\windows\system32\wbem\text.txt if you don't have that one, it should say file not found. That might be a little different, depending on if you have a different PATH variable than normal, but you get the idea. edit - awesome - i'll be here if you need more help. The refuge that you built to flee that places that you've come to fear the most ... is the place that you have come to fear the most.Operator - http://www.heartunit.orgCouncil - http://z8.invisionfree.com/skillazModerator - http://forum.meebo.com
May 22, 200719 yr Author Well here let me explain further - basically within the program I want one of the menu bar items to allow somone to click "about" and it will bring up the readme file. Rather than open notepad / wordpad, I used the system.io and assigned it to a msgbox - when I compile it, it works fine... but thats only because I know the exact directory it is in on my computer (its in D:\projects) now obviously people are more then likely going to toss the program on their desktop located in on the C drive... so how do I make sure that it always points to the correct spot? v.v ...
May 22, 200719 yr If the contents of the file are simply text, and aren't going to change, why not simply hardcode the text into your app? The refuge that you built to flee that places that you've come to fear the most ... is the place that you have come to fear the most.Operator - http://www.heartunit.orgCouncil - http://z8.invisionfree.com/skillazModerator - http://forum.meebo.com
May 22, 200719 yr Author If the contents of the file are simply text, and aren't going to change, why not simply hardcode the text into your app? BLAH, because thats not cooooool. I want to do this as an experiment - obviously I COULD do that, but I dun wanna -.- ...
May 22, 200719 yr try pointing it ti "./text.txt" instead of hardcoding it. That's dot slash text dot txt. . = present working directory (on unix at least, i don't know it is it the same on dos systems) The refuge that you built to flee that places that you've come to fear the most ... is the place that you have come to fear the most.Operator - http://www.heartunit.orgCouncil - http://z8.invisionfree.com/skillazModerator - http://forum.meebo.com
Create an account or sign in to comment