Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Text
- Imports System.IO
- Imports System.Net.Sockets
- Imports System.Xml
- Imports System.Data
- Module Server
- Private DT As DataTable
- Private DS As New DataSet
- Sub Main()
- Console.Clear()
- Console.WriteLine("Project Slam Daemon")
- Console.WriteLine("v1.00.51111")
- Console.WriteLine("")
- Console.WriteLine("")
- Console.WriteLine("Checking configuration file...")
- Console.WriteLine("")
- XMLConfigReader()
- End Sub
- Sub XMLConfigReader()
- If File.Exists("C:\Program Files\Project Slam\Daemon\PSDaemon.xml") = False Then
- Console.WriteLine("Configuration doesn't exist! Starting config maker...")
- Console.WriteLine("")
- Console.WriteLine("Project Slam Daemon Setup")
- Console.WriteLine("-------------------------")
- Console.WriteLine("")
- Console.WriteLine("What port do you want clients to connect to?")
- Dim iPort As Integer = Console.ReadLine()
- Console.WriteLine("")
- Console.WriteLine("[" & iPort & "] is now set.")
- DT = New DataTable()
- DT.Columns.Add(New DataColumn("ServerPort", Type.GetType("System.Int32")))
- FillTable(1, "ServerPort", iPort)
- DS.Tables.Add(DT)
- DS.Tables(0).TableName = "Settings"
- DS.WriteXml("PSDaemon.xml")
- Console.WriteLine("")
- Console.WriteLine("Settings have been stored in PSDaemon.xml")
- Console.ReadLine()
- End If
- End Sub
- Sub FillTable(ByVal pID As Integer, ByVal pName As String, ByVal iPort As Integer)
- Dim DR As DataRow
- DR = DT.NewRow
- DR("ServerPort") = pID
- DT.Rows.Add(DR)
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement