private void SaveFile(string dbtype, bool isrequired, string version, string filename) { AutoUpdate autoUpdate = new AutoUpdate(); byte[] context = autoUpdate.GetFile(dbtype, isrequired, version, filename); if (context.Length == 0) { return; } if (!Directory.Exists(Utils.GetMapPath(upgradedir))) { Directory.CreateDirectory(Utils.GetMapPath(upgradedir)); } FileStream fs = new FileStream(Utils.GetMapPath(upgradedir + "/" + filename), FileMode.Create); fs.Write(context, 0, context.Length); fs.Close(); }