コード例 #1
0
        public void WriteBase64Data()
        {
            var file = new FileInfo(ConfigurationManager.AppSettings["Data.File"]);

            byte[] bytes = null;
            using (var stream = new MemoryStream())
            {
                file.OpenRead().CopyTo(stream);
                bytes = stream.ToArray();
            }

            var csFile = new FileInfo(Path.Combine(Deployer.GetCollectDir().FullName, "Analysis/Nodes.Data.cs"));

            using (var writer = new StreamWriter(csFile.FullName))
            {
                writer.WriteLine("namespace AIGames.TexasHoldEm.ACDC.Analysis");
                writer.WriteLine("{");
                writer.WriteLine("\tpublic static partial class Nodes");
                writer.WriteLine("\t{");
                writer.Write("\t\tpublic static string GetData() { return ");
                writer.Write('"');
                writer.Write(Convert.ToBase64String(bytes));
                writer.Write('"');
                writer.WriteLine(";}");
                writer.WriteLine("\t}");
                writer.WriteLine("}");
            }
        }
コード例 #2
0
        public void Deploy_Bot_CompileAndZip()
        {
            var version = typeof(ACDCBot).Assembly.GetCustomAttribute <AssemblyFileVersionAttribute>().Version;
            var nr      = int.Parse(version.Split('.')[0]);

            Deployer.Run(Deployer.GetCollectDir(), "ACDC", nr.ToString("0000"), false);
        }