public static int New(string prefix) { string filename = prefix + "_AI.bin"; BinaryHelper<packAI> binaryHelper = new BinaryHelper<packAI>(); if (!binaryHelper.FileExists(filename) ) { binaryHelper.SaveObject(new packAI() { Number = 0 }, filename); } packAI pack = binaryHelper.LoadObject(filename); pack.Number++; binaryHelper.SaveObject(pack,filename); return pack.Number; }