- #1
CodeMonkey
- 11
- 0
Hi all, I've had great time here with some very helpful answer. Thank you all.
Now my question. I am making a program which takes input from a text file and does somethings with it. Now the directory that text file is on my computer is "C:\input.txt".
but sometimes I want to transport my program and the input.txt file using a thumbdrive or simply transfer it to another computer. When I do I notice the address which I assign the file to be in my C# program (eg.Filestream( @"C:\input.txt", ... , ...) ) is set to C:\.. and since the text file is not there in another computer I am using, my program does not execute.
Is there a way to write the address so that it changes as I move my text file or have the program find the needed text file without it having it to be the "exact" directory?
Thanks.
Now my question. I am making a program which takes input from a text file and does somethings with it. Now the directory that text file is on my computer is "C:\input.txt".
but sometimes I want to transport my program and the input.txt file using a thumbdrive or simply transfer it to another computer. When I do I notice the address which I assign the file to be in my C# program (eg.Filestream( @"C:\input.txt", ... , ...) ) is set to C:\.. and since the text file is not there in another computer I am using, my program does not execute.
Is there a way to write the address so that it changes as I move my text file or have the program find the needed text file without it having it to be the "exact" directory?
Thanks.