Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › Saving/Editing/Removing ComboBox Data

Thumbs upSaving/Editing/Removing ComboBox Data

Posts 1–15 of 22 · Page 1 of 2
Cryptonic
Cryptonic
Saving/Editing/Removing ComboBox Data
I'm making a program to save information for what data I have one disc's I have burned.

Basically, what I am doing is I title a disc and burn the pictures/videos on to the dvd, then I want to create a item in a combo box with that name and then I will have a text box show the names of the videos/pictures that I want on in the disc.

The problem is, I need the items to save in the combo box so that when I restart the programs, the items will still be there. I also would like to have an option to edit the names in case if I decide to change it, and if I decide to remove an item because maybe the disc broke or I made a new one with a different name, I would like to remove that item from the combo box.

A few ways to do this is using my.settings or using an XML file. My.settings never seems to save when I move my program or copy it to another location. So I would like to use a XML file, though I have never used an XML file nor do I know how to add and remove data from it. Anyone mind explaining how to do so?

This is kinda the idea of the program, though I'm probably going to change some things around:


I've found an example on CodeProject, http://www.codeprojec*****m/Articles/...ove-Create-XML

I have figured out how to add items to xml and read it. The only thing is, when the program loads, it only adds the most recent item from the XML file to the combo box.

So this is what I am using:
Code:
Dim read As String
        read = Read_XML_Value_("\DiscInfo\Disc.xml", "/Root/", "Name")
        discsel.Items.Add(read)
It just reads the first item off of the Root and adds it. So maybe I would have to create my own items after the root, but then I would have to load every item after that, and I would have to save every one separately, so I'm out of ideas.. any help?
#1 · edited 13y ago · 13y ago
Biesi
Biesi
You can also use .ini files to save info

API: WritePrivateProfileString, GetPrivateProfileString
#2 · 13y ago
Cryptonic
Cryptonic
Quote Originally Posted by Biesi View Post
You can also use .ini files to save info

API: WritePrivateProfileString, GetPrivateProfileString
Yea, but ini files are more for settings... XML's are more for data. But really confusing ._.
#3 · 13y ago
DA
DawgiiStylz
Simple.

Read from the .xml file you're wanting to use. Also, save as a list where you would be able to read/write to; to later save the data back into the .xml file.
To edit, just edit the item of the list via the index of the item.
#4 · 13y ago
Cryptonic
Cryptonic
Quote Originally Posted by DawgiiStylz View Post
Simple.

Read from the .xml file you're wanting to use. Also, save as a list where you would be able to read/write to; to later save the data back into the .xml file.
To edit, just edit the item of the list via the index of the item.
I have that idea down.. stated in op. I'm stuck on how to load multiple items from an xml.
#5 · 13y ago
Biesi
Biesi
Code:
dim xdoc as xdocument = xdocument.load(path)

For Each xel In xdoc.Elements()(0).Elements()
   '###
Next
Code:
<whatever>
	<item>item1</item>
	<item>item2</item>
	<item>item3</item>
</whatever>
#6 · edited 13y ago · 13y ago
Cryptonic
Cryptonic
Quote Originally Posted by Biesi View Post
Code:
dim xdoc as xdocument = xdocument.load(path)

For Each xel In xdoc.Elements()(0).Elements()
   '###
Next
Code:
<whatever>
	<item>item1</item>
	<item>item2</item>
	<item>item3</item>
</whatever>
This would work... but when the XML saves with the same item name, it replaces the original one..

But, I'll try some things when I get home. Do you have a method for saving to XML's as well?
#7 · 13y ago
Biesi
Biesi
Quote Originally Posted by PepsiXHacker View Post
Do you have a method for saving to XML's as well?
Xml.XmlTextWriter
#8 · 13y ago
Cryptonic
Cryptonic
Quote Originally Posted by Biesi View Post


Xml.XmlTextWriter
Can you explain how to use this?

Only thing I got so far is Xml.XmlTextWriter.Create("C:\test.xml") o_o

This page wasn't too helpful - XmlTextWriter Class (System.Xml)

I also tried another code

Code:
Dim writer As New XmlTextWriter(directory, Nothing)
            writer.WriteStartElement("items")
            writer.WriteElementString("name", TxtBox1.Text)
            writer.WriteEndElement()
            writer.Close()
But that replaces the same item as well.
#9 · 13y ago
Biesi
Biesi
Quote Originally Posted by PepsiXHacker View Post
Can you explain how to use this?
Code:
dim enc as new system.text.unicodeencoding
dim xwriter as new xml.xmltextwriter(directory, enc)

with xwriter
  .writestartdocument()
  .writestartelement("whatever") '<whatever>
  .writestartelement("item") '<item>
  .writevalue("item1") 'item1
  .writeendelement() '</item>
  .writestartelement("item") '<item>
  .writevalue("item2") 'item2
  .writeendelement() '</item>
  .writeendelement() '</whatever>
  .close()
end with
something like that
#10 · 13y ago
Cryptonic
Cryptonic
Quote Originally Posted by Biesi View Post


Code:
dim enc as new system.text.unicodeencoding
dim xwriter as new xml.xmltextwriter(directory, enc)

with xwriter
  .writestartdocument()
  .writestartelement("whatever") '<whatever>
  .writestartelement("item") '<item>
  .writevalue("item1") 'item1
  .writeendelement() '</item>
  .writestartelement("item") '<item>
  .writevalue("item2") 'item2
  .writeendelement() '</item>
  .writeendelement() '</whatever>
  .close()
end with
something like that
Wouldn't that do the same as the other code I'm using? I'm trying to have an unlimitied ammount of values that can be entered by a user into an XML file. Then that data can be read when the program starts and entered it into the comx (damnit bo bo, go away >:O. Should be combo box). The thing is, if every name is different, you have to load it all seperatly (unless there's a way to do that).

Sorry if this is confusing, I'm trying to think this out while I'm at school

Thanks for all of your help so far.
#11 · edited 13y ago · 13y ago
Jorndel
Jorndel
Well, this won't be of much help and it's my first XML usage code.
It append "items" and add them attributes:
 
Nooby Code


I'll see if I can make something for you in the mean time
#12 · edited 13y ago · 13y ago
Cryptonic
Cryptonic
Quote Originally Posted by Jorndel View Post
Well, this won't be of much help and it's my first XML usage code.
It append "items" and add them attributes:
 
Nooby Code


I'll see if I can make something for you in the mean time
This is what it created with that code
#13 · 13y ago
1U
1UP
This was something I did for an application, I probably wrote alot more then was really needed but I couldn't seem to get saving and resaving an xml file to work properly any other way.

Saving the file
Code:
    Private Sub saveCleaningLocations(ByVal folderPath As String)


        Dim writestart As Boolean


        'If file doesnt exist then set write to true

        If IO.File.Exists("CleaningLocations.xml") Then
            Dim currentXMLDocument As New XmlDocument
            currentXMLDocument.Load("CleaningLocations.xml")

            Dim parentNode As XmlNode = currentXMLDocument.SelectSingleNode("Locations")

            Dim prodnode As XmlNode = currentXMLDocument.CreateNode(XmlNodeType.Element, "FolderPath", "")

            prodnode.InnerText = folderPath
            parentNode.AppendChild(prodnode)
            currentXMLDocument.Save("CleaningLocations.xml")

        Else
            writestart = True
            Dim xmlFile As IO.FileStream = New IO.FileStream("CleaningLocations.xml", IO.FileMode.Append)
            Dim xmlTextWriter As New XmlTextWriter(xmlFile, System.Text.Encoding.Default)
            With xmlTextWriter
                .Formatting = Formatting.Indented
                .Indentation = 3
                .IndentChar = CChar(" ")
                If writestart Then .WriteStartDocument()

                .WriteStartElement("Locations")
                .WriteElementString("FolderPath", folderPath)
                .WriteFullEndElement()
                .Close()

            End With

        End If
        databind()
    End Sub
Reading in the file
Code:
  Private Sub ReadCleaningLocations()

        If IO.File.Exists("CleaningLocations.xml") Then
            Dim documentClean As XmlReader = New XmlTextReader("CleaningLocations.xml")
            While (documentClean.Read())
                Dim type = documentClean.NodeType

                If type = XmlNodeType.Element Then
                    If documentClean.Name = "FolderPath" Then
                        CreateRows(documentClean.ReadInnerXml.ToString)
                    End If
                End If
            End While
            documentClean.Close()
        End If
    End Sub
This was a copy and paste right from my app so you may have to pick what you need out of it, but as it is, it's working code
#14 · 13y ago
Cryptonic
Cryptonic
I have no idea how you're banned, but if you're not permanently banned, you used this for saving folder locations? And what did you insert the data to, a listbox?
#15 · 13y ago
Posts 1–15 of 22 · Page 1 of 2

Post a Reply

Similar Threads

  • [Help] Save Items in Combobox[Solved]By FatCat00 in Visual Basic Programming
    8Last post 16y ago
  • how to use Gibs Save EditBy iampain13 in Borderlands 2 Hacks
    2Last post 13y ago
  • [SOLVED]Map Saving/EditingBy icygrave in Call of Duty Modern Warfare 2 Help
    3Last post 16y ago
  • Is it possible to edit(remove) the suit voice?By The-_-enD in Crysis 2 Help
    2Last post 15y ago
  • Threads about Packet Editing Removed?By domer in Staff Disputes
    2Last post 14y ago

Tags for this Thread

None