Results 1 to 5 of 5

Thread: [RESOLVED] Openargs

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    6

    Resolved [RESOLVED] Openargs

    Hi

    I'm pretty new to .net from vb.

    Can you pass input parameters to a compiled.net exe file - a bit like openargs in vb e.g. dotnetproj.exe 1000

    or do you have to have an exe for each of the different input parameters that you need e.g.
    dotnetproj1000.exe,
    dotnetproj2000.exe,
    dotnetproj3000.exe
    etc

    cheers
    Last edited by jimjamjo; Jul 2nd, 2005 at 10:04 AM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Openargs

    You can pass them in the commandline arguments and receive them in your app by checking in the Form_Load event or New
    procedure by using Environment.CommandLine()
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    6

    Re: Openargs

    Thanks

    and then you remove the path from the string within the project?
    Last edited by jimjamjo; Jul 5th, 2005 at 12:23 PM.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Openargs

    It would be passed in something that is easily parsable.
    VB Code:
    1. run proj1.exe /1 /debug /false
    2.  
    3. sub form_load
    4.     dim ar() as string
    5.     ar = Environment.CommandLine.Split("/")
    6.     messagebox.show(ar(0))
    7.     messagebox.show(ar(1))
    8.     messagebox.show(ar(2))
    9. end sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2005
    Posts
    6

    Re: Openargs

    OK thats quick !!!!!!!!!!!!!!!!!!!!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width