///获取相对路径

///例如:System.Windows.Forms.Application.StartupPath = "E:\App\CheckingMachine\QueryMachine\bin\Debug"

/// 经过以下处理将返回"E:\App\CheckingMachine\QueryMachine\images\1.gif"

 

string path=System.Windows.Forms.Application.StartupPath + @"../../"
System.IO.Directory.SetCurrentDirectory(path); 

string strFilePath = System.IO.Directory.GetCurrentDirectory() + @"\images\1.gif";
 

相关文章:

  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2022-01-01
猜你喜欢
  • 2021-08-07
  • 2021-08-24
  • 2021-10-19
  • 2021-12-07
  • 2022-12-23
相关资源
相似解决方案