EpLibrary.cs.FolderHelper.GetModuleFileName C# (CSharp) Method

GetModuleFileName() public static method

Return the full path with file name for the current executable file
public static GetModuleFileName ( ) : String
return String
        public static String GetModuleFileName()
        {
            //StringBuilder exePath = new StringBuilder(FolderHelper.MAX_PATH);
            //int exePathLen = GetModuleFileName((IntPtr)0, exePath, exePath.Capacity);
            //return exePath.ToString();
            return System.Windows.Forms.Application.ExecutablePath;
        }
        

Same methods

FolderHelper::GetModuleFileName ( IntPtr hModule, StringBuilder lpFilename, int nSize ) : int

Usage Example

Example #1
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 public LogWriter(string logFilename = null)
 {
     if (logFilename == null)
     {
         m_fileName = FolderHelper.GetModuleFileName();
         m_fileName = m_fileName.Replace(".EXE", ".log");
         m_fileName = m_fileName.Replace(".exe", ".log");
     }
     else
     {
         m_fileName = logFilename;
     }
 }
All Usage Examples Of EpLibrary.cs.FolderHelper::GetModuleFileName