zoukankan      html  css  js  c++  java
  • 调用Outlook发送邮件

          #region 查找与指定文件关联在一起的程序的文件名
            /// <summary>
            /// 查找与指定文件关联在一起的程序的文件名
            /// </summary>
            /// <param name="hwnd">窗口句柄</param>
            /// <param name="lpOperation">指定字串“open”来打开lpFlie文档,或指定“Print”来打印它</param>
            /// <param name="lpFile">想用关联程序打印或打开一个程序名或文件名</param>
            /// <param name="lpParameters">如lpszFlie是可执行文件,则这个字串包含传递给执行程序的参数</param>
            /// <param name="lpDirectory">想使用的完整路径</param>
            /// <param name="nShowCmd">定义了如何显示启动程序的常数值</param>
            /// <returns>非零表示成功,零表示失败</returns>
            [DllImport("shell32.dll", EntryPoint = "ShellExecuteA")]
            public static extern int ShellExecute(
             IntPtr hwnd,
             String lpOperation,
             String lpFile,
             String lpParameters,
             String lpDirectory,
             int nShowCmd
             );
            #endregion
    
            private void button1_Click(object sender, EventArgs e)
            {
                if (textBox1.Text != "")
                {
                    if (Regex.IsMatch(textBox1.Text, @"w+([-+.']w+)*@w+([-.]w+)*.w+([-.]w+)*"))
                        ShellExecute(this.Handle, String.Empty, "mailto:" + textBox1.Text, String.Empty, String.Empty, 1);
                    else
                    {
                        MessageBox.Show("请输入正确的邮箱格式");
                        textBox1.Text = string.Empty;
                    }
                }
            }
    
  • 相关阅读:
    用iptables 实现本地端口转发
    hive查询
    IOS畅销榜
    java多线程系列7-停止线程
    java多线程系列6-阻塞队列
    java多线程系列5-死锁与线程间通信
    java多线程系列4-线程池
    java多线程系列3-线程同步
    java多线程系列2-线程控制
    java多线程系列1--线程实现与调度
  • 原文地址:https://www.cnblogs.com/ziranquliu/p/4722589.html
Copyright © 2011-2022 走看看