Finding physical path in C# .net
#"F:\LEAFPRODUCT\Bin\Service.exe" This is the physical path of Service.exe, let me know is there any other alternate way or any general way to find the physical path of WrmService.exe in window application. In a web application we can use Server.MapPath like that. Here I need to reduce path means label1.Text = AssemblyName.GetAssemblyName(#"F:\LEAFPRODUCT\Bin\Service.exe").Version.ToString(); This is my coding I need to reduce the physical path here, means I don't want to put all the folders I need this way only label1.Text = AssemblyName.GetAssemblyName("WrmService.exe").Version.ToString(); means only the required file name here means WrmService.exe
System.IO.Path.GetFullPath() is similar as Server.MapPath() You can give it a relative location, and it will give you the full location based on the directory that the assembly is in.
Are you looking for something like this? C#: How do I get the path of the assembly the code is in?
You want the physical path of the executable assembly? System.Reflection.Assembly.GetEntryAssembly().Location
How to use XmlInclude to serialize IEnumerable
Remove some characters from an string
The type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.ApplicationClass' has no constructors defined
Formatting a number with a metric prefix? [duplicate]
Is it really a bug in JIT optimization or am I missing something?
How to create an icon that can be dragged to explorer or skype to save/send a file?
Postback after clicking a button does not react not for the first time in a UserControl
How to add new list item with Image in custom list through sharepoint web service?
Allowing null in int text box with non nullable int
Nested switch? Or other solution checking different conditions?
Get JSESSIONID from HttpWebResponse in C# desktop application
Crystal Reports only printing one page with data C# VIsual Studio 2010
Excel services cannot open workbook
Error converting data type varchar to datetime
Class member of Interface and base class