Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    [VB.NET] Command Line in VB.NET

    Ciao developers, ho un piccolo problema, come faccio a prendere tutto ciò che passo in command line quando lancio l'eseguibile?

    in VB 6.0 c'era il vecchio comando:
    dim pippo as string
    pippo = command

    in VB.NET se faccio la stessa cosa, mi torna nella task list un errore legato alla classe:
    windows.forms

    Come faccio a prendere tutto ciò che passo in command line?
    Grazie a tutti.

    Ciao.
    28/05/2003 - Manchester
    Old Trafford Stadium
    Uefa Champions League Final
    Milan Campione d'Europa

  2. #2
    Utente di HTML.it L'avatar di evil80
    Registrato dal
    May 2001
    Messaggi
    321
    credo che siano contenuti nei parametri della funzione statica Main (il punto di avvio di ogni programma .NET)
    Secondo alcuni autorevoli testi di tecnica di aeronautica, il calabrone non può volare, a causa della forma e del peso del proprio corpo in rapporto alla superficie alare.
    Ma il calabrone non lo sa e perciò continua a volare.
    Igor Sikorsky

  3. #3
    Utente di HTML.it L'avatar di biste
    Registrato dal
    Apr 2001
    Messaggi
    877
    Environment.CommandLine

    Property Value
    A string containing command line arguments.

    Remarks
    This property provides access to the program name and any arguments specified on the command line when the current process was started.

    The program name can, but is not required to, include path information. Use the GetCommandLineArgs method to retrieve the command line information parsed and stored in an array of strings.

    HTH
    UGIdotNET
    Microsoft .NET MCAD
    C++, C#, VB6, VB.NET, ASP, ASP.NET
    SQL Server 2000

  4. #4
    Grazie mille per le indicazioni.

    Incollo qui il codice funzionante, magari può essere utile a qualcuno.

    Sub Main()
    ' call the Main with arguments
    Main(Environment.GetCommandLineArgs())
    End Sub

    ' the "real" Main procedure
    Private Sub Main(ByVal args() As String)
    ' Display arguments passed to the application
    Dim s As String
    For Each s In args
    'if s= application.ExecutablePath
    If Not s = Application.ExecutablePath Then
    MsgBox(s)
    End If
    Next
    End Sub
    28/05/2003 - Manchester
    Old Trafford Stadium
    Uefa Champions League Final
    Milan Campione d'Europa

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.