PareX

Advanced Code

May 29th, 2019
16,857
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. List Box:
  3. => fastColoredTextBox1.Text = File.ReadAllText($"./Scripts/{listBox1.SelectedItem}");
  4.  
  5. Refresh Code :
  6.  
  7. listBox1.Items.Clear();//Clear Items in the LuaScriptList
  8.             Functions.PopulateListBox(listBox1, "./Scripts", "*.txt");
  9.             Functions.PopulateListBox(listBox1, "./Scripts", "*.lua");
  10.  
  11.  
  12. Code to put into Functions :
  13.  
  14. public static void PopulateListBox(ListBox lsb, string Folder, string FileType)
  15.         {
  16.             DirectoryInfo dinfo = new DirectoryInfo(Folder);
  17.             FileInfo[] Files = dinfo.GetFiles(FileType);
  18.             foreach (FileInfo file in Files)
  19.             {
  20.                 lsb.Items.Add(file.Name);
  21.             }
  22.         }
  23.  
  24.  
  25. Execute Button :
  26.  
  27.   if (NamedPipes.NamedPipeExist(NamedPipes.luapipename))
  28.             {
  29.                 NamedPipes.LuaPipe(fastColoredTextBox1.Text);
  30.             }
  31.             else
  32.             {
  33.                 MessageBox.Show("Please Attach First", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
  34.             }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×