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
2 answers

Removing extension from multiple selected files and only using 50 characters of it

I have two separate questions: a) How to remove .mp3 / .mpeg extensions from multiple selected files b) When the multiple files are added to the listbox. How can I set a max character length (50 chars) String[] files, paths; private void…
Robl0x
  • 3
  • 3
-2
votes
1 answer

How to view a text file in a richtextbox without a openfiledialog in VB.NET

I want to open a text file into a richtextbox without using a OpenFileDialog in VB.NET
Nat569On
  • 23
  • 1
  • 4
-2
votes
2 answers

OpeFileDialog VB.net

When i use openfiledialog.Filter somthing goes wrong. Here's my code: openFileDialog1.Filter = "Video and Music Files (*.asf, *.wma, *.wmv, *.wm, *.asx, *.wax, *.wvx, *.wmx, *.wpl, *.dvr-ms, *.wmd, *.avi, *.mpg, *.mpeg, *.m1v, *.mp2, *.mp3, *.mpa,…
Ewan
  • 11
  • 1
-2
votes
2 answers

OpenFileDialog open folder with exe

How can I promptly open application's folder using OpenFileDialog ? OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; if…
user1872295
  • 15
  • 1
  • 3
-2
votes
1 answer

How to specify output directory for .exe in C#

I am developing wpf application in C#. I have one button on which I am browsing file system through Microsoft.Win32.OpenFileDialog. There is one submit button on which I am calling the Process.Start() to run .exe on grib file. The exe generate the…
Shailesh Jaiswal
  • 3,606
  • 13
  • 73
  • 124
-3
votes
2 answers

Streamread an array C#

string [] filenames = openFileDialog1.FileNames; How can I read this array? Would I need to set each file path to its own string??? I'm clueless.
wizlog
  • 302
  • 7
  • 22
-3
votes
1 answer

Prompt the User a OpenFileDialog then automatically saving the file in a different location (.net Winform)

im implementing this tool that will enable the user to specify a certain excel file that i am parsing and doing some work with ... (Windows form application .net C#) i want to save, the file that the user is choosing(locally) using the…
N Jay
  • 1,774
  • 1
  • 17
  • 36
-3
votes
2 answers

Copy a file and change the name

I was asked to make a file copier that will change the name of a file, by adding "_Copy", but will keep the type of file. For example: c:\...mike.jpg to: c:\...mike_Copy.jpg Here is my code: private void btnChseFile_Click(object sender, EventArgs…
Elad Tzabari
  • 37
  • 1
  • 4
-3
votes
1 answer

open file dialog return multiple file names (Visual Basic 2010 C#)

How to make a OpenFileDialog1 object return multiple paths of the selected files to a multi-line textbox?
NicusorN5
  • 3
  • 1
-3
votes
2 answers

How to make a macro that allows the user to choose and open a word file

I have an Excel file and I want to have a macro in it that allows the user to choose any Word File and then open this selected file. Is this possible? May I know what is the correct way to achieve my objective?
-3
votes
2 answers

OpenFileDialog return an exception when it is empty

bool gGender = false; if (radioBtnMale.Checked == true) gGender = true; if (!string.IsNullOrEmpty(txtboxName.Text)) { if (imageToByteArray(Image.FromFile(openFileDialogPhoto.FileName)) == null) { …
Anas Salem
  • 177
  • 1
  • 2
  • 13
-3
votes
1 answer

How can I display an error which prevents the OpenFileDialog class from closing in C#?

I am creating a basic drawing program in which the user can open projects by clicking on a certain .png file in the class. I am using the System.Windows.Forms.OpenFileDialog class. How can I make it so the Dialog shows an error, without closing, if…
Krikor Ailanjian
  • 1,842
  • 12
  • 17
-3
votes
1 answer

C#: OpenFileDialog copy a file

Hi I have a button with this code: OpenFileDialog ofd = new OpenFileDialog(); string percorso = Environment.CurrentDirectory; percorso += @"\img\Articoli"; ofd.InitialDirectory = percorso; ofd.Filter = "File…
user1849976
  • 53
  • 1
  • 10
-4
votes
1 answer

Get path from openfile dialog

I open a file in this way and that works fine: var openFileDialog = new OpenFileDialog; if (openFileDialog.ShowDialog().GetValueOrDefault()) { Browser.FileDoc = File.ReadAllText(openFileDialog.FileName); } Now, I want to get the path and pass…
Stampy
  • 456
  • 7
  • 27
-5
votes
1 answer

Why can't I play an MP3 file from a separate object?

WIP MP3-Player The commented code doesn't work, but the currently uncommented code below does. I can open the dialog window, but after selecting the mp3-file, it doesn't play. The uncommented code does play the mp3-file. Problem at "Öffnen der…
YEA1903
  • 57
  • 8
1 2 3
71
72