public static void FillBoxes(this MdbReader reader, string tableName, int rowindex, IList <TextBox> boxes, int shift = 0) { var values = reader.Reader.SelectRowRange(tableName, rowindex); if (boxes.Count + shift > values.Length) { throw new Exception("shift"); } for (var idx = 0; idx < boxes.Count; idx++) { boxes[idx].Text = values[idx + shift]; } }
static List <Record> MdbReaderDemo(Dictionary <string, Type> settings) { // http://ec.nikkeibp.co.jp/nsp/dl/09412/index.shtml // http://ec.nikkeibp.co.jp/nsp/dl/03634/index.shtml // https://www.vector.co.jp/soft/dl/winnt/business/se469691.html MdbReader reader = new MdbReader( "./03634/第13章/名刺管理13_12.mdb", "会社と部署", settings, Encoding.GetEncoding("Shift-JIS") ); return(reader.Read()); }
public static void FillComboBox(this MdbReader reader, string tablename, string columnname, ComboBox comboBox) { try { foreach (var name in reader.Reader.SelectColumnRange <string>(tablename, columnname)) { comboBox.Items.Add(name); } comboBox.SelectedIndex = 0; } catch (Exception) { MessageBox.Show(string.Format("Ошибка при чтении из таблицы '{0}' и колонки '{1}'", tablename, columnname), "Ошибка чтения", MessageBoxButton.OK, MessageBoxImage.Error); } }
static void Main(string[] args) { var targetPath = "C:\\Users\\hyun\\Documents\\ZinnyTestApp\\RinityTest\\Library\\ScriptAssemblies\\Assembly-CSharp.dll"; var mdbPath = "C:\\Users\\hyun\\Documents\\ZinnyTestApp\\RinityTest\\Library\\ScriptAssemblies\\Assembly-CSharp.dll.mdb"; if (args.Length != 0) { targetPath = args[0]; mdbPath = args[0] + ".mdb"; } var unityScript = ModuleDefinition.ReadModule(targetPath); var symFile = MonoSymbolFile.ReadSymbolFile(mdbPath); var mdb = new MdbReader(unityScript, symFile); Global.output = new Output(); Global.module = unityScript; Global.mdbReader = mdb; var mscorlibName = unityScript.AssemblyReferences .Where(x => x.Name.Contains("mscorlib")) .First(); Global.mscorlib = unityScript.AssemblyResolver.Resolve(mscorlibName).MainModule; var systemName = unityScript.AssemblyReferences .Where(x => x.Name.Contains("System")) .First(); Global.system = unityScript.AssemblyResolver.Resolve(systemName).MainModule; var weaver = new Aspects.Weaver(); var errors = weaver.ProcessModule(unityScript); unityScript.Write("tmp.dll"); unityScript.Dispose(); System.IO.File.Replace("tmp.dll", targetPath, null); var json = Newtonsoft.Json.JsonConvert.SerializeObject(Global.output); Console.Write(json); }
public void ReadMdb(ReadMdbArgs args) { var reader = new MdbReader(args.File); if (args.Year == 0) { args.Year = DateTime.Today.AddMonths(-1).Year; } if (args.Month == 0) { args.Month = DateTime.Today.AddMonths(-1).Month; } var data = reader.Read(args.Year, args.Month); var filename = new Writer().Write(data, args.Json); Console.WriteLine($"{filename} wurde erzeugt."); }
public MdbModuleEntry(ModuleDefinition module, Stream symbolStream) { this.module = module; mdbReader = new MdbReader(module, MonoSymbolFile.ReadSymbolFile(symbolStream)); }