Questions tagged [openfiledialog]

The OpenFileDialog is a (component) class in the .NET Framework that prompts the user to open one or multiple files.

The OpenFileDialog component allows users to browse the folders of their computer or any computer on the network and select one or more files to open. The dialog returns full path names of the files selected by user.

1068 questions
-2
votes
1 answer

C# Path.GetFileName() as well as OpenFileDialog.SafeFileName cuts off the underscores in the filename

In my company it is common to name files in the following manner: 210808_Filename.extension Unfortunately both of these ways to get the filename failed: Path.GetFileName() and OpenFileDialog.SafeFileName. In the path itself the underscores exist,…
-2
votes
1 answer

Paint applet - problems loading/saving images

import java.awt.*; import java.applet.*; import java.awt.event.*; import java.awt.event.MouseMotionListener; import java.awt.event.MouseEvent; import java.lang.Math.*; import java.text.*; import java.io.*; import java.awt.Scrollbar.*; import…
-2
votes
1 answer

Open Multiple files in File Dialog Using VB

In windows application using VB, I need to open three xml files one after another from specific path. If first xml file is selected, file dialog pops for next xml. I tried the below code but it is for selecting files together(i.e, which works like…
-2
votes
1 answer

How to open the filedialog after pressing the button?

I would like to open the filedialog after pressing a button. Then I could choose an image and display it on a canvas. (My goal is to do a very simple image editor) Unfortunately, the filedialog open up automatically when I start the program. Is…
-2
votes
2 answers

C# Writing to file line by line

So, I am busy making a c# WinForms application for my company. For this, I need to be able to save my tickets in data with the application. Here is what the ticket dialog looks like: I want to save all the data, in some file stored locally (.txt…
Jort D.
  • 25
  • 1
  • 2
-2
votes
1 answer

How to prevent an exception when canceling an OpenFileDialog?

I click on the button to upload a photo. When I cancel the photo selection, the program throws an exception. Here's my code: private void button1_Click(object sender, EventArgs e) { Image img = new Image
MSC
  • 1
  • 4
-2
votes
1 answer

How to choose a file in an already opened FileDialog

I want to choose a file from an already opened OpenFileDialog which is shown by the browser. I want to use code similar to the following example: OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "txt files (*.txt)|*.txt|All files…
kame
  • 20,848
  • 33
  • 104
  • 159
-2
votes
1 answer

open file dialog keeps on showing even after choosing file c#

I'm working with window forms on c# I'm trying to open a file using openfile dialog when I browse to my file and open it the open file dialog keeps on showing many times . That's my code for opening a file : private void OpenBtn_Click(object…
Code4Living
  • 35
  • 1
  • 8
-2
votes
1 answer

Get path string without user having to select a file

I want to use the equivalence of open file dialog box in windows forms (FolderBrowserDialog) in asp. I see the FileUpload class but the user is still forced to select a file. I only want the directory portion. The resulting string that contains…
-2
votes
3 answers

c# how to show image in picturebox if file format is .jpg

i have a problem. i want to load image file or rar/zip to my WPF. when i click button on my WPF to open file dialog, i got some errors. this is my code to open file dialog. private void button1_Click(object sender, EventArgs e) { try { …
sony acra
  • 11
  • 1
  • 4
-2
votes
2 answers

OpenFileDialog pre select a file

I have a form wich call OpenFileDialog. I want a certain file to be focused in advance (Highlighted) in the files pane. Is it possible? I have code where i can select all files, now i want 1 file to be selected. Public Class Form1 Private Sub…
Marc F
  • 33
  • 5
-2
votes
1 answer

Take user input and use it as Process

So basically, I have a OpenFileDialog where the user will select a location. I made it so it would display the directory in a textbox. But what I want is have another button which would take that directory and start it by using…
AaronKek
  • 21
  • 1
  • 6
-2
votes
2 answers

OpenFileDialog() - How to set the MultiSelect option based on the file filter?

OpenFileDialog() - How to set the MultiSelect option based on the file filter? My OpenFileDialog can select 2 types of files. This is the Filter used: "LFA or log files (.lfa, .log)|.lfa;.log" With MultiSelect property set to false. New requirement…
Malu MN
  • 141
  • 2
  • 10
-2
votes
1 answer

Load image by extension in folder using C#

I have OpenFileDialog name of1. How to load all image with extension (.png) in a folder by C#?
-2
votes
3 answers

Using open file dialog to choose the file location of a text file and use it in stream reader

I am trying to make a try catch that will check if the file in filelocation exists or not. If it doesnt i want the open file dialog to open and allow user to be able choose the text file (and only a text file) and read the file location of the…
JhWOLFJh
  • 67
  • 2
  • 15