Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Ini Replace?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Thu Feb 21, 2008 9:14 pm    Post subject: Ini Replace? Reply with quote

Howq would you replace a value in vb?

Example:
[abc]
abb=asd
acc=asdf

If I want the result to be:
[abc]
abb=asdfghj
acc=asdf

Without resaving it as a new file how would I edit it with a ini edit class?
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu Feb 21, 2008 9:32 pm    Post subject: Reply with quote

In C++ its WritePrivateProfileString

So to use it in VB.NET you can do this [Taken From Here]

Code:
<DllImport("kernel32.dll", SetLastError:=True)> _
Private Shared Function WritePrivateProfileString(ByVal lpAppName As String, _
                        ByVal lpKeyName As String, _
                        ByVal lpString As String, _
                        ByVal lpFileName As String) As Boolean
    End Function


so using this:

Quote:
[abc]
abb=asd


lpAppName = "abc"
lpKeyName = "abb"
lpString = "asd"
lpFileName = "INIFile.ini"

Putting it in proper Function format will write the string "asd" to the key "abb" in the "abc" section, to INIFile.ini

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Feb 23, 2008 5:56 am    Post subject: Reply with quote

There are a ton of classes made for VB6 for reading and writing to INI files. You can find a lot over at Pscode.com, or you can find a more professional one on VBAccelerator's website.

http://vbaccelerator.com/home/index.asp

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites