public void SaveFileDialogTest() { var title = "SaveFileDialogTest"; var dir = @"C:\Program Files\"; var defaultName = "Default File Name"; var filter = "*.txt"; ComdlgUtility.SaveFileDialog(title, dir, defaultName, filter); }
protected void OnSaveBtnClick() { if (string.IsNullOrEmpty(currentFile)) { var fileName = "New text"; if (newFileNumber > 0) { fileName += (" " + newFileNumber); } var saveFile = ComdlgUtility.SaveFileDialog("Save File", workDir, fileName, "Text(*.txt)\0*.txt"); if (string.IsNullOrEmpty(saveFile)) { return; } currentFile = saveFile; } File.WriteAllText(currentFile, ipt_Content.text); }