Program.cs
上传用户:hbhltzc
上传日期:2022-06-04
资源大小:1925k
文件大小:1k
源码类别:

xml/soap/webservice

开发平台:

Visual C++

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Windows.Forms;
  4. namespace XmlNotepad {
  5.     static class Program {
  6.         /// <summary>
  7.         /// The main entry point for the application.
  8.         /// </summary>
  9.         [STAThread]
  10.         static void Main(string[] args) {
  11.             Application.EnableVisualStyles();
  12.             Application.SetCompatibleTextRenderingDefault(false);
  13.             MyForm form = new MyForm();
  14.             form.Show();
  15.             Application.DoEvents();
  16.             foreach(string arg in args){
  17.                 if (!string.IsNullOrEmpty(arg)) {
  18.                     char c = arg[0];
  19.                     if (c == '-' || c == '/') {
  20.                         switch (arg.Substring(1).ToLowerInvariant()) {
  21.                             case "offset":
  22.                                 form.Location = new System.Drawing.Point(form.Location.X + 20, form.Location.Y + 20);
  23.                                 break;
  24.                         }
  25.                     } else {
  26.                         form.Open(arg);
  27.                     }
  28.                 }
  29.             }
  30.             Application.Run(form);
  31.         }
  32.     }
  33. }