Jump to content

Database App


Folker
 Share

Recommended Posts

Did you even bother to click on the links?

IniWrite:

If file does not exist, it is created.

This one will create a ini file with the name myfile.ini in C:\Temp\ and write some data to it.

IniWrite("C:\Temp\myfile.ini", "section2", "key", "this is a new value")
Link to comment
Share on other sites

Did you even bother to click on the links?

IniWrite:

This one will create a ini file with the name myfile.ini in C:\Temp\ and write some data to it.

IniWrite("C:\Temp\myfile.ini", "section2", "key", "this is a new value")
Ok, sorry.

I have made the ini file and want to load it from a FileOpenDialog command, so i open it, but now i want to see the ini file, i tried this:

$label = IniRead("" & $open,"SECTION1","name")

and

$label = IniRead( $open,"SECTION1","name")

and

$label = IniRead(& $open,"SECTION1","name")

but they all gave me errors..

how would i click the open button and then it displays the text on the gui, in say, a label?

Thanks,

Folker.

Link to comment
Share on other sites

To modify a control (apply data to it) use the GUICtrlSetData Func. Check the helpfile.

;$label = GUICtrlCreateLabel......
GUICtrlSetData($label,"message here")
Edited by spudw2k
Spoiler

Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder
Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array
Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc
Cool Stuff: AutoItObject UDF â—Š Extract Icon From Proc â—Š GuiCtrlFontRotate â—Š Hex Edit Funcs â—Š Run binary â—Š Service_UDF

 

Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate("") 

$select = GUICtrlCreateButton("Open file", 50, 50)
$label = GUICtrlCreateLabel("test", 150, 100)
GUISetState (@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    
    If $msg = $select Then 
        $file = FileOpenDialog("Select a file.", @DesktopDir & "\", "INI (*.ini)")
        $data = IniRead($file, "section2", "key", "NotFound"); section and key have to be predefined.
        GUICtrlSetData($label, $data)
    EndIf   
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate("") 

$select = GUICtrlCreateButton("Open file", 50, 50)
$label = GUICtrlCreateLabel("test", 150, 100)
GUISetState (@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    
    If $msg = $select Then 
        $file = FileOpenDialog("Select a file.", @DesktopDir & "\", "INI (*.ini)")
        $data = IniRead($file, "section2", "key", "NotFound"); section and key have to be predefined.
        GUICtrlSetData($label, $data)
    EndIf   
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
I do this, but it displays NotFound from the $data command in the gui. i want it to display the data from the ini file.

Thanks,

Folker.

Link to comment
Share on other sites

Make sure the section name and key are correct.

[sectionName]

Key=Value

Im trying to load it so that i can open one ini file and it displays the data, and then i can load another INI file and it will display diffrent data.

Say im loading:

test1.ini

and

test2.ini

i want to load test1 first using the opendialog so it displays say, hello (predefined in the ini already created) and then use opendialog again to open test2, which would say, hey! (also predefined in a diffrent ini file.)

is there a way to do this?

Edited by Folker
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...