CSharp examples for System.IO:File Path
Get Path To Save using SaveFileDialog
using System.IO ; using System.Windows.Forms ; using System;//from w w w . j a va 2s .c om public class Main{ public static string GetPathToSave(string title, string defaultName ,string iniDir) { string extendName = Path.GetExtension(defaultName); SaveFileDialog saveDlg = new SaveFileDialog(); saveDlg.Filter = string.Format("The Files (*{0})|*{0}", extendName); saveDlg.FileName = defaultName; saveDlg.InitialDirectory = iniDir; saveDlg.OverwritePrompt = false ; if(title != null) { saveDlg.Title = title ; } DialogResult res = saveDlg.ShowDialog (); if(res == DialogResult.OK) { return saveDlg.FileName ; } return null ; } }