简体   繁体   中英

Best Way To Reference Current/Working Directory in VB.NET

I am after the one which is most used. A number of ones I have come across are:

  • CurDir
  • Environment.CurrentDirectory()
  • AppDomain.CurrentDomain.BaseDirectory
  • Application.StartupPath (this one doesn't work for me, missing a library?)

I am using it to save a file, for argument sake, "test.txt"

I may be oversimplifying, but if you want to save something in the folder where your app is running, just omit the path.

call MyObj.SaveTo("test.txt")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM