void SaveProfileEvent(object sender, EventArgs e) { if (CURRENTDISPLAYEDRELATION.Count < 1) { return; } SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.Filter = "Pr0file Files (*.pr0file)|*.pr0file|All filed (*.*)|*.*"; saveFileDialog1.Title = "Load Pr0file"; saveFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); string filePath; saveFileDialog1.ShowDialog(); filePath = saveFileDialog1.FileName; string[] pathParts = filePath.Split('\\'); if (pathParts.Length > 0) { MainStructure.lastOpenedLocation = pathParts[0]; for (int i = 1; i < pathParts.Length - 1; ++i) { MainStructure.lastOpenedLocation = MainStructure.lastOpenedLocation + "\\" + pathParts[i]; } } MainStructure.SaveProfileTo(filePath); }