You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
898 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Shentun.Utilities
  5. {
  6. public class DirectoryHelper
  7. {
  8. /// <summary>
  9. /// 返回应用程序路径,比如c:\prog
  10. /// </summary>
  11. /// <returns></returns>
  12. public static string GetAppDirectory()
  13. {
  14. string str = System.AppDomain.CurrentDomain.BaseDirectory;
  15. str = str.Substring(0, str.Length - 1);
  16. return str;
  17. }
  18. /// <summary>
  19. /// 获取应用程序目录中文件的完整文件名,比如c:\prog\app.ini
  20. /// </summary>
  21. /// <param name="fileName"></param>
  22. /// <returns></returns>
  23. public static string GetAppDirectoryFullFileName(string fileName)
  24. {
  25. string str = System.AppDomain.CurrentDomain.BaseDirectory + fileName;
  26. return str;
  27. }
  28. }
  29. }