zoukankan      html  css  js  c++  java
  • 有参数的程序,可以被调用

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Windows.Forms;
    using System.IO;
    
    namespace SendMail
    {
        static class Program
        {
            /// <summary>
            /// 应用程序的主入口点。
            /// </summary>
            [STAThread]
            static void Main(string[] Arrs)
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
               //Application.Run(new Form1());
                if (Arrs == null) { WriteErr("No Parameter"); return; }
    
                string sfrom = "";
                string sto = "";
                string scc = "";
                string sbcc = "";
                string ssubject = "";
                string sbody = "";
                string satt = "";
                string[] Arr = Arrs[0].Split('|');
                if (Arr.Length > 0)
                    sfrom = Arr[0];
                if (Arr.Length > 1)
                    sto = Arr[1];
                if (Arr.Length > 2)
                    scc = Arr[2];
                if (Arr.Length > 3)
                    sbcc = Arr[3];
                if (Arr.Length > 4)
                    ssubject = Arr[4];
                if (Arr.Length > 5)
                    sbody = Arr[5];
                if (Arr.Length > 6)
                    satt = Arr[6];
                if (sfrom == "" || (sto == "" && scc == "")) { WriteErr("Parameter Error"); return; }
    
                SendMail.Mail SendMail = new SendMail.Mail();
                string Err = SendMail.SendMail(sfrom, sto, scc, sbcc, ssubject, sbody, satt);
                WriteErr(Err);
            }
    
            static void WriteErr(string strErr)
            {
                if (strErr == "") return;
                System.IO.StreamWriter sw;
                sw = new StreamWriter(Application.StartupPath + "\Error.err", false, System.Text.Encoding.Default);
                sw.WriteLine(strErr);
                sw.Flush();
                sw.Close();
            }
        }
    }
  • 相关阅读:
    Math.pow
    css3正方体
    制作一个百度换肤效果
    排他思想
    js栈和堆的区别
    js创建对象的几种方式(工厂模式、构造函数模式、原型模式)
    短网址
    this
    作用域
    JS 函数基础
  • 原文地址:https://www.cnblogs.com/vinsonLu/p/3656994.html
Copyright © 2011-2022 走看看