Results 1 to 14 of 14

Thread: Pass Parameter to an Application

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Location
    Bahrain
    Posts
    2

    Pass Parameter to an Application

    Hi everybody...

    I want to develop an application using VB.NET..
    my application will run from another application developed using oracle forms...
    my application should recieve username, password , and other information from the other application..
    the problem is how to recieve these information as parameters?

  2. #2
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    I assume you want to create a .NET application with a .exe extension (a true application not a component).

    I dont know much about running external apps from Oracle forms, but I presume you have to execute the application by its name. If this is the case then you can use normal command line parameters.

    Eg. "C:\myapp.exe param1=value1 param2=value2"

    You can access the parameters using "Microsoft.VisualBasic.Command".

    You will need to parse the string to get the parameter values.

    When you find the solution, please post the code required to call the application from Oracle Forms. I am maintaining old Oracle Forms 3, so I am interested to see how its done now days.

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    The application must have Sub Main() method as entry point of the application with paramters (I think it's the same as in C# app) .

  4. #4
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Yes. It's an awful idea to use the Compability namespace one when you can use a builtin one
    \m/\m/

  5. #5
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188
    I do not think you need a Sub Main i could be wrong but in vb 6 you could call Command anywhere.

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Tewl
    I do not think you need a Sub Main i could be wrong but in vb 6 you could call Command anywhere.
    How will the syntax look like then ?

  7. #7
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188
    Code:
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            MsgBox(Microsoft.VisualBasic.Command())
        End Sub

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Ok , can you pass argus to the formload event in commandline ,like this:
    myapp.exe helloworld
    ?

  9. #9
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Originally posted by Tewl
    I do not think you need a Sub Main i could be wrong but in vb 6 you could call Command anywhere.
    That's not the point. The point is if you have a built-in way in .NET framework why in the world would you use the compability namespace?
    \m/\m/

  10. #10
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188
    I import Microsoft.VisualBasic for many things such as left and right why would it matter.

  11. #11
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    I really don't get why would you still want Left() and Right() functions in VB.NET. You have .Substring() method that does what you need, if yo uwant Left()/Right() you could even implement it in a class made by your own(though i NEVER really needed it, i find the .Substring() method way best) removing the Compability namespace depency. Sure it is in .net framework but until when? And having in consideration that all that's there exists in equal or similar way in the .net framework I think it's a shame to use it :S
    \m/\m/

  12. #12
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188
    I suppose. I don't use vb .net much anyway, I prefer C#

  13. #13
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    PHP Code:
    if (YouHaveTo()) 
    {
    Use (
    "Microsoft.VisualBasic.dll")
    }else{
    Use (
    "string methods")




  14. #14
    New Member
    Join Date
    Mar 2004
    Posts
    2
    You can use Environment.GetCommandLineArgs()

    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.   Dim UserName As String = Environment.GetCommandLineArgs(1)
    3.   Dim Password As String = Environment.GetCommandLineArgs(2)
    4.   etc.
    Last edited by iljhar; Mar 16th, 2004 at 11:03 AM.

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