ShellExecute

     [DllImport("shell32.dll")]
        public extern static IntPtr ShellExecute(IntPtr hwnd,
                                                 string lpOperation,
                                                 string lpFile,
                                                 string lpParameters,
                                                 string lpDirectory,
                                                 int nShowCmd
                                                );
        public enum ShowWindowCommands : int
        {

            SW_HIDE = 0,
            SW_SHOWNORMAL = 1,
            SW_NORMAL = 1,
            SW_SHOWMINIMIZED = 2,
            SW_SHOWMAXIMIZED = 3,
            SW_MAXIMIZE = 3,
            SW_SHOWNOACTIVATE = 4,
            SW_SHOW = 5,
            SW_MINIMIZE = 6,
            SW_SHOWMINNOACTIVE = 7,
            SW_SHOWNA = 8,
            SW_RESTORE = 9,
            SW_SHOWDEFAULT = 10,
            SW_MAX = 10
        }
一下则是为实现我上述两个功能的函数调用:
1、访问http://blog.csdn.net/wellwelcome
ShellExecute(this.Handle, "open", "http://blog.csdn.net/wellwelcome", null, null, (int)ShowWindowCommands.SW_SHOW);
2、email [email protected]
ShellExecute(this.Handle, "open", "mailto:[email protected]", null, null, (int)ShowWindowCommands.SW_SHOW);

你可能感兴趣的:(execute)