application state in console app.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PCH

    application state in console app.

    is there any way to create a asp.net application object in a vb.net console
    app?

    ie.. store some values in the application (such as filepath info) so that
    reference dll's can use those values?

    been trying something like

    Dim oApp As New Web.HttpApplica tion

    but then i cant reference it such as

    HttpContext.Cur rent.Applicatio n("....")



    Thanks


  • S. Justin Gengo

    #2
    Re: application state in console app.

    PCH,

    Use the application object.

    Set the value in the OnApplicationSt art subroutine of the global.asax page.
    Dim MyValue As String = "Some Stuff Here"

    Application.Add ("MyValue", MyValue)

    Then reference it like this:

    Dim MyValue As String = CType(Applicati on.Item("MyValu e"), String)

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:


    "Out of chaos comes order."
    Nietzche


    "PCH" <pch12@hotmail. com> wrote in message
    news:u3XSzu$aDH A.880@TK2MSFTNG P09.phx.gbl...[color=blue]
    > is there any way to create a asp.net application object in a vb.net[/color]
    console[color=blue]
    > app?
    >
    > ie.. store some values in the application (such as filepath info) so that
    > reference dll's can use those values?
    >
    > been trying something like
    >
    > Dim oApp As New Web.HttpApplica tion
    >
    > but then i cant reference it such as
    >
    > HttpContext.Cur rent.Applicatio n("....")
    >
    >
    >
    > Thanks
    >
    >[/color]


    Comment

    Working...