Winform get file path

winform acquired file path (Note: The following way needs to be placed in the root directory, or acquisition failure)

// directory configuration file
         // protected String Root = System.Windows.Forms.Application.StartupPath;   // get information of the startup file, such as: E: \ C # Code \ Sharing \ Sharing \ bin \ Debug, equivalent to System.Environment.CurrentDirectory; and System.IO.Directory.GetCurrentDirectory ()
         // protected String _ExeRoot = System.Windows.Forms.Application.ExecutablePath;   // get the boot file information, such as: E: \ C # Code \ Sharing \ Sharing \ bin \ Debug \ Sharping.exe 

// get the parent class path

 

Guess you like

Origin www.cnblogs.com/namejr/p/11469702.html