Jump to content

Supported Games Extraction


tangogc

Recommended Posts

  • 2 weeks later...

Try this:

 

<tcascript>
<language name="VB" />
<waitForUserAction value="true"/>

<scriptCode><![CDATA[

Imports System

Public Class ExportGames
    Public Shared Sub Main()
   Console.WriteLine("STARTING...")

       Dim savedir As String = "C:\GameExport"
       If Not IO.Directory.Exists(savedir) Then System.IO.Directory.CreateDirectory(savedir)
       For Each game As TCAdminSDK.Objects.Game In TCAdminSDK.Objects.Game.GetGames()
           Dim filename As String = game.ShortName.Replace(":", String.Empty) & ".xml"
           For Each c As Char In System.IO.Path.InvalidPathChars
               filename = filename.Replace(c, String.Empty)
           Next
           Console.writeline("Saving: " & filename)
           Dim export As String = game.CopyConfiguration(False)

           Dim fs As System.IO.FileStream = System.IO.File.OpenWrite(System.IO.Path.Combine(savedir, filename))
           Dim writer As New System.IO.StreamWriter(fs)
           writer.Write(export)
           writer.Close()
           fs.Close()
       Next

       Console.WriteLine("Done.")
    End Sub
End Class

]]></scriptCode>

</tcascript>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Who's Online   0 Members, 0 Anonymous, 25 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use