Solved

Get the path of a dll

Posted on 2007-03-28
1
194 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 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

21 Experts available now in Live!

Get 1:1 Help Now