使用一下代码:
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();
            foreach (SHDocVw.InternetExplorer ie in shellWindows)
            {
                if (Path.GetFileNameWithoutExtension(ie.FullName).ToLower().Equals("iexplore"))
                {
                    if (ie.HWND == GetForegroundWindow().ToInt32())
                    {
                        textBox1.Text += ie.LocationURL;
                    }
                }
            }发现获取的仍然是浏览器所有标签的网址,无法获得当前活动标签的网址