Advertisement
DrAungWinHtut

ListBox FileList Process in CS

Mar 10th, 2022
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Diagnostics;
  11. using System.IO;
  12.  
  13.  
  14. namespace _2022030201_CS_Array_Tutorial
  15. {
  16. public partial class frmUI : Form
  17. {
  18. public frmUI()
  19. {
  20. InitializeComponent();
  21. }
  22.  
  23. private void picDigital_Click(object sender, EventArgs e)
  24. {
  25. Process.Start(@"C:\Users\aungw\Downloads\Compressed\Digital Logic Sim (windows)\Digital Logic Sim (windows)\Digital Logic Sim\Digital Logic Sim.exe");
  26. }
  27.  
  28. private void picPaint_Click(object sender, EventArgs e)
  29. {
  30. Process.Start("mspaint");
  31. }
  32.  
  33. private void picNote_Click(object sender, EventArgs e)
  34. {
  35. //Process.Start("notepad", @"D:\CStutorial\Python\robot.py");
  36. Process.Start("notepad", lstFileList .SelectedItem .ToString ());
  37. }
  38.  
  39. private void picCommand_Click(object sender, EventArgs e)
  40. {
  41. Process.Start("cmd");
  42. }
  43.  
  44. private void frmUI_Load(object sender, EventArgs e)
  45. {
  46. string[] saFileList = Directory.GetFiles(txtPath.Text);
  47. foreach (string sFile in saFileList)
  48. {
  49. lstFileList .Items.Add (sFile);
  50. }
  51. lstFileList.SelectedIndex = 0;
  52. }
  53. }
  54. }
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement