Solved

Get the path of a dll

Posted on 2007-03-28
1
186 Views
Last Modified: 2011-10-03
Hi you experts.
I want to be able to get the path of a dll. Let me explain the senario.
I have developed a windows application in order to test the dll. The dll must load some parameters from an xml file that is in the same folder. All i want is to get the path that the dll exists so i can load the xml file.

Any ideas of how can i do that?

Thank you all in advance
0
Comment
Question by:adktd
1 Comment
 
LVL 18

Accepted Solution

by:
DarrenD earned 50 total points
ID: 18806661
Here is one way,

Imports System.Xml

Dim oXMLDOMDoc As New XmlDocument
Dim sURIPath, sAbsolutePath As String
Dim uu As Uri

sURIPath = System.Reflection.Assembly.GetExecutingAssembly().CodeBase
uu = New Uri(sURIPath)

' Get the local path from the URIPath.
sAbsolutePath = uu.LocalPath

'Open XML Configuration File and load it into the XMLDocument object.
oXMLDOMDoc.Load(sAbsolutePath & ".Config")

Cheers,

Darren
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now