savefiledialog

Javascript saveas dialog

↘锁芯ラ 提交于 2019-12-08 10:08:38
问题 I am trying to write save as dialog with javascript, I have a content of data, and I want to allow the user to save it, I managed to get the code below to work, but this code is changing the html data, So my question is: 1)How can I retrived the html data back, as it was before I the click on the button? 2)Can I do it more elegant way? <script type="text/javascript"> function saveChanges() { var oldHtml = document.documentElement; document.open("text/html","replace"); document.write("Hello");

ASP.net download and save file in user folder

荒凉一梦 提交于 2019-12-08 08:57:37
问题 I am trying to save a file to the user pc but I am not able to do it. This method gives error since is trying to save the file in C somewhere. I understand it is not approriate. I would like to save the file in the download folder or prompt the user with a file dialog. void SaveReport(Telerik.Reporting.Report report, string fileName) { ReportProcessor reportProcessor = new ReportProcessor(); Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting

Save Image in PictureBox with overlapping Controls

拟墨画扇 提交于 2019-12-08 07:50:29
问题 I am developing an application in which user can select an image in a picture box. After that he can right click on the image and add a user control which will again display an Image along with some text. This user control can be added any number of times. User can also re-position the user controls as per need. All this functionality has been implemented and is working fine. Now, the requirement is to save the Image along with the user control. Above you can see the complete image which

ASP.net download and save file in user folder

此生再无相见时 提交于 2019-12-07 02:52:27
I am trying to save a file to the user pc but I am not able to do it. This method gives error since is trying to save the file in C somewhere. I understand it is not approriate. I would like to save the file in the download folder or prompt the user with a file dialog. void SaveReport(Telerik.Reporting.Report report, string fileName) { ReportProcessor reportProcessor = new ReportProcessor(); Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource(); instanceReportSource.ReportDocument = report; RenderingResult result = reportProcessor

Can you save a file on the local drive through RemoteApp instead of saving to server drives?

你。 提交于 2019-12-06 11:42:32
I have an application written in C# WPF, and saving a generated Word document. Through the RemoteApp settings, I've set to show the local user's logical drives, but they don't have letters next to them. They show up as C on myHostname , D on myHostname , etc. When I open up a SaveFileDialog object, it shows Local Disk (C:) , C on myHostname , and D on myHostname in the left-hand pane. How do I set the filename, if there's no corresponding letter? string filename = @"C:\myDirectory\myFile.docx"; using(WordprocessingDocument myDoc = WordprocessingDocument.Create(filename,

How to restrict FileDialog to specific path

南笙酒味 提交于 2019-12-06 07:39:29
问题 Is it possible to restrict a file dialog(open/save) to a specific folder is winapi? OPENFILENAME fileDialogSettings; ... fileDialogSettings.lpstrInitialDir = "Some path"; ... if(GetOpenFileName(&fileDialogSettings)) { } I want to have "Some path" as root path in the dialog and to restrict navigation to this folder and it's sub folders only. May I use lpfnHook for this? 回答1: If you're targeting Vista+ only, you can make use of the IFileDialogEvents::OnFolderChanging method to block the change

How to prompt user to save an automated Excel file

╄→尐↘猪︶ㄣ 提交于 2019-12-06 02:22:11
I have searched and nothing that I have found hits directly on what I am looking for (or maybe my searches have not hit on the combo of words). In C# I have created an Excel sheet, using Interop.Excel, in which I insert some data and create a chart. This all works fine when I do a xlWorkBook.SaveAs. What I want to do is prompt the user to put the automated workbook somewhere with thier own file name. I have tried ( http://p2p.wrox.com/vb-how/63900-disabling-second-excel-save-prompt.html ) where he basically does a new SaveFileDialog then if its == OK he builds his Excel sheet then he says that

How do I save an Excel file without getting a format warning when opening, using C# and Excel 2010

≯℡__Kan透↙ 提交于 2019-12-05 12:14:40
I'm using Excel 2010. I'm trying so save my excel file, with this code. It does save a .xls file, but when I open the file I get this message: The file you are trying to open, 'tre.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a thrusted source before opening the file. Do you want to open the file now? If I press yes the file opens. But what do I need to get rid of this format-popup? My code: using System; using System.Windows.Forms; using ExcelAddIn1.Classes; using ExcelAddIn1.Classes.Config; using Microsoft.Office

how to save file with GetSaveFileName in win32?

前提是你 提交于 2019-12-05 03:22:09
I write this code to get fileName to save my file : #include "stdafx.h" #include <windows.h> int _tmain(int argc, _TCHAR* argv[]) { OPENFILENAME ofn; char szFileName[MAX_PATH] = ""; ZeroMemory(&ofn, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = NULL; ofn.lpstrFilter = (LPCWSTR)L"Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0"; ofn.lpstrFile = (LPWSTR)szFileName; ofn.nMaxFile = MAX_PATH; ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; ofn.lpstrDefExt = (LPCWSTR)L"txt"; GetSaveFileName(&ofn); printf("the path is : %s\n", ofn.lpstrFile); getchar(); return 0; }

How retrieve only filename from save file dialog [duplicate]

房东的猫 提交于 2019-12-04 23:33:34
问题 This question already has answers here : Obtaining only the filename when using OpenFileDialog property “FileName” (2 answers) Closed 2 years ago . I have a save file dialog and i want to get only the filename entered. Equivalent for openfiledialog.SafeFileName; Save file dialog has no SafeFileName Property and FileName returns both filename, path and extension. Pls how do i extract only file name. 回答1: If you want the filename with extension use Path.GetFileName() . If you want it without