Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    172

    Read ini file from the web to listbox

    Hello all

    How can i Read a ini file from the web to a listbox?

    the code i use to read a ini from the source file:

    PHP Code:
        ListBox.SetEnabled("ListBox1"true);

        
    ListBox.DeleteItem("ListBox1", -1);

        
    result INIFile.GetSectionNames(_SourceFolder .."\\AutoPlay\\Docs\\Menu List.ini");

    for 
    i,v in result do
        
    inivalue INIFile.GetValue("AutoPlay\\Docs\\Menu List.ini"""v);
        
    ListBox.AddItem("ListBox1"vinivalue);
    end

        
    -- Sets The Focus to ListBox1
        Page
    .SetFocus("ListBox1");

        -- 
    Sets Focus to First Item in list box
        ListBox
    .SelectItem("ListBox1"1
    And now i want to let it read form a domain.

    Thanks in advance

  2. #2
    Join Date
    Apr 2006
    Posts
    15
    You just need to download the INI file to the temp folder and do what is needed. I use the binary mode because some servers have problems sending in ASCII (text) mode.

    Here's the code:

    Code:
    ListBox.SetEnabled("ListBox1", true);
    
        ListBox.DeleteItem("ListBox1", -1);
    
        -- download the ini file
        HTTP.Download("http://www.domain.com/files/inifile.ini", _TempFolder.."\\inifile.ini", MODE_BINARY, 60, 80, nil, nil, nil);
    
        result = INIFile.GetSectionNames(_TempFolder.."\\inifile.ini");
    
    for i,v in result do
        inivalue = INIFile.GetValue(_TempFolder.."\\inifile.ini", "", v);
        ListBox.AddItem("ListBox1", v, inivalue);
    end
    
        -- Sets The Focus to ListBox1
        Page.SetFocus("ListBox1");
    
        -- Sets Focus to First Item in list box
        ListBox.SelectItem("ListBox1", 1)

Similar Threads

  1. Read text file from web server?
    By ianhull in forum AutoPlay Media Studio 5.0
    Replies: 9
    Last Post: 03-16-2005, 01:56 PM
  2. INI file to populate a listbox
    By pjhiggins in forum AutoPlay Media Studio 5.0
    Replies: 17
    Last Post: 05-04-2004, 04:08 PM
  3. Unicode INI file, read on NT 4 crashes app
    By jlm13 in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 08-07-2003, 09:08 AM
  4. Replies: 0
    Last Post: 08-17-2000, 02:29 PM

Posting Permissions

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