App.Ini vs Web.Config

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!
Post Reply
byron.hopp
Posts: 254
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

App.Ini vs Web.Config

Post by byron.hopp »

In harbour winforms applications we seem to store specific information for our apps in the .ini file. On the web it seems it is stored in web.config. Does mod_harbour have a way to read and write from a web.config file as harbour does with .ini's?

Thanks,
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
Carles
Posts: 937
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona
Contact:

Re: App.Ini vs Web.Config

Post by Carles »

Hi,

I think you can write/read yiur file config like a usual file. And for example you can use memowrit/memoread for it

C.
Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

https://modharbour.app
https://modharbour.app/compass
https://forum.modharbour.app
byron.hopp
Posts: 254
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: App.Ini vs Web.Config

Post by byron.hopp »

Yes, thank you, good point. I was looking for a class that may make it easier like the oIni class that allows us to read and write to INI files.
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
Carles
Posts: 937
Joined: Fri Feb 10, 2006 2:34 pm
Location: Barcelona
Contact:

Re: App.Ini vs Web.Config

Post by Carles »

Byron,

You can do

Code: Select all

function main()

    local cIni      :=  hb_GetEnv( "PRGPATH" ) + '/myini.txt'
    local hIni  := {=>}
    
    hIni[ 'name' ] := 'Charly'
    hIni[ 'last' ] := time()
    hIni[ 'age'  ] := 52

    //  Save your ini
    memowrit( cIni, hb_jsonencode( hIni ) )
    
    //  Read your ini
    h := hb_jsondecode( memoread( cIni ))
    
    ? h[ 'name' ]
    ? h[ 'last' ]
    ? h[ 'age' ]


retu nil
Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

https://modharbour.app
https://modharbour.app/compass
https://forum.modharbour.app
byron.hopp
Posts: 254
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: App.Ini vs Web.Config

Post by byron.hopp »

Below is a minimal web.config example from Microsoft Support.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>

</system.web>
</configuration>
Thanks,
Byron Hopp
Matrix Computer Services
Post Reply