Solved

Get the path of a dll

Posted on 2007-03-28
1
222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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