Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1.         /// <summary>
  2.         /// Absolute path of the application's executable.
  3.         /// </summary>
  4.         private string ExecPath
  5.         {
  6.             get
  7.             {
  8.                 if (_execPath == null)
  9.                 {
  10.                     // Get the config file
  11.                     string path = Context.Parameters["targetdir"];
  12.                     string[] files = Directory.GetFiles(path, "*config", SearchOption.TopDirectoryOnly);
  13.                     if (files.Length == 1)
  14.                     {
  15.                         // Get the name of the exe file
  16.                         _execPath = files[0].Substring(0, files[0].Length - 7);
  17.                     }
  18.                     _execPath = string.Empty;
  19.                 }
  20.                 return _execPath;
  21.             }
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement