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 › [Help]Edit XML Node[Solved]

Post[Help]Edit XML Node[Solved]

Posts 1–8 of 8 · Page 1 of 1
MJLover
MJLover
[Help]Edit XML Node[Solved]
Hi !

I want to edit an xml node, for example this is the xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<family>
  <name gender="Male">
    <firstname>Tom</firstname>
    <lastname>Smith</lastname>
  </name>
  <name gender="Female">
    <firstname>Dale</firstname>
    <lastname>Smith</lastname>
  </name>
</family>
In
Code:
<firstname>Tom</firstname>
, how would I change 'Tom' to something else, plus I also need to check the gender !!
Also it should loop through all XML !!

How can I do this ??
#1 · 16y ago
NextGen1
NextGen1
Are you using it as a database?

Anyway

[php]
Dim root As XElement = XElement.Load("Location\Filename.xml")
Dim xt As XElement = (From el In root.Descendants("Node1") _
Select el).First()
xt.SetValue("New Value")
root.Save("Location\Filename.xml")
[/php]

You can do this dynamically as well by using the value fields with combo-box data or textbox values, etc.


In asp.net/vb.net/c# I bind XML's as databases all the time, much more convenient then a database, and I don't have to worry to much about
truncating or overloads
#2 · edited 16y ago · 16y ago
MJLover
MJLover
Quote Originally Posted by NextGen1 View Post
Are you using it as a database?

Anyway

[php]
Dim root As XElement = XElement.Load("Location\Filename.xml")
Dim xt As XElement = (From el In root.Descendants("Node1") _
Select el).First()
xt.SetValue("New Value")
root.Save("Location\Filename.xml")
[/php]

You can do this dynamically as well by using the value fields with combo-box data or textbox values, etc.


In asp.net/vb.net/c# I bind XML's as databases all the time, much more convenient then a database, and I don't have to worry to much about
truncating or overloads
Yup, a simple database (not more than 10000 items).
I know XML serialization in .net is blazing fast, that's why I chose it

And thnx for the help, I know another way (Googled) but its harder. I wanted simple and its simple enough

Any guidance for creating a database using XML plz ??
#3 · edited 16y ago · 16y ago
NextGen1
NextGen1
Ill create a tut and post it, give me 5 mins or so

----------Code MSDN Standard, Not mine, just collected for sharing.

Datagrid

[php]
Private Sub lbTables_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim tblName As String = lbTables.Text
currentTable = dataSet.Tables(tblName)
ShowColumns()
dgData.SetDataBinding(dataSet, tblName)
dgData.CaptionText = "Table: " & tblName
End Sub
[/php]


Load an XML File (using Open Dialog() Modify to hard code database.

[php]
Dim res As DialogResult = openFileDialog.ShowDialog(Me)
If res = DialogResult.OK Then
Dim fn As String = openFileDialog.FileName
Dim ds As New DataSet()
ds.ReadXml(fn)
lbTables.Items.Clear()
For Each dt As DataTable In ds.Tables
lbTables.Items.Add(dt.TableName)
Next
dataSet = ds
lbTables.SelectedIndex = 0
fnSchema = fn
Me.Text = "XML Database Editor - " & fnSchema
End if

[/php]

Save XML

[php]
dataSet.WriteXml(fn, XmlWriteMode.WriteSchema)
[/php]

Dynamically add a table

[php]
Dim tblName As String = edTableName.Text
If Not ValidateTableName(tblName) Then
Exit Sub
End If

Dim dt As New DataTable(tblName)
currentTable = dt
lbTables.Items.Add(tblName)
dataSet.Tables.Add(dt)
lbTables.SelectedItem = lbTables.Items(lbTables.FindStringExact(tblName))
[/php]

Add column

[php]
Dim colName As String = edColumnName.Text
Dim colType As String = cbColumnType.Text
If (Not ValidateColumnNameAndType(colName, colType)) OrElse (Not ValidateSelectedTable()) Then
Exit Sub
End If
Dim lvi As ListViewItem = lvColumns.Items.Add(colName)
lvi.SubItems.Add(colType)
currentTable.Columns.Add(colName, Type.[GetType]("System." & colType))
[/php]

Display Columns

[php]
lvColumns.Items.Clear()
If currentTable IsNot Nothing Then
For Each dc As DataColumn In currentTable.Columns
Dim lvi As ListViewItem = lvColumns.Items.Add(dc.ColumnName)
Dim s As String = dc.DataType.ToString()
s = s.Split(New [Char]() {"."c})(1)
lvi.SubItems.Add(s)
Next
End If
[/php]



#4 · edited 16y ago · 16y ago
MJLover
MJLover
How do I use it ?? Which controls are required ??
#5 · 16y ago
NextGen1
NextGen1
DataGrid

I left the rest open, those are from button click events, but using the title, (IE open, Edit, Add, Save) you decide what to event triggers the action
#6 · 16y ago
MJLover
MJLover
Can't find type XElement ??

Code:
Dim root As XElement = XElement.load("Location\Filename.xml")
Imported:

Code:
Imports System.Xml
Imports System.Linq
What's wrong ???
#7 · 16y ago
NextGen1
NextGen1
Recently I did a application that required XML , I may have added the references (System.Xml.Linq.dll) so didn't think to show what goes in the namespace, because Mine were already referenced.

It should be

[php]
Imports System.Linq
Imports System.Xml.Linq
Imports System.Data
[/php]


Xelement is a part of System.Xml.Linq
#8 · edited 16y ago · 16y ago
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

  • [Solved]Need help. Key_public.xmlBy wildcatjonah in Call of Duty Modern Warfare 2 Help
    3Last post 15y ago
  • help editing rez FILE PLZ HELP!By uzair786uzzy in Combat Arms Mod Discussion
    2Last post 16y ago
  • [Help] Editing Uniform TexturesBy Kyuubiwar in Combat Arms Mod Discussion
    5Last post 16y ago
  • [Help]Basic Text Box[Solved]By FlashDrive in Visual Basic Programming
    3Last post 16y ago
  • [Help] Editting Module to make It undetectedBy Kung Fu Penguin31 in WarRock - International Hacks
    3Last post 18y ago

Tags for this Thread

None