Solved

Specify installation directory.

Posted on 2009-05-06
3
155 Views
Last Modified: 2013-11-26
Hi Experts,

I was wondering how to tell a program to look in the installation directory for a file.

Glass.WriteXmlSchema("INSTALLATION PATH"\DemoSchema.xsd")

Thanks, Stan
0
Comment
Question by:StanT
  • 2
3 Comments
 
LVL 15

Expert Comment

by:oobayly
Comment Utility
Use the Assembly information & the Directory Info
Imports System.IO

Imports System.Reflection
 

Public Sub Foo()

  Dim executingPath As DirectoryInfo = New FileInfo(Assembly.GetEntryAssembly().Location).Directory

  Dim schemaName As String = "DemoSchema.xsd"

  Dim schemaPath As String = executingPath & "\" & schemaName

End Sub

sibg

Open in new window

0
 
LVL 15

Accepted Solution

by:
oobayly earned 125 total points
Comment Utility
Sorry, should have used the FullName property. The previous code compiles but I don't like implicit casts.
Imports System.IO

Imports System.Reflection

 

Public Sub Foo()

  Dim executingPath As DirectoryInfo = New FileInfo(Assembly.GetEntryAssembly().Location).Directory

  Dim schemaName As String = "DemoSchema.xsd"

  Dim schemaPath As String = executingPath.FullName & "\" & schemaName

End Sub

Open in new window

0
 
LVL 4

Author Comment

by:StanT
Comment Utility
Thanks, that worked....although I ended up going with a different route. I placed all my files on a server share. That way I don't have to recompile everytime i needed to change a form.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to ToolkitScriptManager 2 26
Paging GridView 7 32
Setting runtime form location 4 18
Make a border less form movable 2 10
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

9 Experts available now in Live!

Get 1:1 Help Now