filedialog

Is there an OpenFileOrFolderDialog object in .NET?

大兔子大兔子 提交于 2019-12-01 04:07:42
Is it possible to use the OpenFileDialog class select a file OR folder? It appears only to allow the selection of a file, if you select a folder and then choose open it will navigate to that folder. If the OpenFileDialog can not be used for this is there another object I should be using? EDIT : The scenario is that I have a tool that can upload one...many files or folders. I need to be able to provide a dialog like the OpenFileDialog that allows a user to select a file, folder, or a combination of. I know about the FolderBrowseDialog and that is not the answer in this case. This is the

Is there an OpenFileOrFolderDialog object in .NET?

微笑、不失礼 提交于 2019-12-01 01:41:48
问题 Is it possible to use the OpenFileDialog class select a file OR folder? It appears only to allow the selection of a file, if you select a folder and then choose open it will navigate to that folder. If the OpenFileDialog can not be used for this is there another object I should be using? EDIT : The scenario is that I have a tool that can upload one...many files or folders. I need to be able to provide a dialog like the OpenFileDialog that allows a user to select a file, folder, or a

Capturing the close of the browse for file window with JavaScript

二次信任 提交于 2019-12-01 01:35:35
问题 I am using infile to ask the users to browse for a file on their machine. Is there way to catch if the window is closed without file being selected? For example if x is clicked. <input type="file" name="data" id="inFile" size="15" style="display:none" onchange="handleFiles(this)"/> Thanks 回答1: With the solution from HTML input file selection event not firing upon selecting the same file, I think you can use this: <input type="file" name="data" id="inFile" /> var fileElem = document

Get the path from a QML url

爱⌒轻易说出口 提交于 2019-11-30 08:53:48
FileDialog gives a QML url variable. theurl.toString() gives something like file:///c:\foo\bar.txt . How do I get c:\foo\bar.txt ? I want to do it in a cross-platform way, and ideally without relying on regex-style hacks. QUrl provides a path() method, but I don't seem to be able to access it from QML. As noted in the comments already, there seems to be no way (yet?) to get the path itself without a regex. So this is the only way to go: Basic solution FileDialog { onAccepted: { var path = myFileDialog.fileUrl.toString(); // remove prefixed "file:///" path = path.replace(/^(file:\/{3})/,""); //

What does the FileDialog.RestoreDirectory Property actually do?

邮差的信 提交于 2019-11-30 00:17:58
问题 I've read about the property on MSDN, but I still don't understand what it does. Gets or sets a value indicating whether the dialog box restores the current directory before closing. What exactly does that mean? What does 'restoring' the current directory actually do? Thanks for the help. 回答1: IIRC, in windows XP when you press Save on a SaveFileDialog (or Open on a OpenFileDialog ) the directory where the file is saved (or opened), is set as the new current working directory (the one in

Python Tkinter: Adding widgets to file dialogs

痴心易碎 提交于 2019-11-29 15:18:36
I am using Tkinter with Python 2.6 and 2.7 for programming graphic user interfaces. These User Interfaces contain dialogs for opening files and saving data from the tkFileDialog module. I would like to adapt the dialogs and add some further entry widgets e.g. for letting the user leave comments. Is there any way for doing so? It seems that the file dialogs are taken directly from the operating system. In Tkinter they are derived from the Dialog class in the tkCommonDialog module and call the tk.call("tk_getSaveFile") method of a frame widget (in this case for saving data). I could not find out

Get the path from a QML url

試著忘記壹切 提交于 2019-11-29 11:52:13
问题 FileDialog gives a QML url variable. theurl.toString() gives something like file:///c:\foo\bar.txt . How do I get c:\foo\bar.txt ? I want to do it in a cross-platform way, and ideally without relying on regex-style hacks. QUrl provides a path() method, but I don't seem to be able to access it from QML. 回答1: As noted in the comments already, there seems to be no way (yet?) to get the path itself without a regex. So this is the only way to go: Basic solution FileDialog { onAccepted: { var path

Defaulting a folder for FileDialog in VBA

三世轮回 提交于 2019-11-28 09:47:24
Private Sub Command93_Click() Dim f As Object Dim strFile As String Dim strFolder As String Dim varItem As Variant Dim P As String Dim DeleteEverything As String DoCmd.SetWarnings False DeleteEverything = "DELETE * FROM [TABLE]" DoCmd.RunSQL DeleteEverything Set f = Application.FileDialog(3) f.AllowMultiSelect = False If f.Show Then For Each varItem In f.SelectedItems strFile = Dir(varItem) strFolder = Left(varItem, Len(varItem) - Len(strFile)) P = strFolder & strFile Next End If Set f = Nothing DoCmd.TransferText acImportFixed, "[IMPORT SPECIFICATION]", "[TABLE]", P, False End Sub How to make

How can I make a java FileDialog accept directories as its FileType in OS X?

ぃ、小莉子 提交于 2019-11-28 01:52:57
I am trying to switch from using a JFileChooser to a FileDialog when my app is being run on a mac so that it will use the OS X file chooser. So far I have the following code: FileDialog fd = new FileDialog(this); fd.setDirectory(_projectsBaseDir.getPath()); fd.setLocation(50,50); fd.setFile(?); fd.setVisible(true); File selectedFile = new File(fd.getFile()); What would I put in for the question ? so that my file chooser would allow any directory to be the input for file chooser (the method that follows already checks to make sure that the directory is the right kind of directory I just want to

Ask user where to save file with Node.js

耗尽温柔 提交于 2019-11-27 16:32:16
问题 I'm creating an app using node-webkit, so there's a lot of javascript. I have written a node.js function that will take a screen shot and save it to the disk, however, it saves it to the project root dir and I would like to prompt the user to choose a save location, but I cannot find a way to create a save file dialog. Current code: screen_shot.js: var fs = require('fs'); exports.buildFile = function(name, value) { var img = new Buffer(value, encoding='base64'); fs.writeFile(name, img,