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

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?
C# model to Javascript object- using knockout.js
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

Categories

HOME
magento-1.9.2.1
azure-resource-manager
lithium
ubuntu-14.04
opc-ua
artifactory
google-docs-api
sdk
richtextbox
scapy
runtime
browsermob
owncloud
template10
windows-phone
android-actionbar
sonarlint
datasource
xna
angular2-pipe
beaker-notebook
advertising
bootstrap-accordion
pixels
inspec
adobe-captivate
smart-device
gulp-jshint
checkmarx
units-of-measurement
osgi-bundle
recreate
deferred
jmsserializerbundle
opencsv
ios-autolayout
snapkit
openvms
webmock
mootools
asp.net-webhooks
anypoint-studio
mongoid5
iterm2
blueimp
google-cloud-powershell
python-venv
mef
google-chrome-storage
text-formatting
rivets.js
serialversionuid
multivalue
visio-2010
gige-sdk
node.js-client
timex
catalyst
turbolinks
django-taggit
radar-chart
web-optimization
nslocalizedstring
webservices-client
tess4j
tooltwist
polarion
vensim
httpmodule
douglas-peucker
sony-xperia
optimistic-locking
grunt-contrib-connect
react-os
api-eveonline
tigase
powershell-v1.0
debuggervisualizer
rda
new-operator
fastcgi-mono-server
db2-connect
facebook-likebox
grunt-wiredep
aspnet-compiler
infomaker
source-depot
uikit-dynamics
derived-class
android-memory
google-email-audit-api
github-archive
systrace
scriptmanager
cgaffinetransform
peoplepicker
javah
chromebug
linq-to-mysql
carbon-emacs
zend-acl
bootstrap-protocol
managed-code

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