Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Name of the Application and Command line arguments

Name of the Application and Command line arguments

Scheduled Pinned Locked Moved Visual Basic
csharpdata-structures
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark P 0
    wrote on last edited by
    #1

    Using VB.NET 2003, how do you access the name and path of the running application. I have found where you can use the command function (Microsoft.VisualBasic.Command()), but this returns a string of the arguments that are after the name of the application. In C you can access this as the 1st element of the array of the command line arguments argv[0].

    D 1 Reply Last reply
    0
    • M Mark P 0

      Using VB.NET 2003, how do you access the name and path of the running application. I have found where you can use the command function (Microsoft.VisualBasic.Command()), but this returns a string of the arguments that are after the name of the application. In C you can access this as the 1st element of the array of the command line arguments argv[0].

      D Offline
      D Offline
      dynamic
      wrote on last edited by
      #2

      VbCode:


      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Dim sName As String = Application.ExecutablePath
      MessageBox.Show(sName) '/// this will show the application's exe path and the application's .exe name.
      End Sub


      hope it helps :) Vb:


      Public Function TwinsOnWay(ByVal twins As String) As String
      Select Case twins
      Case "Gender"
      Return "Two Girls"
      End Select
      End Function


      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups