tangogc Posted May 24, 2011 Share Posted May 24, 2011 LFA do you have a script to extract in one folder all game configuration file ? thanks Link to comment Share on other sites More sharing options...
LFA Posted June 4, 2011 Share Posted June 4, 2011 I don't understand the question. Do you want to export all game config files? That makes more sense Link to comment Share on other sites More sharing options...
tangogc Posted June 4, 2011 Author Share Posted June 4, 2011 Yes Luis Link to comment Share on other sites More sharing options...
LFA Posted June 4, 2011 Share Posted June 4, 2011 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 More sharing options...
tangogc Posted June 5, 2011 Author Share Posted June 5, 2011 it works thanks a lot Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.