Results 1 to 15 of 15
  1. #1
    jhadd4's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    in your heart
    Posts
    182
    Reputation
    10
    Thanks
    938
    My Mood
    Bored

    Save File .INI Source Code

    the title say it all ?

    Like in PerX ? any one can help please because i want to make a advance injector


    Heres my example

  2. #2
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108



  3. #3
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Either that or use XML... and not inis
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  4. #4
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Or you could use Jason's library for reading and writing .INI files:

    https://www.mpgh.net/forum/27-coders-...e-parsing.html

    The highlight tag fucked up the code. Hopefully you can figure out the right code for yourself.

  5. #5
    jhadd4's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    in your heart
    Posts
    182
    Reputation
    10
    Thanks
    938
    My Mood
    Bored
    can you help me ?

    my problem is i cant Load my ListBox i use this to save my settings -> https://www.mpgh.net/forum/33-visual-...-settings.html

    Heres my Code
    Red Color Contains = Error


    Code:
      Private Sub SaveInformation()
            'Write the form "title" to section "General"
            inifile.WriteValue("General", "Process ", txtText.Text)
            inifile.WriteValue("General", "Quit ", chkBox1.Checked)
            inifile.WriteValue("General", "ListBox", ListBox1.Items.Count)
        End Sub
    
        Private Sub LoadInformation()
            'Read the form "title" of the section "General"
            txtText.Text = inifile.ReadValue("General", "Process ", "")
            chkBox1.Checked = inifile.ReadValue("General", "Quit ", "")
            ListBox1.Items.Count = inifile.ReadValue("General", "Quit ", "")
        End Sub


    ---------- Post added at 09:42 AM ---------- Previous post was at 09:38 AM ----------

    Quote Originally Posted by Hassan View Post
    Or you could use Jason's library for reading and writing .INI files:

    https://www.mpgh.net/forum/27-coders-...e-parsing.html

    The highlight tag fucked up the code. Hopefully you can figure out the right code for yourself.
    thanks but the code is for C# i want code from VB Thanks for the help

  6. #6
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    You do realize that ListBox1.Items.Count is ReadOnly right? which means you cant edit it.

    Also, the reason .NET devs did not include a Library for INI files is because they want YOU to use XML. If so, why no using it? meh..
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  7. #7
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Sigh. Replace the red line of your code to this:

    Code:
    ListBox1.Items.Add(inifile.ReadValue("General", "Quit ", ""))

  8. #8
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Something like:
    Code:
    For Each Opti As String In File.ReadAllLines("Path of file") 'Reads all the lines from the File
    
    Dim TempStr As String = Opti 'Makes a new String Temp Valu. (Maybe not needed tho :P)
    TempStr.Remove(0, TempStr.IndexOf("=")) 'Removes text until it finds: = (You might have to add: TempStr.IndexOf("=") + 1
    ListBox1.Items.Add(TempStr) 'Adds the Value to the listbox
    
    Next
    I might have done it a bit wrong or so.
    But I suppose you can see the point here.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  9. #9
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Jorndel View Post
    Something like:
    Code:
    For Each Opti As String In File.ReadAllLines("Path of file") 'Reads all the lines from the File
    
    Dim TempStr As String = Opti 'Makes a new String Temp Valu. (Maybe not needed tho :P)
    TempStr.Remove(0, TempStr.IndexOf("=")) 'Removes text until it finds: = (You might have to add: TempStr.IndexOf("=") + 1
    ListBox1.Items.Add(TempStr) 'Adds the Value to the listbox
    
    Next
    I might have done it a bit wrong or so.
    But I suppose you can see the point here.
    Code:
    TempStr.Remove(0, TempStr.IndexOf("="))
    This line doesn't affects TempStr. You gotta assign TempStr the value which is returned after the Remove function is called. Also, you're getting the index of is euqal to sign '='. The Remove function removes everything excluding the character that resides on that index. So you gotta add the = sign by incrementing the count by 1.

    Code:
    TempStr = TempStr.Remove(0,TempStr.IndexOf("=") + 1)
    Anyways, I added a couple of checks. Here's another version that can work for you:

    Code:
    Dim INIFile As String = System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\INI.ini"
    For Each Line As String In File.ReadAllLines(INIFile)
        If Not Line.Trim().StartsWith("[") And Not Line.Trim().EndsWith("]") And Line.Contains("=") Then
             Dim SettingName As String = Line.Substring(0, Line.IndexOf("="))
             Dim SettingValue As String = Line.Substring(Line.IndexOf("=") + 1)
             ListBox1.Items.Add(SettingValue)
        End If
    Next
    Last edited by Hassan; 07-20-2012 at 01:56 PM.

  10. The Following User Says Thank You to Hassan For This Useful Post:

    Jorndel (07-20-2012)

  11. #10
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Yeah, forgot to assign the new value :P
    Getting older by each day

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  12. #11
    Broderick's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Location
    Basement.
    Posts
    100
    Reputation
    42
    Thanks
    30
    Protip: Use XML instead of INI files.
    The fish trap exists because of the fish.
    Once you've gotten the fish you can forget the trap.
    The rabbit snare exists because of the rabbit.
    Once you've gotten the rabbit, you can forget the snare.
    Words exist because of meaning.
    Once you've gotten the meaning, you can forget the words.
    Where can I find a man who has forgotten words so I can talk with him?

  13. #12
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by Broderick View Post
    Protip: Use XML instead of INI files.
    Oldtip... ._.
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  14. #13
    Broderick's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Location
    Basement.
    Posts
    100
    Reputation
    42
    Thanks
    30
    Quote Originally Posted by Brinuz View Post
    Oldtip... ._.
    Shaddup Bruno.
    The fish trap exists because of the fish.
    Once you've gotten the fish you can forget the trap.
    The rabbit snare exists because of the rabbit.
    Once you've gotten the rabbit, you can forget the snare.
    Words exist because of meaning.
    Once you've gotten the meaning, you can forget the words.
    Where can I find a man who has forgotten words so I can talk with him?

  15. #14
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Broderick View Post


    Shaddup Bruno.
    Jason, stop going off topic pls ._.

  16. #15
    Broderick's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Location
    Basement.
    Posts
    100
    Reputation
    42
    Thanks
    30
    Quote Originally Posted by Hassan View Post


    Jason, stop going off topic pls ._.
    I wouldn't have had to, but then Bruno had to indulge in his tendency to flame n00bs.
    The fish trap exists because of the fish.
    Once you've gotten the fish you can forget the trap.
    The rabbit snare exists because of the rabbit.
    Once you've gotten the rabbit, you can forget the snare.
    Words exist because of meaning.
    Once you've gotten the meaning, you can forget the words.
    Where can I find a man who has forgotten words so I can talk with him?

Similar Threads

  1. How to edit a dll files or reflect to get the source code from it
    By testingid123456 in forum Sudden Attack General
    Replies: 1
    Last Post: 10-13-2010, 11:45 AM
  2. some of the ca files broken into source code
    By xLOLZ2MUCHx in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 13
    Last Post: 08-11-2010, 03:43 PM
  3. [SOURCE CODE]Write File To Disk From Resources[VB.NET]
    By ajvpot in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 2
    Last Post: 03-30-2010, 08:54 PM
  4. How to Edit a files source Code to change so that it is less detectable
    By zakodia in forum Call of Duty Modern Warfare 2 Help
    Replies: 5
    Last Post: 02-19-2010, 07:24 PM