Desktop Functions: Smart Device Functions:
|
GetModuleFileName (kernel32)
C# Signature:
[DllImport("kernel32.dll", SetLastError=true)] VB.Net Signature:
<DllImport("kernel32.dll", SetLastError:=True)> <PreserveSig()> _ User-Defined Types:None. Notes:None. Tips & Tricks:If you want to use GetModuleFilename to retrieve the path the current executable was started from, you should instead consider using System.Windows.Forms.Application.StartupPath. This is a wrapper around GetModuleFilename, so it probably does exactly what you want. Another way: Process.GetCurrentProcess().MainModule.FileName If you want to use GetModuleFilename to retrieve the path the current executable was started from, you should instead consider using System.Windows.Forms.Application.StartupPath. This is a wrapper around GetModuleFilename, so it probably does exactly what you want. Sample Code:
using System; Alternative Managed API:System.Diagnostics.ProcessModule.FileName or System.Reflection.Module.FullyQualifiedName. Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|