Guest User

Untitled

a guest
Jun 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. [STAThread]
  2. static void Main(String[] args)
  3. {
  4. int argCount = args.Length;
  5. }
  6.  
  7. class Program {
  8. [STAThread]
  9. static void Main(String[] args) {
  10. Console.WriteLine("Have {0} arguments", args.Length);
  11. for (int i = 0; i < args.Length; ++i) {
  12. Console.WriteLine("{0}: {1}", i, args[i]);
  13. }
  14. }
  15. }
  16.  
  17. static class Program {
  18. /// <summary>
  19. /// The main entry point for the application.
  20. /// </summary>
  21. [STAThread]
  22. static void Main(string[] args) {
  23. FormMain.Args = args;
  24.  
  25. Application.EnableVisualStyles();
  26. Application.SetCompatibleTextRenderingDefault(false);
  27. Application.Run(new FormMain());
  28. }
  29. }
  30.  
  31. public partial class FormMain: Form {
  32. public static string[] Args;
  33.  
  34. public FormMain() {
  35. InitializeComponent();
  36. }
  37.  
  38. private void FormMain_Shown(object sender, EventArgs e) {
  39. foreach (string s in Args) {
  40. MessageBox.Show(s);
  41. }
  42. }
  43. }
  44.  
  45. static class Program {
  46. /// <summary>
  47. /// The main entry point for the application.
  48. /// </summary>
  49. [STAThread]
  50. static void Main(string[] args) {
  51. FormMain.Args = args;
  52.  
  53. Application.EnableVisualStyles();
  54. Application.SetCompatibleTextRenderingDefault(false);
  55. Application.Run(new FormMain());
  56. }
  57. }
  58.  
  59. public partial class FormMain: Form {
  60. public static string[] Args;
  61.  
  62. public FormMain() {
  63. InitializeComponent();
  64. }
  65.  
  66. private void FormMain_Shown(object sender, EventArgs e) {
  67. foreach (string s in Args) {
  68. MessageBox.Show(s);
  69. }
  70. }
  71. }
Add Comment
Please, Sign In to add comment