Question: How to access the ressource files in a short fashion

Discussion in 'ASP .Net' started by Progman, Mar 6, 2006.

  1. Progman

    Progman Guest

    to read the ressources, I execute the following code from my screen files.
    Is there another shorter way of doing this? Similar to
    "ressource("language1.ressource").key("GuestBook.asax.LabelTitle.Text").Value

    txs for your answers in advance

    Dim rr As ResourceReader

    rr = New ResourceReader(Server.MapPath("~") + Path.DirectorySeparatorChar +
    "Common/Resources" + Path.DirectorySeparatorChar + "CommonStrings" +
    Trim(Str(Application("Language"))) + ".resources")

    Dim de As IDictionaryEnumerator = rr.GetEnumerator()


    While de.MoveNext()

    Me.LabelTitle.Text = IIf(de.Key.ToString() =
    "GuestBook.asax.LabelTitle.Text", de.Value.ToString(), Me.LabelTitle.Text)

    End While

    rr.Close()
     
    Progman, Mar 6, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick

    default ressource

    Patrick, Nov 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    295
    Patrick
    Nov 25, 2003
  2. Steve B.
    Replies:
    0
    Views:
    634
    Steve B.
    Feb 26, 2004
  3. Fh
    Replies:
    0
    Views:
    335
  4. Rolf Hemmerling
    Replies:
    3
    Views:
    762
    Roger Leigh
    Oct 31, 2003
  5. Patrick Sabin

    setuptools, accessing ressource files

    Patrick Sabin, Oct 2, 2009, in forum: Python
    Replies:
    1
    Views:
    248
    PJ Eby
    Oct 3, 2009
Loading...

Share This Page