c# - How to run a program in the same folder? -
so i'm learning how develop software , i'm running problem. when create form in visual studio , have open document or open else when click button have pointing here:
c:\user\myname\documents\testapp\test.txt
what want know how program looks @ testapp folder vs going through c: drive? files needed program run located in testapp folder.
if know app going run same place every time (like folder) can call getcurrentdirectory() method. return string of current directory app running from.
string pwd = getcurrentdirectory(); //contains c:\users\daedric\testapp\ string finalstring = path.combine(pwd, "test.txt"); //as per corak
Comments
Post a Comment