winform下面使用了
AppDomain.CurrentDomain.BaseDirectory這個路徑,但是如果winform以管理員身份運行之後。它指向的位置就是系統盤了。
C:\Users\%SystemUser%\AppData\Local\Temp\ 大約是這樣。
如果還要找到當前運行的路徑
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)應該使用這個。