Solved

App.Path in VB.NET?

Posted on 2003-12-11
6
1,486 Views
Last Modified: 2007-12-19
What is App.Path in VB.NET?

   - Marc
0
Comment
Question by:MarcGraff
[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
6 Comments
 
LVL 48

Accepted Solution

by:
Mikal613 earned 125 total points
ID: 9921871
System.Windows.Forms.Application.ExecutablePath
System.Windows.Forms.Application.StartupPath
System.AppDomain.CurrentDomain.BaseDirectory()
System.GetEntryAssembly().Location
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 9921876
Public Function App_Path() As String
        Return System.AppDomain.CurrentDomain.BaseDirectory()
    End Function

these are a couple ways
0
 
LVL 8

Expert Comment

by:Dranizz
ID: 9921879
System.GetEntryAssembly().Location
0
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

 
LVL 48

Expert Comment

by:Mikal613
ID: 9921885
Option Explicit
    Option Strict
    Imports System
    Imports System.IO
    Class ThisApp
          Private mAppPath As String
          Private mExeName As String
          Public ReadOnly Property AppPath() As String
                Get
                      Return mAppPath
                End Get
          End Property
          Public ReadOnly Property ExeName() As String
                Get
                      Return mExeName
                End Get
          End Property
          Public Sub New()
                Dim p As Path
                Try
                      mAppPath = System.Reflection.Assembly.GetExecutingAssembly.Location
                      mExeName = Dir(mAppPath)
                      mAppPath = p.GetFullPath((Left(mAppPath, (Len(mAppPath) - Len(mExeName)))))
                Catch
                      MsgBox(Err.Description, MsgBoxStyle.Critical, "Error!")
                End Try
          End Sub
    End Class
    Module modMain
          Sub Main()
                Dim MyApp As ThisApp = New ThisApp()
                MsgBox(MyApp.AppPath, MsgBoxStyle.Information, "App Path")
                MsgBox(MyApp.ExeName, MsgBoxStyle.Information, "Exe Name")
          End Sub
    End Module

0
 

Expert Comment

by:samdotnet
ID: 9926807
Its I simply Application.StartupPath, in .net if you don’t specify the path then the file will be saved in your bin folder
Other than this there are lots of cool properties and methods that you can find in Application class
0
 
LVL 1

Author Comment

by:MarcGraff
ID: 9927986
Thank you very much!

   - Marc
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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