App.Path & App.EXEName
As .Net does Not include App object as in VB here is a solution for App.Path and App.ExeName
AI
ملخص الذكاء الاصطناعي: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
كود المصدر
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
التعليقات الأصلية (3)
مسترجع من Wayback Machine