Solved

Get the path of a dll

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET 2008 Winforms Signing 13 32
Create a datatable in vb.net dynamically 1 22
How to limit User Input 2 27
how to hit button in form and close application from main() 4 22
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 …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 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