Forum > Coding >

anyone got a openfile dialog code please?

Posts: 67

Threads: 16

Joined: Apr, 2018

Reputation: 0

Posted

soz, cannot be asked to search it, busy rn
  • 0

Posts: 212

Threads: 42

Joined: May, 2018

Reputation: 0

Replied

Seriously? It's extremely simple. Here I'll give a tutorial

if (ofd.ShowDialog() == DialogResult.OK) // This is the if statement for ShowDialog
                {
                    try
                    {
                        if ((myStream = ofd.OpenFile()) != null) // This is the myStream so that it can open the file dialog
                        {
                            using (myStream) // This using a myStream
                            {
                                TEXTBOXHERE0.Text = File.ReadAllText(ofd.FileName); // This will copy the code from the files into your execution box
                            }
                        }
                    }
                    catch (Exception ex) // The exception or error
                    {
                        MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
                    }
  • 0

Posts: 17

Threads: 4

Joined: Jun, 2018

Reputation: 0

Replied

Lua Master can you add me on discord please I need help
My discord : [YT] iNatusDope@gmail.com
  • 0

Added

oof I mean [YT] iNatusDope#8617
  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )