[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1507
  • Last Modified:

App.Path in VB.NET?

What is App.Path in VB.NET?

   - Marc
0
MarcGraff
Asked:
MarcGraff
1 Solution
 
Mikal613Commented:
System.Windows.Forms.Application.ExecutablePath
System.Windows.Forms.Application.StartupPath
System.AppDomain.CurrentDomain.BaseDirectory()
System.GetEntryAssembly().Location
0
 
Mikal613Commented:
Public Function App_Path() As String
        Return System.AppDomain.CurrentDomain.BaseDirectory()
    End Function

these are a couple ways
0
 
DranizzCommented:
System.GetEntryAssembly().Location
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
Mikal613Commented:
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
 
samdotnetCommented:
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
 
MarcGraffAuthor Commented:
Thank you very much!

   - Marc
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now