c#


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

Related Links

Why Visual Studio settings are all serialized as String?
ASP.NET MVC: all controller values are passed null
WPF: ListView inside Grouped TreeView not working
Assigning a random permutation to some object which satisfy some conditions
Web api Authorization filter not firing
fileStream.WriteByte c# can't write in directory. It's need admin permission [duplicate]
A DependencyProperty of Type ObservableCollection<T> set in XAML contains more items than there are declared. c#
V8Context not created when passing “about:blank” to ChromiumWebBrowser's constructor
Comparing game objects Augmented reality game, Unity, Vuforia, C#
How to display image from 2D integer array in Winforms application
Allow PDFium to support x86 and x64
how to show only time from datetime databse data in aspx page?
Remove need for xsi:type from xml?
ERR_CONNECTION_REFUSED - .Net Core 1.0.1
Lost information between scenes
Visual Studio 2017 Application Manifest

Categories

HOME
botframework
mobile
weblogic
redhawksdr
ubuntu-14.04
ms-application-insights
docker-compose
clip-path
ionic-native
mongoimport
adroitlogic
comma
background-image
inline-assembly
prepros
ppp
ckeditor4.x
scalatest
spring-data-gemfire
ocl
ng2-bootstrap
unity3d-5
sdl-2
android-databinding
mockserver
pyexcel
ape-phylo
text-extraction
ack
runner
runtime-permissions
gige-sdk
photoshop-script
aws-rds
boost-regex
overhead
codesniffer
wicketstuff
apache-commons-cli
esprima
qt3d
alarmmanager
cosign-api
magick.net
chomsky-normal-form
stdlist
producer-consumer
edgar
self-join
updating
identifying
properties-file
eaaccessory
xml-simple
nmock
euro
log-analysis
parseexception
pymol
dockerpy
quickfixn
cordova-3
kss
grunt-contrib-connect
nsnotificationcenter
yandex-api
webshim
nodeunit
imaplib
nop
misfire-instruction
cab
ironworker
wpa
usersettings
backbone-views
string-length
setcookie
tasklist
hypertable
flatten
jqueryi-ui-buttonset
visual-leak-detector
vectorwise
focus-stealing
time-management
jettison
office-2003

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App