Sign in to follow this  
Followers 0
layer

IniWrite...

7 posts in this topic

#1 ·  Posted (edited)

this is my first time using iniwrite :"> and say i do this...

$lala= GUICtrlCreateInput ("", -1, -1)
$guiread ($lala)
iniwrite ("C:\lala.ini", "test", "test", $lala)

the first time it's ran, the ini is like this:

[section]

Key= Value

lets just say i have that... now when it writes to that same file because i run it again, it looks like this

[section]

Key= Value

[section]

Key= Value

it writes it again... is there a way to stop this?? so that lets say the value changes, it doesnt write a whole new thing, it just changes the past value?

also how would i make a hidden .ini file?

thanks a billion... :D

EDIT: errr, why does it work now??? so now it doesnt overwrite, but how can i make it hidden??! :idiot:

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

FileSetAttrib ( "file pattern", "+-RASHNOT" [, recurse] )

The file pattern cannot contain spaces!

The attributes that can be modified with the function are + or -:

"R" = READONLY

"A" = ARCHIVE

"S" = SYSTEM

"H" = HIDDEN

"N" = NORMAL

"O" = OFFLINE

"T" = TEMPORARY

(Note that you cannot set the compressed/directory attributes with this function.)

*Copy paste from help.chm under file management*

*another edit, JdeB, we both covered both parts of his question, lol*

Edited by Wolvereness

Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]

Share this post


Link to post
Share on other sites

You are not writing the value but the handle...

try this:

$lala= GUICtrlCreateInput ("", -1, -1)
iniwrite ("C:\lala.ini", "test", "test", $guiread ($lala))

File hidden as in FileSetAttrib("filename","+H") ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

yea, sry, i got the code down now, thanks guys, i messed up the code in my first post, sorry, dont pay attention to that

thanks again! =D


FootbaG

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Ummm... one more question!! sorry! why doesnt the inifile get written to this dir??

DirCreate (@AppDataDir & "\LOC\")
InIWrite (@AppDataDir & "\LOC\", "Password", "Password", $readpass)

help please.... the ini doesnt get written to the folder specified..? why not, sorry agaiN!

EDIT: Sorry!! again, i found the answer... it should

InIWrite (@AppDataDir & "\LOC\THINGS.ini", "Password", "Password", $readpass)

thanl you!!!

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites

thanl you!!!

You'r welconl :idiot:

Who else would I be?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

rofl, nice one =P but i have another question =/ .... heres my code... its for a program called LOC... the purpose of the program is to be able to put a password of the files selected... so when you double click it, an input box appears and you have to enter the passoword... so here it is..

#include <GUIConstants.au3>
GUICreate ("File LOC", 400, 300)
GUISetBkColor (0x102021)
GUISetState ()
DirCreate (@AppDataDir & "\LOC\")
$lab= GUICtrlCreateLabel ("Welcome to FileLoc... FileLoc let's you Lock your files for safe keeping", 1, 1)
GUICtrlSetColor(-1, 0x4A49FF)
$inp= GUICtrlCreateInput ("", 50, 50,"" ,"" , 0x0020)
GUICtrlSetLimit ($inp, 12, 4)
$lab2= GUICtrlCreateLabel ("Enter the password for the file you want to lock:", -1, 25)
GUICtrlSetColor(-1,0xff0000)
$lab3= GUICtrlCreateLabel ("NOTE: 12 characters is the max for passwords and 4 is the minimum.", -1, 80)
GUICtrlSetColor(-1,0xff0000)
$inp2= GUICtrlCreateInput ("", 50, 150)
$lab4= GUICtrlCreateLabel ("Enter the path including the file in it (EX: C:\doc.txt\)", -1, 125)
GUICtrlSetColor(-1,0x00ff00)
$but= GUICtrlCreateButton ("Lock file now!", 50, 200)
$lab5= GUICtrlCreateLabel ("Make sure to copy down your password!", -1, 250)
GUICtrlSetColor (-1, 0xffffff)
Func LOC ()
   $readpass= GUIRead ($inp)
   $readdir= GUIRead ($inp2)
   InIWrite (@AppDataDir & "\LOC\DirPass.ini\", "Password", "Password", $readpass)
   IniWrite (@AppDataDir & "\LOC\DirPass.ini\", "Directory", "Directory", $readdir)
   MsgBox (0, "Password is:", "Your password is:" & @LF & $readpass)
   EndFunc
   
While 1
   $get= GUIGetMsg ()
   Select
  Case $get= $GUI_EVENT_CLOSE
      exitloop
   Case $get= $but
      LOC ()
      EndSelect
      WEnd

ok, everything works, but i was thinking... how am i going to make it so when you double click the input box appears? maybe i should make it only LOC Folders? and add some paremeters in the folder properties? but im a little unsure of how to do this...but that wouldn't work, because as far as i know, there is only "targets" in executable files... so im stuck on this... any suggestions? need me to tell you more detailed in what im looking for? im thinking on what i can do right now...

Edited by layer

FootbaG

Share this post


Link to post
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
Sign in to follow this  
Followers 0