Forum > Coding >

Open File button Code help plz

Posts: 4

Threads: 3

Joined: Aug, 2018

Reputation: 0

Posted

Hey can anyone help me with the open file button code please.
  • 0

Posts: 369

Threads: 61

Joined: Apr, 2018

Reputation: 0

Replied


            // Displays an OpenFileDialog so the user can select a LUA. Â 
            OpenFileDialog open = new OpenFileDialog();
            open.Filter = "Text Files|*.txt|Lua Files|*.lua|Lua-C Files|*.luac";
            open.Title = "Select a script";

            // Show the Dialog. Â 
            // If the user clicked OK in the dialog and   
            if (open.ShowDialog() == DialogResult.OK)
            {
REPLACETHISWITHYOURTEXTBOXNAME.Text = File.ReadAllText(open.FileName)
    }
  • 0

Users viewing this thread:

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