void

C# 调用ie打开URL地址

//方法一

            Process ps = new Process();
            string yourURL = "http://www.fqjyxx.com";
            ps.StartInfo.FileName = "iexplore.exe";
            ps.StartInfo.Arguments = yourURL;
            ps.Start();


//方法二比较直接,但不好用,不知道原因

//System.Diagnostics.Process.Start(textBox2.Text.Trim());
*/

 

我的代码使用方法1 OK

             if (textBox2.Text.Trim().Equals(""))
            {
                MessageBox.Show("请输入视频的URL地址!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            
            Process ps = new Process();
            string yourURL = textBox2.Text.Trim();
            ps.StartInfo.FileName = "iexplore.exe";
            ps.StartInfo.Arguments = yourURL;
            ps.Start();

posted on 2014-09-15 15:59 void 阅读(3211) 评论(0)  编辑  收藏 所属分类: C#


只有注册用户登录后才能发表评论。


网站导航: