How to open new url on the same open tab?

会有一股神秘感。 提交于 2019-12-11 06:42:38

问题


i am use this code in order to open all link from specific URL, each link will open with new tab, this cause a huge memory use, how can i open the new link on the existing Tab ?

static void Main(string[] args)
{
    ProcessStartInfo processStartInfo = null;
    string googleChoromePath = "C:\\Users\\Dandin\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe";
    string argument = "";
    string url = "http://edition.cnn.com/";
    WebClient wClient = new WebClient();
    string st = wClient.DownloadString(url);
    List<string> list = LinkFinder.Find(st);
    processStartInfo = new ProcessStartInfo(googleChoromePath);

    for (int i = 0; i < list.Count; i++)
    {
        argument = list[i];

        try
        {
            if (argument.StartsWith("http://"))
            {
                processStartInfo.Arguments = argument;
                processStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                processStartInfo.RedirectStandardOutput = true;
                processStartInfo.RedirectStandardError = true;
                processStartInfo.CreateNoWindow = true;
                processStartInfo.UseShellExecute = false;
                processStartInfo.ErrorDialog = false;

                Process googleChrome = Process.Start(processStartInfo);
                Thread.Sleep(1000);
            }
        }
        catch (Exception)
        {

        }
    }
}

来源:https://stackoverflow.com/questions/9750408/how-to-open-new-url-on-the-same-open-tab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!